I had hosted my server side (`Node js` and `Express js`) code on openshift, from one week I'm getting this error. How to overcome this?

风格不统一 提交于 2019-12-12 05:17:21

问题


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.



来源:https://stackoverflow.com/questions/39242584/i-had-hosted-my-server-side-node-js-and-express-js-code-on-openshift-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!