Caddy: Eventsource request timeout

Created on 1 Dec 2016  路  10Comments  路  Source: caddyserver/caddy

1. What version of Caddy are you running (caddy -version)?

0.9.3

2. What are you trying to do?

Use Caddy as a reverse proxy in front of YouTrack 7.0 Build 28110.

3. What is your entire Caddyfile?

localhost:9000 {
  proxy / localhost:8080 {
    transparent
  }  
}

4. How did you run Caddy (give the full command and describe the execution environment)?

caddy

5. What did you expect to see?

Caddy is letting through eventsource requests.

6. What did you see instead (give full error messages and/or log)?

eventsource requests are timing out and YouTrack displays a warning dialog with the following:

The live update connection is taking longer than expected. Please refer to the YouTrack reverse proxy configuration and verify that you have disabled buffering for connections that support live updates.

7. How can someone who is starting from scratch reproduce this behavior as minimally as possible?

1/A. Start YouTrack with Docker

docker run --rm -p 8080:8080 -e BASE_URL=http://localhost:9000 wearemakery/youtrack:7.0.28110

1/B. Start YouTrack without Docker

wget https://download.jetbrains.com/charisma/youtrack-7.0.28867.jar
java -Xmx1g -XX:MaxPermSize=250m -Djava.awt.headless=true -Djetbrains.youtrack.baseUrl=http://localhost:9000 -jar youtrack-7.0.28867.jar 8080
  1. Start Caddy.

  2. Open localhost:9000

  3. Setup YouTrack -> Click There are no projects yet. Start with creating one. -> Create a new project with a Scrum board -> Navigate to Agile Boards page -> Wait a few seconds

  4. The warning dialog should display. You can open e.g. Chrome / Inspect / Network as well, there should be an eventsource type request pending forever.

Nginx

YouTrack has an official proxy guide for e.g. Nginx where they recommend to use the following options:

proxy_cache off;
proxy_buffering off;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
proxy_set_header Connection '';
chunked_transfer_encoding off;
help wanted

Most helpful comment

If you don't use gzip, what's your go version? If it is 1.7.x, then the issue is a duplication of #1355 .

All 10 comments

I think it might be fixed by: https://github.com/mholt/caddy/pull/1274 and https://github.com/mholt/caddy/pull/1257

Can you test your setup on master version of Caddy?

Just tested with 8653b70 and the request is still pending indefinitely.

Hmm, I have a hunch, but... can you _downgrade_ to 0.9.1 just to test this and see if it's still an issue in that version?

It is the same with 0.9.1.

Just try to reproduce it with the latest version(3f77060), but I can't reproduce it locally.
screenshot-20170106 155218

The status code is 200 for me as well, but there isn't any communication going on between the server and the browser.
screen shot 2017-01-06 at 20 18 48

@gyulavoros Everything works fine here(ping every 30s). So I just suspect the docker environment...

screenshot-20170109 093627

Hi @gyulavoros , do you enable gzip in your caddyFile? A similar issue(#1355) is caused by it. Could you please take a snapshot of the response's header in chrome?

If you don't use gzip, what's your go version? If it is 1.7.x, then the issue is a duplication of #1355 .

Thank you @tw4452852 for all the help! I can confirm the building Caddy with e.g. go1.8rc2 resolves the issue with SSE. Now it's working with and without Docker as well. I don't use gzip in the Caddyfile.

Was this page helpful?
0 / 5 - 0 ratings