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

Docker and Kubernetes examples don't appear to work correctly #14

Closed
Yggdrasil opened this issue Nov 20, 2019 · 2 comments
Closed

Docker and Kubernetes examples don't appear to work correctly #14

Yggdrasil opened this issue Nov 20, 2019 · 2 comments

Comments

@Yggdrasil
Copy link
Contributor

Hi, first of all thank you for writing this handy tool. It appears to be just what I need.

In order to get a feel for how both http-broadcast and mercure work I'm trying to run the supplied examples. Unfortunately both the Docker and Kubernetes examples don't appear to work correctly (or I'm doing something wrong 😄). I'm not familiar enough yet with mercure or your code to figure it out myself. I'd appreciate if you could point me in the right direction!

I'm using the unmodified demo code from the /examples dir. In both demos the mercure hub responds with 404 on every query. Of course this means that the Varnish cache never gets flushed.

Docker-compose:

mercure_1  | 172.18.0.5 - - [20/Nov/2019:17:57:00 +0000] "GET /hub?topic=http-broadcast HTTP/1.1" 404 19 "" "Go-http-client/1.1"
mercure_1  | 172.18.0.6 - - [20/Nov/2019:17:57:00 +0000] "POST /hub HTTP/1.1" 404 19 "" "Go-http-client/1.1"
varnish_2  | time="2019-11-20T17:57:00Z" level=error msg="invalid response from Hub" response="HTTP/1.1 404 Not Found\r\nContent-Length: 19\r\nContent-Security-Policy: default-src 'self'\r\nContent-Type: text/plain; charset=utf-8\r\nDate: Wed, 20 Nov 2019 17:57:00 GMT\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: DENY\r\nX-Xss-Protection: 1; mode=block\r\n\r\n404 page not found\n"
varnish_2  | 172.18.0.3 - - [20/Nov/2019:17:57:00 +0000] "PURGE / HTTP/1.1" 500 0 "" "curl/7.66.0"

Kubernetes:
mercure deployment

10.10.3.27 - - [20/Nov/2019:17:59:54 +0000] "GET /hub?topic=http-broadcast HTTP/1.1" 404 19 "" "Go-http-client/1.1"
10.10.5.59 - - [20/Nov/2019:17:59:57 +0000] "GET /hub?topic=http-broadcast HTTP/1.1" 404 19 "" "Go-http-client/1.1"
10.10.5.59 - - [20/Nov/2019:18:00:00 +0000] "POST /hub HTTP/1.1" 404 19 "" "Go-http-client/1.1"
10.10.5.59 - - [20/Nov/2019:18:00:00 +0000] "GET /hub?topic=http-broadcast HTTP/1.1" 404 19 "" "Go-http-client/1.1"
10.10.3.27 - - [20/Nov/2019:18:00:01 +0000] "GET /hub?topic=http-broadcast HTTP/1.1" 404 19 "" "Go-http-client/1.1"

varnish deployment

10.10.0.30 - - [20/Nov/2019:18:03:00 +0000] "PURGE / HTTP/1.1" 500 0 "" "curl/7.66.0"
time="2019-11-20T18:03:10Z" level=error msg="invalid response from Hub" response="HTTP/1.1 404 Not Found\r\nContent-Length: 19\r\nContent-Security-Policy: default-src 'self'\r\nContent-Type: text/plain; charset=utf-8\r\nDate: Wed, 20 Nov 2019 18:03:10 GMT\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: DENY\r\nX-Xss-Protection: 1; mode=block\r\n\r\n404 page not found\n"
10.10.0.30 - - [20/Nov/2019:18:03:10 +0000] "PURGE / HTTP/1.1" 500 0 "" "curl/7.66.0"
time="2019-11-20T18:03:40Z" level=error msg="invalid response from Hub" response="HTTP/1.1 404 Not Found\r\nContent-Length: 19\r\nContent-Security-Policy: default-src 'self'\r\nContent-Type: text/plain; charset=utf-8\r\nDate: Wed, 20 Nov 2019 18:03:40 GMT\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: DENY\r\nX-Xss-Protection: 1; mode=block\r\n\r\n404 page not found\n"
10.10.0.30 - - [20/Nov/2019:18:03:40 +0000] "PURGE / HTTP/1.1" 500 0 "" "curl/7.66.0"
time="2019-11-20T18:03:50Z" level=error msg="invalid response from Hub" response="HTTP/1.1 404 Not Found\r\nContent-Length: 19\r\nContent-Security-Policy: default-src 'self'\r\nContent-Type: text/plain; charset=utf-8\r\nDate: Wed, 20 Nov 2019 18:03:50 GMT\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: DENY\r\nX-Xss-Protection: 1; mode=block\r\n\r\n404 page not found\n"
10.10.0.30 - - [20/Nov/2019:18:03:50 +0000] "PURGE / HTTP/1.1" 500 0 "" "curl/7.66.0"
@jderusse
Copy link
Owner

jderusse commented Nov 20, 2019

Hello, mercure changed the default route from /hub to /.well-known/mercure and I didn't updated http-broadcast documentation. I think this is the route cause of your issue.
Could you give a try with HUB_ENDPOINT=http://hub_container_name/.well-known/mercure?

If it's OK, I'll really appreciate if you had time to open a PR.

@Yggdrasil
Copy link
Contributor Author

Fixed in #15

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

2 participants