Why can't passenger be initialized when restarting my application? - passenger

It shows me the following error in the passenger log:
[ E 2022-06-23 00:13:01.3174 1555/Tk age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/www/medsi/code: A timeout occurred while starting a preloader process.
Error ID: 3e0af426
Error details saved to: /tmp/passenger-error-6ZekIX.html
[ E 2022-06-23 00:13:01.3228 1555/Ta age/Cor/Con/CheckoutSession.cpp:283 ]: [Client 2-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 3e0af426. Please see earlier logs for details about the error.
Estas son mis versiones:
Bundler version 1.17.3
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
nginx/1.14.0 Phusion_Passenger/6.0.14
Ubuntu Server 18.04.6 LTS

Related

Unable to install Chef gems during chef-clien run

I am working on a chef environment with below versions
OS & Version details are as below:
Chef Server - RHEL7
Chef Workstation - Windows 7 Professional
Chef node : Windows 2016 Server Datacenter
Chef Development Kit Version: 3.3.23
chef-client version: 14.14.25
berks version: 7.0.6
kitchen version: 1.23.2
inspec version: 2.2.112
I am running a chef-client on a node which is configured during initial run installing chef gems failed with below errors.
On checking it was not able to connect to ruby site to install gems, but my server has active internet connection. I got these details from Bundle Install Not Working
Installing Cookbook Gems:
Running handlers:
[2019-10-17T19:09:35+08:00] ERROR: Running exception handlers
Running handlers complete
[2019-10-17T19:09:35+08:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 05 minutes 13 seconds
[2019-10-17T19:09:35+08:00] INFO: Sending resource update report (run-id: 942e7eaa-14c0-487d-8a6c-6d96a49c99ff)
[2019-10-17T19:09:36+08:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
[2019-10-17T19:09:36+08:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-10-17T19:09:36+08:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received
'17'
---- Begin output of bundle install ----
STDOUT: Fetching source index from https://www.rubygems.org/
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://www.rubygems.org/
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://www.rubygems.org/
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://www.rubygems.org/
Could not fetch specs from https://www.rubygems.org/
STDERR:
---- End output of bundle install ----
Ran bundle install returned 17
Can it be DNS issue?
I have active internet connection from the server and can land on ruby site manually.
Is there a way I can manually install ruby/cookbook gems?
Can it be DNS issue? I have active internet connection from the server and can land on ruby site manually.
if you are running chef-client on a node, then what the server has to do with "active internet connection". you should verify that an internet connection is available on the node itself.
Is there a way I can manually install ruby/cookbook gems?
sure you can. if you wish to install a rubygem into chef embedded ruby (same as chef_gem resource), then use gem with chef embedded ruby.
$ /opt/chef/bin/gem install <rubygem-name>
otherwise, you can install it to the ruby system as usuall (same as gem_package resource)
$ gem install <rubygem-name>
i also advise you to run chef-client with debug log level to get more information about the problem
$ chef-client --log_level debug

after downgrading ruby, project still requires last version's file

I downgraded ruby from 2.4.0 to 2.3.3 because of incompability with JSON.
Server didn't work, though. I checked my log and found out that it is still trying to execute last version(2.4.0)'s ruby file.
I removed files of ruby last version when I downgraded.
How can I solve this problem?
/.rvm/gems ls
cache
ruby-2.3.3
ruby-2.3.3#global
ruby-2.4.0
ruby-2.4.0#global
/.rvm/gems/ruby-2.4.0 ls
gems
/.rvm/gems/ruby-2.3.3 ls
bin
cache
environment
gems
wrappers
build_info
doc
extensions
specifications
error.log
App 20642 stdout:
App 20642 stderr: *** ERROR ***: Cannot execute /home/ec2-user/.rvm/gems/ruby-2.4.0/wrappers/ruby: No such file or
directory (2)
[ 2017-02-20 23:32:45.2704 5334/7fa2e3dde700 age/Cor/App/Implementation.cpp:230 ]: Cannot render an error page:
Cannot open
'/home/ec2-user/.rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/resources/templates/error_layout.css'
for reading: No such file or directory (errno=2)
in 'void Passenger::ApplicationPool2::processAndLogNewSpawnException(Passenger::SpawnException&,
const Passenger::ApplicationPool2::Options&, const ConfigPtr&)'
(Implementation.cpp:206)
in 'void Passenger::SpawningKit::SmartSpawner::throwPreloaderSpawnException(const
string&, Passenger::SpawnException::ErrorKind,
Passenger::SpawningKit::BackgroundIOCapturerPtr&, const Options&,
const DebugDirPtr&)' (SmartSpawner.h:144)
in 'std::string Passenger::SpawningKit::SmartSpawner::negotiatePreloaderStartup(Passenger::SpawningKit::SmartSpawner::StartupDetails&)'
(SmartSpawner.h:617)
in 'void Passenger::SpawningKit::SmartSpawner::startPreloader()' (SmartSpawner.h:273)
in 'virtual Passenger::SpawningKit::Result Passenger::SpawningKit::SmartSpawner::spawn(const Options&)'
(SmartSpawner.h:790)
in 'void Passenger::ApplicationPool2::Group::spawnThreadRealMain(const
SpawnerPtr&, const Passenger::ApplicationPool2::Options&, unsigned
int)' (SpawningAndRestarting.cpp:95)
[ 2017-02-20 23:32:45.2704 5334/7fa2e3dde700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for
application /home/ec2-user/Karolline.github.io: An error occurred
while starting up the preloader. It exited before signalling
successful startup back to Phusion Passenger.
Error ID: 34b5bb42
Message from application: An error occurred while starting up the preloader. It exited before signalling successful startup back to
Phusion Passenger. Please read this
article for more information about this problem.
Raw process output:
* ERROR *: Cannot execute /home/ec2-user/.rvm/gems/ruby-2.4.0/wrappers/ruby: No such file or
directory (2)
[ 2017-02-20 23:32:45.2734 5334/7fa30287a700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-47] Cannot checkout
session because a spawning error occurred. The identifier of the error
is 34b5bb42. Please see earlier logs for details about the error.
[ 2017-02-20 23:32:45.2734 5334/7fa30287a700 age/Cor/Con/CheckoutSession.cpp:369 ]: [Client 1-47] Cannot render an
error page: Cannot open
'/home/ec2-user/.rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/resources/templates/error_layout.css'
for reading: No such file or directory (errno=2)
in 'void Passenger::Core::Controller::endRequestWithErrorResponse(Passenger::Core::Client**,
Passenger::ServerKit::HttpServer::Request**, const Passenger::StaticString&,
const Passenger::SpawnException*)' (CheckoutSession.cpp:350)
in 'void Passenger::Core::Controller::writeSpawnExceptionErrorResponse(Passenger::Core::Client*,
Passenger::ServerKit::HttpServer::Request*, const
boost::shared_ptr&)'
(CheckoutSession.cpp:282)
in 'void Passenger::Core::Controller::reportSessionCheckoutError(Passenger::Core::Client*,
Passenger::ServerKit::HttpServer::Request*, const ExceptionPtr&)'
(CheckoutSession.cpp:235)
in 'void Passenger::Core::Controller::sessionCheckedOutFromEventLoopThread(Passenger::Core::Client*,
Passenger::ServerKit::HttpServer::Request*, const AbstractSessionPtr&, const
ExceptionPtr&)' (CheckoutSession.cpp:148)
in 'void Passenger::Core::Controller::sessionCheckedOutFromAnotherThread(Passenger::Core::Client*,
Passenger::ServerKit::HttpServer::Request*,
Passenger::ApplicationPool2::AbstractSessionPtr,
Passenger::ApplicationPool2::ExceptionPtr)' (CheckoutSession.cpp:114)
-- Client 1-47
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.10
RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x86_64-linux]
INSTALLATION DIRECTORY: /home/ec2-user/.rvm/gems/ruby-2.3.3
USER INSTALLATION DIRECTORY: /home/ec2-user/.gem/ruby/2.3.0
RUBY EXECUTABLE: /home/ec2-user/.rvm/rubies/ruby-2.3.3/bin/ruby
EXECUTABLE DIRECTORY: /home/ec2-user/.rvm/gems/ruby-2.3.3/bin
SPEC CACHE DIRECTORY: /home/ec2-user/.gem/specs
SYSTEM CONFIGURATION DIRECTORY: /home/ec2-user/.rvm/rubies/ruby-2.3.3/etc
RUBYGEMS PLATFORMS:
ruby
x86_64-linux
GEM PATHS:
/home/ec2-user/.rvm/gems/ruby-2.3.3
/home/ec2-user/.rvm/gems/ruby-2.3.3#global
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:backtrace => false
:bulk_threshold => 1000
REMOTE SOURCES:
https://rubygems.org/
SHELL PATH:
/home/ec2-user/.rvm/gems/ruby-2.3.3/bin
/home/ec2-user/.rvm/gems/ruby-2.3.3#global/bin
/home/ec2-user/.rvm/rubies/ruby-2.3.3/bin
/usr/local/bin
/bin
/usr/bin
/usr/local/sbin
/usr/sbin
/sbin
/opt/aws/bin
/home/ec2-user/.rvm/bin
/home/ec2-user/.local/bin
/home/ec2-user/bin
I reinstalled ruby 2.4.0 using following codes
rvm install 2.4.0
rvm use 2.4.0
Then I selected ruby 2.3.3 by
rvm use 2.3.3

Chef server 12 and Client 12 - Error 503: Service unavailable

I have a standalone Chef server hosted on a Ubuntu 14.04 machine. Installed the server by following https://learn.chef.io/install-and-manage-your-own-chef-server/linux/ by using latest versions.
When I tried to bootstrap a node, it installs client version 11.x and works. But most of the cookbooks in the market is not compatible to client 11 and requires client 12.x.
So, I supplied client version 12.x as parameter to my bootstrap command, which installs client version 12.x to the node to bootstrap. But this time I got HTTP 503 - 503 "Service Unavailable" error and not able to complete bootstrapping.
My Workstation (Mac 10.11.1)
$chef --version
Chef Development Kit Version: 0.10.0
chef-client version: 12.5.1
berks version: 4.0.1
kitchen version: 1.4.2
My Server (Ubuntu 14.04.2)
$ dpkg --status chef
Package: chef
Status: install ok installed
Priority: extra
Section: misc
Installed-Size: 107919
Maintainer: Chef Software, Inc. <maintainers#chef.io>
Architecture: amd64
Version: 11.18.12-1
Description: The full stack of chef
License: unknown
Vendor: Omnibus <omnibus#getchef.com>
Homepage: https://www.getchef.com
$ dpkg --status chef-server-core
Package: chef-server-core
Status: install ok installed
Priority: extra
Section: misc
Installed-Size: 1190291
Maintainer: Chef Software, Inc.
Architecture: amd64
Version: 12.3.1-1
Replaces: private-chef
Conflicts: private-chef
Description: The full stack of chef-server
License: unknown
Vendor: Omnibus <omnibus#getchef.com>
Homepage: https://www.chef.io
Node (Ubuntu 14.04.2)
$ chef-client -v
Chef: 12.6.0
Here is the error:
Connecting to <nodes_ip>
10.97.151.49 -----> Existing Chef installation detected
10.97.151.49 Starting the first Chef Client run...
10.97.151.49 Starting Chef Client, version 12.6.0
10.97.151.49 Creating a new client identity for web_app_ubuntu using the validator key.
10.97.151.49 [2015-12-25T14:50:47+00:00] WARN: Failed to register new client, 4 tries remaining
10.97.151.49 [2015-12-25T14:50:47+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49 [2015-12-25T14:52:26+00:00] WARN: Failed to register new client, 3 tries remaining
10.97.151.49 [2015-12-25T14:52:26+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49 [2015-12-25T14:54:15+00:00] WARN: Failed to register new client, 2 tries remaining
10.97.151.49 [2015-12-25T14:54:15+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49 [2015-12-25T14:56:01+00:00] WARN: Failed to register new client, 1 tries remaining
10.97.151.49 [2015-12-25T14:56:01+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49 [2015-12-25T14:57:48+00:00] WARN: Failed to register new client, 0 tries remaining
10.97.151.49 [2015-12-25T14:57:48+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49
10.97.151.49 Running handlers:
10.97.151.49 [2015-12-25T14:59:36+00:00] ERROR: Running exception handlers
10.97.151.49 Running handlers complete
10.97.151.49 [2015-12-25T14:59:36+00:00] ERROR: Exception handlers complete
10.97.151.49 Chef Client failed. 0 resources updated in 10 minutes 38 seconds
10.97.151.49 [2015-12-25T14:59:36+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
10.97.151.49 [2015-12-25T14:59:36+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
10.97.151.49 [2015-12-25T14:59:36+00:00] ERROR: undefined method `closed?' for nil:NilClass
10.97.151.49 [2015-12-25T14:59:36+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Finally the stack trace at /var/chef/cache/chef-stacktrace.out
Generated at 2015-12-25 16:02:37 +0000
NoMethodError: undefined method `closed?' for nil:NilClass
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:325:in `stream_check'
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:199:in `read_body'
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:226:in `body'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_inspectors/registration_error_inspector.rb:139:in `rescue in format_rest_error'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_inspectors/registration_error_inspector.rb:137:in `format_rest_error'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_inspectors/registration_error_inspector.rb:108:in `humanize_http_exception'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_inspectors/registration_error_inspector.rb:27:in `add_explanation'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_mapper.rb:32:in `registration_failed'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/base.rb:114:in `registration_failed'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/event_dispatch/dispatcher.rb:43:in `call'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/event_dispatch/dispatcher.rb:34:in `each'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'
(eval):2:in `registration_failed'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:623:in `rescue in register'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:603:in `register'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:255:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:261:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:215:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:203:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:413:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:403:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:403:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:393:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:58:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/bin/chef-client:26:in `<top (required)="">'
/usr/bin/chef-client:54:in `load'
/usr/bin/chef-client:54:in `<main>'
I finally figured out the issue.
I am behind a corporate proxy and the error I got "503: Service Unavailable" is not something coming from Chef Server, rather it is coming from the proxy server :(
Anyway, using "no_proxy" option and adding Chef Server's fqdn solved the issue.
Yes, this still does not answer the question how it works with chef client v11.x, but I am sure that this solved the issue :)
You probably have an old version of knife on your system. Run knife --version to confirm, you should see that it will be an older 11.x version. Track down where that copy is coming from (which knife or type -a knife) and remove it. This usually means uninstalling the gem from a pre-existing Ruby environment like RVM.

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable

I am unable to start my server. getting this error:
Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable (/usr/local/rvm/gems/ruby-2.0.0-p0/gems/passenger-4.0.0.rc4/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive, whichever is applicable. (-1: Unknown error)
Actually, my rvm list o/p is
rvm rubies
=> ruby-1.9.3-p448 [ i686 ]
* ruby-2.0.0-p0 [ i686 ]
# => - current
# =* - current && default
# * - default
And for current app, I am using ruby 1.9.3 and rails 3.2.12. But my Passenger is taking ruby-2.0.0-p0 instead if ruby-1.9.3
Can anybody help me here. My server is down :-(
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example:
passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5;
passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

passenger-spawn-server load error

I have been struggling for hours now and can not find an appropriate answer on the internet.
I have tried to upgrade ruby1.8 to 1.9.3 but with no luck.
Ruby 1.9.3 is installed, but my rails app (redmine) won't start anymore.
This is the error:
/usr/bin/ruby: No such file or directory -- /usr/lib/phusion_passenger/passenger-spawn-server (LoadError)
[ pid=30103 file=ext/apache2/Hooks.cpp:727 time=2013-01-10 21:49:06.819 ]:
Unexpected error in mod_passenger: Cannot spawn application '/usr/share/redmine': Could not read from the spawn server: Connection reset by peer (104)
Backtrace:
(empty)
Really, I'm stuck on this, any help is appreciated!
-Brian

Resources