Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner - ruby

I'm using sinatra for my app, i replicated the exact copy from devserver1 to devserver2, but only on devserver1 is working.
I got this on my devserver2 apache error.log :
Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner (undefined method `<<' for nil:NilClass (NoMethodError)) (process 5516, thread #):
Any help is much appreciated.
FYI: I'm using rvm and ruby-1.9.2

Found out the bug. The app is accessing a remote service which has a HTTP Authentication, it cannot pass thru that so it timed-out. Now my next problem is how to make the app bypass that HTTP authentication.

Related

ECONNRESET error when accessing Ruby application which runs in Webrick

I am trying to install redmine (bugtracker which runs on ruby). I use webrick, it starts all fine, but when I access http://IP:3000/, it throws the following error in the server logs and the page does not load in the browser.
ERROR Errno::ECONNRESET: Connection reset by peer # io_fillbuf - fd:11
/root/.rbenv/versions/2.5.1/lib/ruby/2.5.0/webrick/httpserver.rb:82:in `eof?'
/root/.rbenv/versions/2.5.1/lib/ruby/2.5.0/webrick/httpserver.rb:82:in `run'
/root/.rbenv/versions/2.5.1/lib/ruby/2.5.0/webrick/server.rb:307:in `block in start_thread'
I am a bit stuck here, any help would be greatly appreciated.
Thanks in advance.
In the end, it was due to the port 3000 was being blocked by the network where the server was part of. Once the port block was removed, it started to work. Thanks #mike-k for your tips.

Thread deadlock on simple operations in pry

[Note: I "fixed" this problem by creating and using a new gemset. I'm still curious why the problem occurred but it is no longer blocking me.]
[I am aware that there is a similar issue at Deadlock in Ruby join(), but I have tried the timeout parameter suggested there and it does not help. I suspect there is a pry-specific problem not covered there.]
I am getting the error below when running the code below, but only when executed within a pry session. This code has not been changed and has been working fine for quite a while, and I have no idea why it's an issue just now. I am using pry version 0.11.3 on Ruby 2.5.1. Also, this code works fine when pasted into pry; it's not working in my wifi-wand application that launches pry in the context of one of its objects (gem install wifi-wand to install, https://github.com/keithrbennett/wifiwand is the project page).
domains = %w(google.com baidu.com)
puts "Calling dig on domains #{domains}..." if #verbose_mode
threads = domains.map do |domain|
Thread.new do
output = `dig +short #{domain}`
output.length > 0
end
end
threads.each(&:join)
[1] pry(#<WifiWand::CommandLineInterface>)> ci
Calling dig on domains ["google.com", "baidu.com"]...
fatal: No live threads left. Deadlock?
3 threads, 3 sleeps current:0x00007fbd13d0c5a0 main thread:0x00007fbd13d0c5a0
* #<Thread:0x00007fbd14069c20 sleep_forever>
rb_thread_t:0x00007fbd13d0c5a0 native:0x00007fff89c2b380 int:0
/Users/kbennett/work/wifi-wand/lib/wifi-wand/models/base_model.rb:89:in `join'
/Users/kbennett/work/wifi-wand/lib/wifi-wand/models/base_model.rb:89:in `each'
/Users/kbennett/work/wifi-wand/lib/wifi-wand/models/base_model.rb:89:in `block in connected_to_internet?'
/Users/kbennett/work/wifi-wand/lib/wifi-wand/models/base_model.rb:126:in `connected_to_internet?'
/Users/kbennett/work/wifi-wand/lib/wifi-wand/command_line_interface.rb:264:in `cmd_ci'
Strangely, the problem was fixed by uninstalling and reinstalling the awesome_print gem. I have no idea why.

Jasmine and PhantomJS error NETWORK_ERR: XMLHttpRequest Exception 101

I try to use phantomJS with Jasmine. But my fixtures can't be load because an error
Error: JSONFixture could not be loaded: assets/backend/fixtures/json/fr.json (status: error, message: NETWORK_ERR: XMLHttpRequest Exception 101)
I can see here I must add option to phantomJS for disable cross-server security.
Phantom JS synchronous AJAX request : NETWORK_ERR: XMLHttpRequest Exception 101
or here:
grunt-contrib-jasmine and PhantomJS security
But I don't know where to pass this options because phantomJS is called automatically when call:
bundle exec rake spec:javascript
or
bundle exec Guard -g frontend
So you can see I use Guard too but I think it's the next step.
Thanks to read and best regards
Add the below to your jasmine.yml file
phantom_options: --web-security=no

setting response timeout in ruby XMLRPC not working

I am trying to programmatically upload a large-sized (10+ MB) file to a server that supports XMLRPC.
For those interested, the background is:
The server is Confluence.
I am trying to upload a file as attachment to a Confluence page.
I am using the Confluence XMLRPC API. The API call is addAttachment.
The code looks something like this
require 'xmlrpc/client'
server = XMLRPC::Client.new2(server_url,"",600) # one attempt to set timeout
server.instance_variable_get(:#http).instance_variable_set(:#verify_mode, OpenSSL::SSL::VERIFY_NONE)
server.timeout=6000 # another attempt to set timeout
#conf = server.proxy("confluence2")
I know that the XMLRPC client will wait for TIMEOUT seconds before it aborts. So its natural that I got the following response when trying to upload the large file (smaller files don't throw this error).
C:/Ruby193/lib/ruby/1.9.1/openssl/buffering.rb:318:in `syswrite': An established connection was aborted by the software
in your host machine. (Errno::ECONNABORTED)
from C:/Ruby193/lib/ruby/1.9.1/openssl/buffering.rb:318:in `do_write'
from C:/Ruby193/lib/ruby/1.9.1/openssl/buffering.rb:336:in `write'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:199:in `write0'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:173:in `block in write'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:190:in `writing'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:172:in `write'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1938:in `send_request_with_body'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1920:in `exec'
However, I am unable to properly set the response timeout. I have tried
server.timeout
the timeout parameter in the new2 call
Neither of which work. I have verified that the client still waits the default 30 seconds for the response, and then throws the error.
So, what am I doing wrong?

BeanDefinitionStoreException with Play framework

I get this exception when trying to get to first page of my website.
Oops: BeanDefinitionStoreException
An unexpected error occured caused by exception BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: /Users/mmm/Documents/work/workspace/BCR/precompiled/java/app/config/AppConfig$WebserviceMode.class (No such file or directory)
play.exceptions.UnexpectedException: Unexpected Error
at play.Play.start(Play.java:545)
I'm using Spring 1.0.2 and Play 1.2.4
Can you please help me on this? I searched the internet but couldn't get a clear response!
I think that you are hitting this issue : https://github.com/pepite/Play--framework-Spring-module/pull/9
Try play compile before starting your app.
I fixed the problem by removing an extra attribute 'xsi' in my application-context.xml on

Resources