I am trying to get heroku local to work. When I run it I get the output below:
11:02:14 PM web.1 | DOCUMENT_ROOT changed to 'web/'
11:02:14 PM web.1 | 1 processes at 512MB memory limit.
11:02:14 PM web.1 | Starting php-fpm...
11:02:16 PM web.1 | Starting nginx...
11:02:16 PM web.1 | Application ready for connections on port 5000.
11:02:16 PM web.1 | nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
11:02:16 PM web.1 | Process exited unexpectedly: nginx
11:02:16 PM web.1 | Going down, terminating child processes...
[DONE] Killing all processes with signal null
11:02:16 PM web.1 Exited Abnormally
I am running Mac OS X 10.11.4 with an nginx/php-fpm/mysql setup for my development environment setup. There are a couple of sites setup on my development environment that are running fine on and listening on port 80.
I set up a Heroku project using the heroku-buildpack-php. Everything runs great when hosted on Heroku. However if I try to start the app by running heroku local, to work on development locally, it seems like there are conflicts with heroku trying to get nginx started. I need to have these sites running at the same time as heroku local because the heroku apps interact with the websites.
Is there some way to accomplish this? Any help would be greatly appreciated.
Related
i have freshly installed on ec2 instance on ubuntu, the installation was successfull but after that when i try to run "airflow standalone" to run airflow, it won't start.
Below is the error i get, do i need to install anything else also before running "airflow standlone" command.
My ultimate goal is to deploy python code for data transformation in my data-pipeline.
please help ?
webserver | [2022-11-01 10:36:51,919] {webserver_command.py:217} ERROR - No response from gunicorn master within 120 seconds
webserver | [2022-11-01 10:36:51,920] {webserver_command.py:218} ERROR - Shutting down webserver
scheduler | [2022-11-01 10:39:38,254] {scheduler_job.py:1381} INFO - Resetting orphaned tasks for active dag runs
When I deployed a FastAPI app to heroku
the startup event is fired twice.
Is it my problem?
The code below is not my original app, but a temporary app I made for testing.
And the Heroku was also made fresh for testing.
# Heroku logs
2022-10-18T08:37:32 app[api]: Build started by user junah.dev+1#gmail.com
2022-10-18T08:37:49 app[api]: Deploy 298098b0 by user junah.dev+1#gmail.com
2022-10-18T08:37:49 app[api]: Release v6 created by user junah.dev+1#gmail.com
2022-10-18T08:37:52 heroku[web.1]: State changed from down to starting
2022-10-18T08:37:54 heroku[web.1]: Starting process with command `uvicorn app.main:app --host=0.0.0.0 --port=${PORT:-5000}`
2022-10-18T08:37:55 app[api]: Build succeeded
2022-10-18T08:37:55.490285+00:00 app[web.1]: INFO: Uvicorn running on http://0.0.0.0:51121 (Press CTRL+C to quit)
2022-10-18T08:37:55 app[web.1]: INFO: Started parent process [4]
2022-10-18T08:37:55 app[web.1]: INFO: Started server process [11]
2022-10-18T08:37:55 app[web.1]: INFO: Waiting for application startup.
2022-10-18T08:37:55 app[web.1]: INFO: Application startup complete.
2022-10-18T08:37:55 app[web.1]: INFO: Started server process [10]
2022-10-18T08:37:55 app[web.1]: INFO: Waiting for application startup.
2022-10-18T08:37:55 app[web.1]: INFO: Application startup complete.
2022-10-18T08:37:56 heroku[web.1]: State changed from starting to up
# main.py
from fastapi import Depends, FastAPI
import uvicorn
app = FastAPI()
#app.get("/")
async def root():
return {"message": "Hello World"}
# Procfile
web: uvicorn app.main:app --host=0.0.0.0 --port=${PORT:-5000}
Uvicorn operates by running worker processes.
If you don't give it a number of processes to use via the --workers argument, it defaults to the value of the WEB_CONCURRENCY environment variable, falling back to 1 if neither is set:
--workers INTEGER Number of worker processes. Defaults to the
$WEB_CONCURRENCY environment variable if
available, or 1. Not valid with --reload.
Heroku sets a default value for the WEB_CONCURRENCY environment variable:
The WEB_CONCURRENCY environment variable is automatically set by Heroku, based on the processes’ Dyno size. This feature is intended to be a sane starting point for your application. We recommend knowing the memory requirements of your processes and setting this configuration variable accordingly.
Heroku has probably set this value to 2 based on the size of the dynos you are running. This would cause two workers to run in parallel, which is what your logs are showing:
A parent process: Started parent process [4]
And two worker processes:
Started server process [11]
Started server process [10]
You can change the value of WEB_CONCURRENCY if you wish.
If your code is malfunctioning with multiple workers that indicates a problem with your code. In that case, instead of setting this to 1, I suggest you identify why it is misbehaving and fix the problem. One common cause of this is use of global variables.
I am following this tutorial: https://docs.docker.com/get-started/02_our_app/
When I updated my app.js file as mentioned in the tutorial (it's just a label change) then rebuilt and ran my image, Docker successfully runs the app but when I access localhost:3000 it gives me an error. The app was working fine before but now even if I download a fresh copy of the sample project and load it and follow the instruction from the start, accessing localhost:3000 is not showing me the app.
The error I get is this:
This page isn’t working
localhost didn’t send any data.
ERR_EMPTY_RESPONSE
Any hints here on what went wrong? And how can I fix it?
Additional information:
I am using macOS with an m1 chip.
Here is my Docker file code:
# syntax=docker/dockerfile:1
FROM node:12-alpine
RUN apk add --no-cache python g++ make
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]
here is the command I run to build and run my Docker:
docker build -t getting-started .
docker run -p 3000:3000 getting-started
This is the log of Docker App when I click on the running container:
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/13 09:26:50 [notice] 1#1: using the "epoll" event method
2021/08/13 09:26:50 [notice] 1#1: nginx/1.21.1
2021/08/13 09:26:50 [notice] 1#1: built by gcc 10.3.1 20210424 (Alpine 10.3.1_git20210424)
2021/08/13 09:26:50 [notice] 1#1: OS: Linux 5.10.25-linuxkit
2021/08/13 09:26:50 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2021/08/13 09:26:50 [notice] 1#1: start worker processes
2021/08/13 09:26:50 [notice] 1#1: start worker process 33
2021/08/13 09:26:50 [notice] 1#1: start worker process 34
2021/08/13 09:26:50 [notice] 1#1: start worker process 35
2021/08/13 09:26:50 [notice] 1#1: start worker process 36
Everything seems to be working except the localhost which was working fine until I modified the text and rebuilt the image and run it.
I have also placed the dockerfile in the correct location and have not modified any other file.
You can check few things to get started again with :
run command : docker ps -a
This will give you all the containers running/stopped on the system. It will also list out ports being used , make sure only container uses the port you mapped while in running state or else it will give error.
stop the containers by command : docker stop
Container SHA value will be hex code diplayed in the first column when you run docker ps -a.
Check the location of docker file as they have explicitly asked to put the file in app folder and also one more docker file is already present in getting started project folder so make sure you have not overwritten that file.
I checked and performed the task it runs perfectly fine for me.
I got the same issue, I fixed it by putting the dockerfile in the /app folder
The github repo I cloned had it on the upper level and caused the issue.
I'm a complete heroku and nodejs newbie. I just followed a tutorial to get a GroupMe bot running locally with heroku. After running the command foreman start, I receive the following:
18:10:00 web.1 | started with pid 24985
18:10:00 web.1 | exited with code 1
18:10:00 system | sending SIGTERM to all processes
The procfile reads:
web: node index.js
How do I prevent exiting with code 1 above?
You might see that message if you don't have node installed on your local machine. You can check by typing
node --version
The Getting Started with Node.js on Heroku tutorial at https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction might be helpful. It walks you through deploying a Node.js app step-by-step.
Try running the program manually:
node index.js
This will show you the actual errors you have.
I'm trying to run a node app in heroku. Foreman works to run it locally, and it pushes to git without any errors. However, when I run heroku ps:scale web=1, it says there is no such type as web. My Procfile is just this line: web: node server.js, which I think should work to set the web type.
Does anyone know why this could be going wrong? Your help would be appreciated!
Here's a copy of the terminal...
jmm-2:supportEmail jamesmatheson$ foreman start
14:35:07 web.1 | started with pid 36298
14:35:08 web.1 | app is running on /removed port/
14:35:08 web.1 | database open
^CSIGINT received
14:35:09 system | sending SIGTERM to all processes
SIGTERM received
14:35:09 web.1 | exited with code 1
jmm-2:supportEmail jamesmatheson$ heroku ps:scale web=1
Scaling web dynos... failed
! No such type as web.
Specity --app APP_NAME (As given in My Apps in Heroku). Just answered same questions here:
Heroku Web Dyno failing