Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localhost:8080 doesn't give an error but doesn't display the list either on ubuntu14.04 #21

Open
git-madhav opened this issue May 13, 2015 · 9 comments

Comments

@git-madhav
Copy link

Chad,

if I use the https://6f615fd.ngrok.com on windows chrome browser, pointing to virtual box / ubuntu14, it works fine.

if I do the same on virtual box / ubuntu firefox browser, it doesn't display the list, and it doesn't give an error either. Debug window doesn't show much.

I just noticed, it might be firefox browser issue. I tried to use firefox on windows, it did not work either.

Any ideas?

-Madhav.

@chadxz
Copy link

chadxz commented May 14, 2015

firefox 37.0.2 on OS X 10.10.3 works for me. Does it only happen on windows/linux?

@git-madhav
Copy link
Author

So far the two machines I have tried, yes it happens with windows and Linux.

Regards,
Madhav.

Sent from iPhone!

On May 13, 2015, at 9:09 PM, Chad McElligott [email protected] wrote:

firefox 37.0.2 on OS X 10.10.3 works for me. Does it only happen on windows/linux?


Reply to this email directly or view it on GitHub.

@git-madhav
Copy link
Author

Once bower gets installed, restaurant list gets populated.

npm install -g bower and bower install in Frontier directory should fix this issue.

Thanks to Dusty for this fix.

-Madhav.

@chadxz chadxz closed this as completed May 14, 2015
@chadxz
Copy link

chadxz commented May 14, 2015

for what it's worth, the bower dependencies should have automatically been installed when you do npm install. The fact that they were not is strange to me. Might be worth looking into if this ever happens again.

@chadxz chadxz reopened this May 14, 2015
@chadxz
Copy link

chadxz commented May 14, 2015

It came to light that @git-madhav was using the Docker instructions for running the app, so there may be an issue with running bower in the npm postinstall script due to the docker environment. Looking into that now.

@chadxz
Copy link

chadxz commented May 14, 2015

So i figured out what caused this issue.

  1. if you run make build when you have already installed your node_modules, it will just copy those files over in the COPY . /frontier step of the Dockerfile. The subsequent command RUN npm install will then do pretty much nothing since all the modules are already there. This causes an issue if you are, for example, running boot2docker on OSX and the node_modules have platform-specific things in them. In this case, the download of the ngrok binary looks at your architecture and platform to determine which binary to download. Since I already had installed node_modules prior to running make build, it copied my OSX ngrok binary over into the image, and when it tried to require('ngrok') inside the docker image it exploded because the binary it was trying to run was compiled for OSX not Ubuntu. This was also causing some weirdness with detecting the issue with the bower_components installation, since the docker image that I had built already had the bower_components installed, it was initially unclear to me how the bower_components existed even though they were failing to install.

  2. The bower install npm postinstall script was failing with the message

    npm WARN cannot run in wd [email protected] bower install --config.interactive=false --allow-root (wd=/frontier)

    This was because npm doesn't like being run as root user. I can fix this temporarily by passing the command line flag --unsafe-perm to npm to get it to force the install, but it's generally considered bad practice.

  3. Even with --unsafe-perm passed to npm, bower doesn't like being run as root. To get it to run anyway, you can pass --allow-root to it to get it to run.

So the takeaways here are that the Dockerfile needs to:

  • not COPY the node_modules or public/bower_components directories
  • create a non-root user to run as, chown the application files to that user, and make sure that npm install is run as that user.

@chadxz
Copy link

chadxz commented May 15, 2015

@clarkda said he's planning to submit a pr to address these issues with the Dockerfile

@chadxz
Copy link

chadxz commented May 20, 2015

#26 removes the bower dependency so no need for any Dockerfile changes related to that

@Nedlinin Nedlinin changed the title localhost:8080 doesn't give an error but doesn't dispaly the list either on ubuntu14.04 localhost:8080 doesn't give an error but doesn't display the list either on ubuntu14.04 May 20, 2015
@chadxz
Copy link

chadxz commented May 21, 2015

#34 addresses the node_modules being accidentally included in the docker image, so we really just need for the npm install to not be run as root to close this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants