Unable to start the Passenger - 'analytics_log_dir' is missing - ruby

I'm trying to run Passenger on Ruby 1.9.3-p392, nginx 1.2.7 and rvm 1.19.6. I'm getting this strange error:
Unable to start the Phusion Passenger watchdog because it encountered
the following error during startup: Unable to start the Phusion Passenger
logging agent: it seems to have crashed during startup for an unknown reason,
with exit code 1 (-1: Unknown error)
terminate called after throwing an instance of
'Passenger::VariantMap::MissingKeyException'
what(): Required key 'analytics_log_dir' is missing
[ pid=17372, timestamp=1366554425 ] Process aborted! signo=SIGABRT(6),
reason=SI_TKILL, signal sent by PID 17372 with UID 0, backtrace available.
--------------------------------------
[ pid=17372 ] Backtrace with 12 frames:
PassengerLoggingAgent[0x4d7f5c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f3aa684bcb0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35)[0x7f3aa5c9e425]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b)[0x7f3aa5ca1b8b]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x11d)[0x7f3aa6599e2d]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5ef26)[0x7f3aa6597f26]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5ef53)[0x7f3aa6597f53]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5f17e)[0x7f3aa659817e]
PassengerLoggingAgent(_ZNK9Passenger10VariantMap3getERKSsb+0x8a)[0x4a0d92]
PassengerLoggingAgent(main+0x112)[0x499a43]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f3aa5c8976d]
PassengerLoggingAgent[0x498919]
here's a backtrace: http://pastie.org/7682098
any idea what's wrong?

Related

NameError: uninitialized constant Mail::TestMailer on Elastic Beanstalk

I'm getting this error
NameError: uninitialized constant Mail::TestMailer
on my Ruby on Rails project on Elastic Beanstalk.
Other sources told me to install 3 gems.
gem 'net-smtp', '>= 0.3.3'
gem 'net-imap', '>= 0.1.2'
gem 'net-pop', '>= 0.1.2'
I have already installed them, but it still does not work.
eb deploy fails every time.
Ruby version 3.0.5, rails 6.1.7
Code from application mailer, not sure if this helps but just in case.
class ApplicationMailer < ActionMailer::Base
default from: 'from#example.com'
layout 'mailer'
end
Please see the error log below
eb deploy Creating application version archive "app-4523-230109_233425301397". Uploading: [##################################################] 100% Done... 2023-01-09 14:38:30 INFO Environment update is starting. 2023-01-09 14:38:36 INFO Deploying new version to instance(s). 2023-01-09 14:40:51 ERROR Instance deployment failed. For details, see 'eb-engine.log'. 2023-01-09 14:40:53 ERROR [Instance: i-0e263523f982bac43] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error.. 2023-01-09 14:40:53 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1]. 2023-01-09 14:40:53 ERROR Unsuccessful command execution on instance id(s) 'i-0e263523f982bac43'. Aborting the operation. 2023-01-09 14:40:54 ERROR Failed to deploy application.
I hope this helps.
Let me know if you need more information.

Install kafka on windowns returns ERROR Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)

When I run this command in cmd to start Zookeeper on windows
PS D:\Users\e.akbar\Downloads\confluent-community-7.0.1\confluent-7.0.1\bin\windows> .\zookeeper-server-start.bat .\etc\kafka\zookeeper.properties
But I get this error :
PS D:\Users\e.akbar\Downloads\confluent-community-7.0.1\confluent-7.0.1\bin\windows> .\zookeeper-server-start.bat .\etc\kafka\zookeeper.properties
[2022-01-25 13:26:02,943] INFO Reading configuration from: .\etc\kafka\zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2022-01-25 13:26:02,944] ERROR Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing .\etc\kafka\zookeeper.properties
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:198)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:124)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:90)
Caused by: java.lang.IllegalArgumentException: .\etc\kafka\zookeeper.properties file is missing
at org.apache.zookeeper.server.util.VerifyingFileFactory.doFailForNonExistingPath(VerifyingFileFactory.java:54)
at org.apache.zookeeper.server.util.VerifyingFileFactory.validate(VerifyingFileFactory.java:47)
at org.apache.zookeeper.server.util.VerifyingFileFactory.create(VerifyingFileFactory.java:39)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:180)
... 2 more
Invalid config, exiting abnormally
[2022-01-25 13:26:02,948] INFO ZooKeeper audit is disabled. (org.apache.zookeeper.audit.ZKAuditProvider)
[2022-01-25 13:26:02,950] ERROR Exiting JVM with code 2 (org.apache.zookeeper.util.ServiceUtils)
The command should be this :
.\zookeeper-server-start.bat ..\..\etc\kafka\zookeeper.properties
Confluent does not support running their services on Windows.
If you must use a windows host, use WSL2 https://www.confluent.io/blog/set-up-and-run-kafka-on-windows-linux-wsl-2/
Related post Unable to produce to Kafka topic that is running on WSL 2 from Windows

What is the correct way to end a WEBrick server process after a timeout?

I'm trying to implement a small WEBrick server that ends itself when there are no requests after x number of seconds. However, I'm getting nowhere. My very first attempt at simply exiting after 2 seconds fails. Here's the simple code
that doesn't work.
server = WEBrick::HTTPServer.new(:Port => 8000)
WEBrick::Utils::TimeoutHandler.register(2, Timeout::Error)
server.start
I thought that would simply exit the process after 2 seconds. Here's what actually happens:
[2020-01-19 15:41:10] INFO WEBrick 1.4.2
[2020-01-19 15:41:10] INFO ruby 2.5.1 (2018-03-29) [x86_64-linux-gnu]
[2020-01-19 15:41:10] INFO WEBrick::HTTPServer#start: pid=16622 port=8000
[2020-01-19 15:41:12] ERROR Timeout::Error: execution timeout
/usr/lib/ruby/2.5.0/webrick/server.rb:170:in `select'
And then the process keeps running. I have to ctrl-c to end it.
What's the correct way to shut down a server and end the process after a timeout?

Configuring the REST server with a persistent data store

I am having problems trying to deploy the rest server with persistence storage (mongo db) I ge this message when deploying the rest server:
docker logs -f rest
[2018-03-12 00:01:13] PM2 log: Launching in no daemon mode
[2018-03-12 00:01:14] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-03-12 00:01:14] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: Error trying to query business network. Error: REQUEST_TIMEOUT
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Error trying to query business network. Error: REQUEST_TIMEOUT
Error: Error trying to ping. Error: Error trying to query business network. Error: REQUEST_TIMEOUT
at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:699:34)
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
[2018-03-12 00:07:03] PM2 log: App [composer-rest-server] with id [0] and pid [14], exited with code [1] via signal [SIGINT]
I am using composer v.18
is there any work around to fix this error. when I run the composer-rest- server alone it work. but if I try to add the mongodb it does not work

New Relic, Heroku error: ERROR : [New Relic] Error running task in worker loop, likely a server error

I am using Papertrail to monitor my heroku app and it seems that I am getting this same error repeatedly:
app/web.2: ** [NewRelic][12/13/13 17:14:17 +0000 f00d3735-79e0-4b0a-9e0d-9315444e2641 (2)] ERROR : Error running task in worker loop, likely a server error:
I read in the ruby docs here that this is probably:
This is probably a server error which has been logged in the server along
# with your account name. Check and see if the agent listener is in the
# stack trace and log it quietly if it is.
I am not quite sure how to debug it and would love some help. Thanks!
Please let me know if my source code would be helpful

Resources