Closed weatherfordmat closed 7 years ago
Does it work locally?
Your host: 'http://XXXXX.elasticbeanstalk.com/',
setting is wrong.
It says host
, not url
.
Yes, it works in development and production modes locally. I had tried 127.0.0.1, localhost, etc.
See my comment above.
Your host: 'http://XXXXX.elasticbeanstalk.com/'
setting is wrong.
So I changed this to localhost and also tried 127.0.0.1 with no luck.
No, do it like host: 'XXXXX.elasticbeanstalk.com'
Thanks for the catch.
It is still not correctly working though. It is giving me the following response:
npm ERR! Linux 4.9.32-15.41.amzn1.x86_64 npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v7.6.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v7.6.0-linux-x64/lib/node_modules/npm/bin/npm-cli.js" "run" "production:client:build" npm ERR! node v7.6.0 npm ERR! npm v4.1.2 npm ERR! code ELIFECYCLE
The error dump has no details
Deploy.txt no longer available.
I thought it had something to do with the version matching between node/npm and other packages, but it doesn't seem to be a result.
Hey @weatherfordmat, I use this repo on elastic beanstalk, but it takes some work.
The main problem is that Elastic Beanstalk only gives you one port to work with (this is similar to other services like Heroku) but this project uses multiple ports to create a separation between the outer proxying layer, the data api, and the page rendering service.
So to get it to work with one port, you have to use koa-mount instead of proxying from the web service. It can be tricky to get this to work.
Thanks adailey14! The solution seems to be a combination of (1) serving assets via koa-mount, (2) setting render: false in the application.js. file. I'm not sure if setting render to false is enough to serve the files without throwing the page rendering error. Is there anything else that comes to the top of your head that would make this work?
@weatherfordmat You seem to not understand what's happening at all. The logs you provided are just a mishmash of everything you could think of and reach. My opinion is that you're taking the tasks you're not ready for at your current level of understanding things.
And also blindly posting your logs on the internets can share some secrets. Like don't be surprised if your AWS account runs low on budget the other day because of a bitcoin mining malware. I won't tell you the exact place but somewhere in this issue there are some secrets which I could use if I wanted to rule your servers like my own.
Now, for the "single port" thing. I updated the README. The "Server side" section illustrates how to run everything on a single port. https://github.com/halt-hammerzeit/react-isomorphic-render#server-side https://github.com/halt-hammerzeit/react-isomorphic-render#serving-assets-and-api There are 3 approaches described
@adailey14 FYI: I made some tweaks to the library today.
The former application
server-side setting was renamed to proxy
(I guess you didn't use it anyway) and http
utility method calls now only accept relative URLs (I guess that's how everyone uses it, but in case you had some absolute URLs there you've been notified).
Thanks for guidance. I removed the txt file.
The documentation by and large is great. I am struggling with finding information about deployment.Depending on my error, it might be good to add some of this info the package docs. I am trying to deploy the isomorphic package on elastic beanstalk as is. In deploying my app, I receive a "502 Bad Gateway" error.
It also has dozens of rows of error messages more or less like this: 2017/07/05 18:02:42 [error] 5215#0: *29 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.36.70, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "XXX.elasticbeanstalk.com"
Is there something I am missing that I have to do before deployment?