Comments (15)
Turns out this was nothing foreman related. There was something wrong with my system. Never figured it out, but a reboot solved the problem.
from foreman.
What does your Procfile look like?
from foreman.
I'm trying to use the Play framework so my Procfile is just this single line:
web: /home/tkral/dev/play/play run /home/tkral/dev/samples/dataloader --http.port=$PORT
from foreman.
Does running this command verbatim in your console work?
env PORT=5000 /home/tkral/dev/play/play run /home/tkral/dev/samples/dataloader --http.port=$PORT
from foreman.
So that command doesn't work:
tkral@tkral-wsl:~$ env PORT=5000 /home/tkral/dev/play/play run /home/tkral/dev/samples/dataloader --http.port=$PORT
...
Listening for transport dt_socket at address: 8000
14:43:16,473 INFO ~ Starting /home/tkral/dev/samples/dataloader
14:43:16,907 WARN ~ You're running Play! in DEV mode
Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:470)
at java.lang.Integer.parseInt(Integer.java:499)
at play.server.Server.(Server.java:33)
at play.server.Server.main(Server.java:160)
However, that seems to be a red herring. If I remove the --http.port option so that my Procfile looks like this:
web: /home/tkral/dev/play/play run /home/tkral/dev/samples/dataloader
Then the console command works:
tkral@tkral-wsl:~$ env PORT=5000 /home/tkral/dev/play/play run /home/tkral/dev/samples/dataloader
...
Listening for transport dt_socket at address: 8000
14:48:12,628 INFO ~ Starting /home/tkral/dev/samples/dataloader
14:48:12,980 WARN ~ You're running Play! in DEV mode
14:48:13,031 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
14:48:16,260 INFO ~ Connected to jdbc:h2:/home/tkral/dev/samples/dataloader/db/h2/play;MODE=MYSQL;DB_CLOSE_ON_EXIT=FALSE
14:48:16,757 INFO ~ Application 'dataloader' is now started !
But foreman is still exiting immediately:
tkral@tkral-wsl:/dev/samples/dataloader[develop_]$ cat Procfile/dev/samples/dataloader[develop_]$ foreman start
web: /home/tkral/dev/play/play run /home/tkral/dev/samples/dataloader
tkral@tkral-wsl:
14:48:55 web.1 | started with pid 6963
14:48:55 web.1 | process exiting
14:48:55 web.1 | process terminated
14:48:55 system | sending SIGTERM to all processes
from foreman.
If you run the command copied verbatim out of the Procfile, does it work at your terminal?
It seems like the program is terminating immediately with no output when running under foreman.
from foreman.
I have also encountered this issue just now (start a process, terminate immediately, no output, although my Procfile is nothing special. I am using the standalone foreman. It is not reproducing with the rvm+gem installed one I usually use:
$ bundle exec foreman start -f /tmp/Procfile
23:52:32 web.1 | started with pid 17721
23:52:33 web.1 | hello
vs
./foreman/foreman start -f /tmp/Procfile
23:54:23 web.1 | started with pid 17909
23:54:24 web.1 | process exiting
23:54:24 web.1 | process terminated
23:54:24 system | sending SIGTERM to all processes
Trivial Procfile and program:
web: bash /tmp/blah $PORT
echo hello
sleep 10000
from foreman.
I'm getting this...everything gets shut down immediately(foreman start and bundle exec foreman start. The processes work fine from the command line.
14:20:53 beanstalkd.1 | started with pid 8477
14:20:53 stalker.1 | started with pid 8480
14:20:53 beanstalkd.1 | process exiting
14:20:53 stalker.1 | process exiting
14:20:53 stalker.1 | process terminated
14:20:53 system | sending SIGTERM to all processes
from foreman.
I'm also seeing this issue.
$ foreman start -f features/support/Procfile.dev -p 4001
14:56:59 calculator.1 | started with pid 1589
14:56:59 calculator_resque.1 | started with pid 1590
14:56:59 calculator_resque.1 | process terminated
14:56:59 system | sending SIGTERM to all processes
$
Running the two commands in my Procfile without foreman work fine.
from foreman.
The problem (above) I experienced with the latest version (0.30.1). I was able to avoid the issue by installing an older version of foreman. Specifically, 0.26.1 and 0.27.0 seem to work fine. Gems after these did not work for me, for this reason and other reasons (some just blew up immediately on calling foreman).
from foreman.
@noahd1 Yup, agreed. moving to 0.26.1 fixes the problem and latest versions seem to have this problem. Can this ticket be reopened, since this is valid one:
16:06:51 xxxx.1 | started with pid 11846
16:06:51 yyyy.1 | started with pid 11849
16:06:51 zzzzz.1 | started with pid 11848
16:06:51 ccccc.1 | started with pid 11847
16:06:51 ddddd.1 | started with pid 11851
16:06:51 ddddd.1 | process terminated
16:06:51 system | sending SIGTERM to all processes
16:06:51 system | sending SIGTERM to pid 11847
16:06:51 system | sending SIGTERM to pid 11848
16:06:51 system | sending SIGTERM to pid 11849
16:06:51 system | sending SIGTERM to pid 11846
16:06:51 ccccc.1 | process terminated
16:06:51 zzzzz.1 | process terminated
16:06:51 yyyy.1 | process terminated
16:06:51 xxxx.1 | process terminated
from foreman.
I am having a similar issue on the latest and on 0.26.1. One of the processes might be daemonizing itself (rake thinking_sphinx:start) but the other doesn't seem to do so (rackup private_pub.ru -s thin -E production). Also, I am running Rails 3.2 on OS X 10.7. Let me know if any more background information is necessary.
Here is my output:
$ foreman start
12:25:43 private_pub.1 | started with pid 9129
12:25:43 thinking_sphinx.1 | started with pid 9130
12:25:50 thinking_sphinx.1 | Started successfully (pid 9139).
12:25:50 thinking_sphinx.1 | process terminated
12:25:50 system | sending SIGTERM to all processes
12:25:50 system | sending SIGTERM to pid 9129
12:25:51 private_pub.1 | >> Thin web server (v1.3.1 codename Triple Espresso)
12:25:51 private_pub.1 | >> Maximum connections set to 1024
12:25:51 private_pub.1 | >> Listening on 0.0.0.0:9292, CTRL+C to stop
12:25:51 private_pub.1 | process terminated
And my Procfile:
private_pub: rackup private_pub.ru -s thin -E production
thinking_sphinx: rake thinking_sphinx:start
Both of these commands run when run verbatim in Bash. As I mentioned, I'm pretty sure thinking_sphinx daemonizes itself but I'm also pretty sure private_pub/faye does not.
##EDIT:
I don't know where the issue actually lies, but the following blog post got me up and running. Thinking_sphinx was causing issues with foreman: http://icelab.com.au/articles/run-your-own-piece-of-heroku-with-foreman/
from foreman.
Hi i am also getting same issue
14:25:38 server.1 | started with pid 14836
14:25:38 frontend.1 | started with pid 14837
14:25:38 server.1 | 2020/08/12 14:25:38 mmap: bad file descriptor
14:25:38 server.1 | exited with code 1
14:25:38 system | sending SIGTERM to all processes
14:25:38 frontend.1 | terminated by SIGTERM
My procfile contains
server: bee run -downdoc=true -gendoc=true -e=frontend -e=conf -e=logs -e=datastructs -e=filters -e=grifts -e=out -e=inp -e=database -e=events -e=tasks -e=templates
frontend: cd frontend && npm run dev
from foreman.
It seems like the program is terminating immediately with no output when running under foreman.
Is this issue still happening?
My Procfile.https
look like this:
web: thin start --ssl --ssl-key-file server.key --ssl-cert-file server.crt --port 3000 redis: redis-server worker: bundle exec rake resque:work QUEUE='*' scheduler: bundle exec rake resque:scheduler guard: guard -P livereload
and I just find out that running the first command - web
using forman start -f Procfile.https
doesn't show the errors of this command, but when I run this line alone in terminal - I can see the exact errors.
Does foreman hiding the errors, or maybe he doesn't even get those errors from his child commands
from foreman.
Turns out my server wasn't starting because of some weird file in the way, and the error wasn't being shown anywhere.
Still happens to me. Makes using
bin/dev
or foreman impossible in Docker. I can run the container and runbin/dev
orforeman start -f Procfile.dev
in a shell in the container and it works fine. The minute I try to make it the entrypoint/cmd, it exits immediately.streams_1 | 16:29:59 web.1 | started with pid 10 streams_1 | 16:29:59 js.1 | started with pid 11 streams_1 | 16:29:59 css.1 | started with pid 14 streams_1 | 16:30:00 css.1 | yarn run v1.22.17 streams_1 | 16:30:00 js.1 | yarn run v1.22.17 streams_1 | 16:30:00 css.1 | $ sass ./app/assets/stylesheets/application.bulma.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules --watch streams_1 | 16:30:00 js.1 | $ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --watch streams_1 | 16:30:00 js.1 | Done in 0.26s. streams_1 | 16:30:00 js.1 | exited with code 0 streams_1 | 16:30:00 system | sending SIGTERM to all processes streams_1 | 16:30:00 web.1 | terminated by SIGTERM streams_1 | 16:30:01 css.1 | exited with code 1 streams_streams_1 exited with code 0
from foreman.
Related Issues (20)
- Odd error message when you skip the 'start' command and include a -f
- Using RuboCop?
- issue killing subprocesses using `cd` with failure at startup HOT 1
- breakpoint vscode not work to Ruby
- After the foreman finishes, the ruby process continues to exist HOT 2
- Release 1.0? HOT 1
- About link is broken HOT 1
- Foreman does not terminate child process HOT 3
- Forman doesn't show errors and logs of Procfile commands HOT 3
- Change https://ddollar.github.com/foreman to https://ddollar.github.io/foreman on repo description link
- Port 5000 taken by Mac OSX HOT 1
- When launching rails via foreman, rails asset pipeline errors
- Support for x64-mingw-ucrt platform
- Version Optimize
- Document that Foreman secretly sets the PORT environment variable to 5000 HOT 1
- Error after running command "foreman start"
- foreman export systemd raises undefined method `exists?' for File:Class (NoMethodError) HOT 1
- Security CVE-2022-3874 HOT 4
- Usage Error: Unrecognized or legacy configuration settings found
- Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:201:in `kill': Invalid argument (Errno::EINVAL)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foreman.