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

Get 404 on notify_push:setup #89

Closed
mariusbertram opened this issue Apr 25, 2021 · 10 comments
Closed

Get 404 on notify_push:setup #89

mariusbertram opened this issue Apr 25, 2021 · 10 comments

Comments

@mariusbertram
Copy link

I try to get notify_push running on uberspaec. It's a shared hoster where you can set own backend services.
On my virtual network I can access the notify_push /test/cookie path. But not behind the proxy.

On the setup I receive an 404 error.

[notify@musca html]$ php occ notify_push:setup https://notify.uber.space/push
✓ redis is configured
🗴 can't connect to push server: Client error: `GET https://notify.uber.space/push/test/cookie` resulted in a `404 Not Found` response

The trace log from notify_push:

[2021-04-25 13:09:30.264326 +02:00] TRACE [tokio_util::codec::framed_impl] /cargo/registry/src/github.com-1ecc6299db9ec823/tokio-util-0.6.5/src/codec/framed_impl.rs:135: attempting to decode a frame
[2021-04-25 13:09:30.264509 +02:00] TRACE [tokio_util::codec::framed_impl] /cargo/registry/src/github.com-1ecc6299db9ec823/tokio-util-0.6.5/src/codec/framed_impl.rs:138: frame decoded from buffer
[2021-04-25 13:09:30.264565 +02:00] DEBUG [notify_push] src/lib.rs:399: Received test cookie 514187668
[2021-04-25 13:09:30.264591 +02:00] TRACE [tokio_util::codec::framed_impl] /cargo/registry/src/github.com-1ecc6299db9ec823/tokio-util-0.6.5/src/codec/framed_impl.rs:135: attempting to decode a frame
[2021-04-25 13:09:30.645973 +02:00] TRACE [mio::poll] /cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.11/src/poll.rs:478: registering event source with poller: token=Token(5), interests=READABLE | WRITABLE
[2021-04-25 13:09:30.646226 +02:00] TRACE [hyper::proto::h1::conn] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/conn.rs:140: Conn::read_head 
[2021-04-25 13:09:30.646317 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:81: parse_headers
[2021-04-25 13:09:30.646353 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:81: -> parse_headers
[2021-04-25 13:09:30.646377 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:129: Request.parse([Header; 100], [u8; 252]) 
[2021-04-25 13:09:30.646474 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:138: Request.parse Complete(252) 
[2021-04-25 13:09:30.646508 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:153: headers: [Header { name: "Connection", value: [99, 108, 111, 115, 101] }, Header { name: "Host", value: [110, 111, 116, 105, 102, 121, 46, 117, 98, 101, 114, 46, 115, 112, 97, 99, 101] }, Header { name: "X-Forwarded-Proto", value: [104, 116, 116, 112, 115] }, Header { name: "X-Forwarded-Port", value: [52, 52, 51] }, Header { name: "X-Forwarded-For", value: [49, 48, 48, 46, 54, 52, 46, 51, 57, 46, 50] }, Header { name: "X-Forwarded-For-Anon", value: [49, 48, 48, 46, 54, 52, 46, 48, 46, 48] }, Header { name: "User-Agent", value: [78, 101, 120, 116, 99, 108, 111, 117, 100, 32, 83, 101, 114, 118, 101, 114, 32, 67, 114, 97, 119, 108, 101, 114] }, Header { name: "Accept-Encoding", value: [103, 122, 105, 112] }] 
[2021-04-25 13:09:30.646606 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:81: <- parse_headers
[2021-04-25 13:09:30.646670 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:81: -- parse_headers
[2021-04-25 13:09:30.646707 +02:00] DEBUG [hyper::proto::h1::io] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/io.rs:167: parsed 8 headers 
[2021-04-25 13:09:30.646755 +02:00] DEBUG [hyper::proto::h1::conn] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/conn.rs:158: incoming body is empty 
[2021-04-25 13:09:30.646798 +02:00] TRACE [hyper::proto::h1::conn] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/conn.rs:822: remote disabling keep-alive 
[2021-04-25 13:09:30.646996 +02:00] TRACE [warp::filters::path] /cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "ws"?: "push" 
[2021-04-25 13:09:30.647051 +02:00] TRACE [warp::filters::path] /cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "push" 
[2021-04-25 13:09:30.647080 +02:00] TRACE [warp::filters::path] /cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "push" 
[2021-04-25 13:09:30.647106 +02:00] TRACE [warp::filters::path] /cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "push" 
[2021-04-25 13:09:30.647136 +02:00] TRACE [warp::filters::path] /cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "push" 
[2021-04-25 13:09:30.647167 +02:00] TRACE [warp::filters::path] /cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "push" 
[2021-04-25 13:09:30.647189 +02:00] DEBUG [warp::filter::service] /cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filter/service.rs:132: rejected: Rejection(NotFound) 
[2021-04-25 13:09:30.647221 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:93: encode_headers
[2021-04-25 13:09:30.647244 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:93: -> encode_headers
[2021-04-25 13:09:30.647262 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:291: Server::encode status=404, body=None, req_method=Some(GET) 
[2021-04-25 13:09:30.647303 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:93: <- encode_headers
[2021-04-25 13:09:30.647328 +02:00] TRACE [hyper::proto::h1::role] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/role.rs:93: -- encode_headers
[2021-04-25 13:09:30.647439 +02:00] DEBUG [hyper::proto::h1::io] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/io.rs:248: flushed 82 bytes 
[2021-04-25 13:09:30.647480 +02:00] TRACE [hyper::proto::h1::conn] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/conn.rs:861: State::close() 
[2021-04-25 13:09:30.647500 +02:00] TRACE [hyper::proto::h1::conn] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/conn.rs:663: flushed({role=server}): State { reading: Closed, writing: Closed, keep_alive: Disabled } 
[2021-04-25 13:09:30.647565 +02:00] TRACE [hyper::proto::h1::conn] /cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.4/src/proto/h1/conn.rs:670: shut down IO complete 
[2021-04-25 13:09:30.647610 +02:00] TRACE [mio::poll] /cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.11/src/poll.rs:609: deregistering event source from poller
@mariusbertram
Copy link
Author

It looks like notify_push doesn't accept http/2 requests.

@mariusbertram
Copy link
Author

I found a solution. The provided reverse proxy from uberspace doesn’t set the necessary header.

@flocke
Copy link

flocke commented May 8, 2021

@mariusbertram Could you share your solution, I am currently facing the same problem with my setup.

@mariusbertram
Copy link
Author

I set up an extra nginx as a second reverse proxy. And point the uberspace backend to the nginx.

@flocke
Copy link

flocke commented May 8, 2021

Which header was missing in your case?

@mariusbertram
Copy link
Author

Here is the Issue for the Uberspace lab Uberspace/lab#1004 .

@aanno
Copy link

aanno commented Jul 30, 2021

I'm suffering from the same problem, and I could rule out that it is related to http/2. Trace log of notify_push shows the following when doing ./scripts/occ.sh notify_push:setup https://breitbandig.local:8443/nextcloud/push:

[2021-07-30 08:58:06.502986 +00:00] TRACE [tokio_util::codec::framed_impl] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-util-0.6.7/src/codec/framed_impl.rs:177: attempting to decode a frame
[2021-07-30 08:58:06.503015 +00:00] TRACE [tokio_util::codec::framed_impl] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-util-0.6.7/src/codec/framed_impl.rs:180: frame decoded from buffer
[2021-07-30 08:58:06.503025 +00:00] DEBUG [notify_push] src/lib.rs:403: Received test cookie 30259628
[2021-07-30 08:58:06.503032 +00:00] TRACE [tokio_util::codec::framed_impl] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-util-0.6.7/src/codec/framed_impl.rs:177: attempting to decode a frame
[2021-07-30 08:58:06.534506 +00:00] TRACE [mio::poll] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.13/src/poll.rs:478: registering event source with poller: token=Token(33554435), interests=READABLE | WRITABLE                                                                                                               
[2021-07-30 08:58:06.534541 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:155: Conn::read_head 
[2021-07-30 08:58:06.534550 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:73: parse_headers
[2021-07-30 08:58:06.534554 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:73: -> parse_headers
[2021-07-30 08:58:06.534558 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:121: Request.parse([Header; 100], [u8; 153]) 
[2021-07-30 08:58:06.534562 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:130: Request.parse Complete(153) 
[2021-07-30 08:58:06.534567 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:145: headers: [Header { name: "Connection", value: [85, 112, 103, 114, 97, 100, 101] }, Header { name: "Host", value: [98, 114, 101, 105, 116, 98, 97, 110, 100, 105, 103, 46, 108, 111, 99, 97, 108] }, Header { name: "X-Forwarded-For", value: [49, 48, 46, 56, 56, 46, 50, 46, 54] }, Header { name: "User-Agent", value: [78, 101, 120, 116, 99, 108, 111, 117, 100, 32, 83, 101, 114, 118, 101, 114, 32, 67, 114, 97, 119, 108, 101, 114] }, Header { name: "Accept-Encoding", value: [103, 122, 105, 112] }]                         
[2021-07-30 08:58:06.534580 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:73: <- parse_headers
[2021-07-30 08:58:06.534584 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:73: -- parse_headers
[2021-07-30 08:58:06.534587 +00:00] DEBUG [hyper::proto::h1::io] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/io.rs:173: parsed 5 headers 
[2021-07-30 08:58:06.534591 +00:00] DEBUG [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:174: incoming body is empty 
[2021-07-30 08:58:06.534601 +00:00] TRACE [warp::filters::path] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "ws"?: "" 
[2021-07-30 08:58:06.534608 +00:00] TRACE [warp::filters::path] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "" 
[2021-07-30 08:58:06.534613 +00:00] TRACE [warp::filters::path] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "" 
[2021-07-30 08:58:06.534617 +00:00] TRACE [warp::filters::path] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "" 
[2021-07-30 08:58:06.534621 +00:00] TRACE [warp::filters::path] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "" 
[2021-07-30 08:58:06.534625 +00:00] TRACE [warp::filters::path] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "test"?: "" 
[2021-07-30 08:58:06.534629 +00:00] TRACE [warp::filters::path] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filters/path.rs:212: "push"?: "" 
[2021-07-30 08:58:06.534633 +00:00] DEBUG [warp::filter::service] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/warp-0.3.1/src/filter/service.rs:132: rejected: Rejection(NotFound) 
[2021-07-30 08:58:06.534638 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:85: encode_headers
[2021-07-30 08:58:06.534642 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:85: -> encode_headers
[2021-07-30 08:58:06.534645 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:296: Server::encode status=404, body=None, req_method=Some(GET) 
[2021-07-30 08:58:06.534650 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:85: <- encode_headers
[2021-07-30 08:58:06.534654 +00:00] TRACE [hyper::proto::h1::role] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/role.rs:85: -- encode_headers
[2021-07-30 08:58:06.534673 +00:00] DEBUG [hyper::proto::h1::io] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/io.rs:257: flushed 82 bytes 
[2021-07-30 08:58:06.534678 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:675: flushed({role=server}): State { reading: Init, writing: Init, keep_alive: Idle } 
[2021-07-30 08:58:06.534738 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:155: Conn::read_head 
[2021-07-30 08:58:06.534749 +00:00] TRACE [hyper::proto::h1::io] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/io.rs:185: parse eof 
[2021-07-30 08:58:06.534754 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:881: State::close_read() 
[2021-07-30 08:58:06.534757 +00:00] DEBUG [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:227: read eof 
[2021-07-30 08:58:06.534761 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:887: State::close_write() 
[2021-07-30 08:58:06.534764 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:881: State::close_read() 
[2021-07-30 08:58:06.534767 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:887: State::close_write() 
[2021-07-30 08:58:06.534770 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:675: flushed({role=server}): State { reading: Closed, writing: Closed, keep_alive: Disabled } 
[2021-07-30 08:58:06.534793 +00:00] TRACE [hyper::proto::h1::conn] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.9/src/proto/h1/conn.rs:682: shut down IO complete 
[2021-07-30 08:58:06.534800 +00:00] TRACE [mio::poll] /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.13/src/poll.rs:609: deregistering event source from poller

Hence:

./scripts/occ.sh notify_push:setup https://breitbandig.local:8443/nextcloud/push
+ podman exec -it --user www-data nc_app_1 php /var/www/html/occ notify_push:setup https://breitbandig.local:8443/nextcloud/push
✓ redis is configured
🗴 can't connect to push server: Client error: `GET https://breitbandig.local:8443/nextcloud/push/test/cookie` resulted in a `404 Not Found` response

@mariusbertram
Copy link
Author

I couldn't get notify_push getting to work with the fairly complex proxy setting at my hosting provider.
I had to compile nginx and use it as second reverse proxy.
A working setup looked like:

 wan--->uberspace nginx  ---> my nginx ---> notify_push
                   |
                   ---> uberspace apache ---> nextcloud 

https://manual.uberspace.de/background-network/

@mariusbertram mariusbertram reopened this Aug 5, 2021
@mariusbertram
Copy link
Author

With the new version it's now working for me.

@mortee
Copy link

mortee commented May 4, 2022

I have the exact same problem as the people above did. Using the binary that comes with app version 0.4.0 on armv7l. Running it in docker, in a separate container, but the config is mounted, and apparently it can connect to both NC, the DB and Redis. Same output in the trace log. I double-checked that I have the same header settings in nginx as explained in the readme.

What might still be wrong? I couldn't find any useful pointers among the above comments.

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