Laravel running on Laradock – Getting Nginx Error 504 Gateway Time Out - laradock

The command that I executed was: docker-compose up -d nginx mysql, after reading the laradock docs
All is working correctly and the server runs smooth, but I have one problem that is driving me crazy. When I try to make a certain action on my website that needs a bit more of time, the browser gets stuck reloading and I get this error:

Related

I have hosted my Nodejs Application on Amazon AWS. Now it shows 502 bad gateway after some time

I started the server using Command prompt by the command "sudo node server.js"
Then I closed the command prompt.
Now after some time, the website automatically shows 502 bad gateway error.
I had also used the command "sudo node server.js &" but it still not works.
Can you help me find out what could be the possible problem.
Thanks in advance!
The problem is that you app is not running, here is why.
When start the application in the command line, the application is handled by that bash instance. When you close that instance, so does the application.
The solution to this is to use a package like pm2 which will make sure that your application is always running.

Node.js app gives 504 on Plesk-Onyx

I have Node.js/Postgres app (tested and worked on different servers without an issue). When I try to run this app via Plesk's Node.js extension, the domain becomes inaccessible and I get 504 Gateway Time-out error.
Additionally, when I run the "start" script, Plesk panel output freezes and the only way to get an output is to run "killall node" command on SSH. After killing the node, I get the expected output without any errors.
All the dependencies are installed without any issue. Any idea what causes the problem and what is the solution?

Getting error in package.json while uploading to Openshift server

I am getting following error when i am trying to push my application to Openshift server. I have updated only package.json and trying to upload it on server then it showing this error.
So i have written couple of command to find out this error. So i found the following error but i am not getting what should i do now to fix this error.
My package.json is following below. If you think that there is some error in this package.json, please inform me. It is running fine on localhost but i do not know it is not able to find out package.json.
it's possible that the existing running application is not getting stopped correctly. Try using the rhc app stop command to completely stop your application, and then ssh to your gear (rhc ssh) and use the "ps -ef" command to make sure nothing else is running that would be taking up that port.

How can I bind a Python app to a port on Heroku without using Flask?

I'm trying to run a simple app on heroku. It doesn't use Flask at all, the script just needs to be run once and it will (or should) keep itself alive. It runs fine locally, it runs fine on my VPS. I really want to deploy it to heroku for the ease of maintenance/addons though. So I deployed it, made sure all the dependencies were installed, etc.
This is my Procfile:
web: newrelic-admin run-program python dragon.py
But when I try to run it, it will run fine for a few seconds before I get this error:
heroku/web.1: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
In those few seconds, it will even respond to commands (it's a chat bot), but inevitably fails with the failed to bind error. I've tried several solutions, such as adding $PORT to my procfile, and none of them worked. I tried using gunicorn and the app would run, but it wouldn't receive or respond to incoming commands.
I'm at a loss, does anyone know a surefire way to bind a port for a Python app NOT running Flask? I couldn't find any answers for anything that wasn't using Flask in some way, but adding Flask didn't appear to be working either. I just need this app to run as-is, but bind to a port so it will stay open.
This is a screenshot of my logs, showing the request/response headers, and even the first keepalive signal being sent by the app before it crashes.
http://puu.sh/h3Jo2/e689e9ba38.png
First edit: I contacted Heroku Support to get my boot timeout increased to 120 seconds. It still failed to bind to $PORT, despite running and working until it crashed. I also tried specifying a port in the config vars, to no avail. This is a screenshot of my logs showing failure to boot (twice) after 120 seconds: http://puu.sh/h4e4r/11c50a5ae7.png
Alright, I figured it out. I contacted support again and found out that I was using the wrong process type. I am now running it as a bot process, so my Procfile now looks like this:
bot: newrelic-admin run-program python dragon.py
This allows it to run without binding to a port.

Getting 502 error in browser for a NodeJS app run with Forever

I have a SailsJS app set up on a Webfaction server. Everything works nicely (site can be accessed through browser, console works) when I run the app via any of the following commands, with and without the --prod param:
sails console,
sails lift,
node app.js
However, when I try to run the app with forever using forever app.js I get a 502 error, as if nodejs server isn't even running. When I run forever list I can see app.js listed among running processes.
How can I have my app run with forever?
Forever is considered outdated by many in the Node community, and thankfully, has been replaced by several other fantastic (dare I say, better) tools.
If you're running a newer flavor of Ubuntu, you can always install systemd and kick off the application that way. If you're seeking something more streamlined, Phusion Passenger might be your ticket. It has a long track record of successes, and I wouldn't hesitate to toss it into production.
I managed to solve this issue; the problem occurred due to SailsJS migration prompt which shows up when you start the server. Running app.js with forever worked, but the server didn't start because the script hanged waiting for a prompt reply. If you encounter this issue just make sure you have your migrate option set in model config to avoid running into migration prompt.

Resources