Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faye Troubleshooting #355

Open
johnjelinek opened this issue May 9, 2014 · 13 comments
Open

Faye Troubleshooting #355

johnjelinek opened this issue May 9, 2014 · 13 comments

Comments

@johnjelinek
Copy link

I'm using Phusion Passenger + nginx instead of thin. Almost everything works right out of the box, except I need to add therubyracer gem and faye constantly has to reconnect. Do you have any recommendations on getting faye to work?

Comm link is up! application.js?body=1:29
XHR finished loading: POST "http://localhost:3000/remote/faye". faye.js:2
XHR finished loading: POST "http://localhost:3000/remote/faye". faye.js:2
Comm link to Cybertron is down! application.js?body=1:29
XHR finished loading: POST "http://localhost:3000/remote/faye". faye.js:2
Comm link is up! application.js?body=1:29

I see a lot of this repeated in the console.

@alexhulbert
Copy link

Could this be linked to issue #327? I know faye was freaking out there.

@johnjelinek
Copy link
Author

It's different though, in the issue you referenced, faye is returning 404s,
in mine it successfully connects and dies. It seems like maybe Passenger or
nginx aren't handling the websockets so well perhaps. Any suggestions?
On May 9, 2014 8:54 AM, "Taconut" [email protected] wrote:

Could this be linked to issue #327#327?
I know faye was freaking out there.


Reply to this email directly or view it on GitHubhttps://github.com//issues/355#issuecomment-42668259
.

@scouttyg
Copy link
Member

I notice Cybertron goes down a bit in the console, but it usually comes right back up. Are you experiencing dropped messages? IE If you post a message are you still seeing things like:

XHR finished loading: POST "https:/yourapp.com/channels/1/activities". 

@scouttyg
Copy link
Member

What version of Phusion Passenger + nginx are you using for the app? From faye-websocket's documentation:

(supported environments)

Phusion Passenger >= 4.0 with nginx >= 1.4

@johnjelinek
Copy link
Author

I'm not noticing dropped messages, but the account menu in the top right
isn't responding to clicks. POSTs are successful. I'm using the latest
passenger/nginx mentioned in this docker container:
https://github.com/phusion/passenger-docker.

I created a kandan dockerfile to spin up kandan instances on demand, I
wanted to depend on the phusion ruby container because the default kandan
install instructions weren't working for me (had problems with building the
json native gem) and their container had that fixed.
On May 10, 2014 10:39 AM, "scouttyg" [email protected] wrote:

What version of Phusion Passenger + nginx are you using for the app? From
faye-websocket's documentation:

(supported environments)

Phusion Passenger >= 4.0 with nginx >= 1.4


Reply to this email directly or view it on GitHubhttps://github.com//issues/355#issuecomment-42745190
.

@johnjelinek
Copy link
Author

I now have both nginx serving through passenger on port 8080 and thin serving simultaneously on port 3000. I'm noticing that the thin server is having the loading messages problem and the passenger server is getting a popup after I login saying it cannot connect (but it does seem to send messages and load previous messages).

@johnjelinek
Copy link
Author

This is the message through phusion passenger:

screenshot_5_13_14__5_32_pm

@johnjelinek
Copy link
Author

lol, I have no idea how to debug this ... it's intermittent. After a few reloads, both load previous messages ... even though passenger is still saying that message on page refresh.

@johnjelinek
Copy link
Author

Perhaps I need to upgrade the connection to support websockets in nginx 1.6, but it's not proxying the connection to passenger, it's running passenger through custom nginx commands.

@johnjelinek
Copy link
Author

currently, only in the 3000 (thin) server do multiple users display in the chat list.

@johnjelinek
Copy link
Author

I'm using vagrant/docker for all this ... so please let me know if you'd like a copy of my files to spin this up yourself for further analysis.

@johnjelinek
Copy link
Author

Note: you can see an on-going discussion here phusion/passenger-docker#22 as well.

@miurahr
Copy link
Contributor

miurahr commented Jul 6, 2015

Here is my (partially) working snippet for nginx/faye configuration for nginx-1.9.2.

        map $http_upgrade $connection_upgrade {
            default Upgrade;
            ''      close;
        }
    location /remote/ {
                proxy_pass http://kandanserver;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                add_header Front-End-Https on;
                proxy_connect_timeout 90;
                proxy_read_timeout 86400;
                proxy_send_timeout 90;
                proxy_buffering off;
                proxy_redirect off;
        }
    location / {
                proxy_pass http://kandanserver;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto https;
     }

One big point is http protocol upgrade option to support WebSocket. It has an issue not to make desktop notification working. I've used kandan with https, it may be an issue with https support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants