I had hosted my server side (`Node js` and `Expres

2019-09-14 09:48发布

问题:

In the website it is showing this error for almost all APIs

Failed to load resource: the server responded with a status of 502 (Proxy Error)

XMLHttpRequest cannot load. No 'Access-Control-Allow-Origin' header is present on the
requested resource. Origin is therefore not allowed access. The response had
HTTP status code 503.

NOTE:CORS has been already installed using npm but still getting the above error.

And sometimes getting this error

Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING

When checked log using rhc tail command got below log

C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/ssh/ruby_comp
at.rb:20:in `select': closed stream (IOError)
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/ruby_compat.rb:20:in `io_select'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/packet_stream.rb:75:in `available_for_read?'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/packet_stream.rb:87:in `next_packet'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/session.rb:193:in `block in poll_message'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/session.rb:188:in `loop'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/session.rb:188:in `poll_message'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:513:in `dispatch_incoming_packets'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:237:in `ev_preprocess'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/event_loop.rb:95:in `each'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/event_loop.rb:95:in `ev_preprocess'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/event_loop.rb:27:in `process'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:216:in `process'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:178:in `block in loop'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:178:in `loop'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:178:in `loop'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/ssh_helpe
rs.rb:198:in `block in ssh_ruby'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh.rb:245:in `start'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/ssh_helpe
rs.rb:173:in `ssh_ruby'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/commands/
tail.rb:40:in `tail'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/commands/
tail.rb:21:in `run'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/commands.
rb:294:in `execute'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/commands.
rb:285:in `block (3 levels) in to_commander'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/command.rb:180:in `call'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/command.rb:180:in `call'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/command.rb:155:in `run'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/runner.rb:421:in `run_active_command'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/command_r
unner.rb:72:in `run!'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/delegates.rb:8:in `run!'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/cli.rb:37
:in `start'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/bin/rhc:20:in `<t
op (required)>'
    from C:/Ruby21-x64/bin/rhc:23:in `load'
    from C:/Ruby21-x64/bin/rhc:23:in `<main>'

where am I doing wrong?

回答1:

I have a feeling you have installed the wrong Ruby version. I think only version 1.86 thru 2.0 works. Uninstall Ruby and reinstall earlier version.