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

Passenger standalone fails if no HOME env set #713

Closed
FooBarWidget opened this Issue May 29, 2014 · 4 comments

Comments

Projects
None yet
1 participant
@FooBarWidget
Member

FooBarWidget commented May 29, 2014

From xmitchx on January 27, 2011 01:22:08

What steps will reproduce the problem? 1. Unset HOME env variable
2. passenger start What is the expected output? What do you see instead? I expect standalone passenger to run, but instead there is a stack trace: https://gist.github.com/3c36c7615eed4e2fc717 What version of Phusion Passenger are you using? Which version of Rails? On what operating system? Passenger 3.0.2
Rails 3.0.3
OS: Ubuntu 10.04 32-bit Please provide any additional information below. I've attached a patch to check to make sure the environmental variable is set before attempting to read the global configuration file.

Attachment: 0001-ALlow-passenger-standalone-commands-to-work-even-wit.patch

Original issue: http://code.google.com/p/phusion-passenger/issues/detail?id=614

@FooBarWidget

This comment has been minimized.

Show comment
Hide comment
@FooBarWidget

FooBarWidget May 29, 2014

Member

From xmitchx on January 26, 2011 16:25:12

I should note the situation under which this occurs, specifically. I create upstart scripts ( http://upstart.ubuntu.com/ ) to manage my app servers. Say I have a project named "project-x," I can then just do "service project-x start" or "service project-x restart" and it just does the right thing.

Upstart doesn't send any environmental variables down into the executing process, so ENV['HOME'] isn't available.

I work around this at the moment by explicitly telling my upstart script to set HOME to "/root" but I feel that this shouldn't be necessary for passenger to work.

Member

FooBarWidget commented May 29, 2014

From xmitchx on January 26, 2011 16:25:12

I should note the situation under which this occurs, specifically. I create upstart scripts ( http://upstart.ubuntu.com/ ) to manage my app servers. Say I have a project named "project-x," I can then just do "service project-x start" or "service project-x restart" and it just does the right thing.

Upstart doesn't send any environmental variables down into the executing process, so ENV['HOME'] isn't available.

I work around this at the moment by explicitly telling my upstart script to set HOME to "/root" but I feel that this shouldn't be necessary for passenger to work.

@FooBarWidget

This comment has been minimized.

Show comment
Hide comment
@FooBarWidget

FooBarWidget May 29, 2014

Member

From soup.matt on May 24, 2011 06:27:33

I experienced the same issue using monit to manage my services with passenger standalone 3.0.7. I had to set the HOME env var in the command that monit used.

Member

FooBarWidget commented May 29, 2014

From soup.matt on May 24, 2011 06:27:33

I experienced the same issue using monit to manage my services with passenger standalone 3.0.7. I had to set the HOME env var in the command that monit used.

@FooBarWidget

This comment has been minimized.

Show comment
Hide comment
@FooBarWidget

FooBarWidget May 29, 2014

Member

From david@xtramath.org on October 14, 2011 20:20:40

This occurred for me. I was launching Passenger standalone from a userdata script using an Ubuntu Lucid EC2 instance. In that environment HOME is not set. I worked around it by setting HOME to blank in the userdata script just before starting Passenger. The error occurred at:

passenger-3.0.5/lib/phusion_passenger/standalone/command.rb:103:in `join': can't convert nil into String (TypeError)

Member

FooBarWidget commented May 29, 2014

From david@xtramath.org on October 14, 2011 20:20:40

This occurred for me. I was launching Passenger standalone from a userdata script using an Ubuntu Lucid EC2 instance. In that environment HOME is not set. I worked around it by setting HOME to blank in the userdata script just before starting Passenger. The error occurred at:

passenger-3.0.5/lib/phusion_passenger/standalone/command.rb:103:in `join': can't convert nil into String (TypeError)

@FooBarWidget

This comment has been minimized.

Show comment
Hide comment
@FooBarWidget

FooBarWidget May 29, 2014

Member

From rjocoleman on May 24, 2014 01:45:03

This still presents in 4.0.42, same situation - launching Passenger via Upstart where HOME doesn't exist.

My Upstart script was generated by Foreman.

Member

FooBarWidget commented May 29, 2014

From rjocoleman on May 24, 2014 01:45:03

This still presents in 4.0.42, same situation - launching Passenger via Upstart where HOME doesn't exist.

My Upstart script was generated by Foreman.

@FooBarWidget FooBarWidget added this to the 4.0.45 milestone May 29, 2014

@FooBarWidget FooBarWidget added the Patch label May 29, 2014

@FooBarWidget FooBarWidget changed the title from [patch] Passenger standalone fails if no HOME env set to Passenger standalone fails if no HOME env set May 29, 2014

@FooBarWidget FooBarWidget modified the milestones: 4.0.46, 4.0.45 Jun 2, 2014

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