Comments (11)
Hey, sorry, I have to appologize. I found the problem. It was indeed an error in the nginx configuration. The errors of localhost requests were thrown, because I accidentally added the "pushgateway" path segment in the URL. I wanted to forward requests with the location "pushgateway" (e. g. https://myserver.com/pushgateway/_matrix/push/v1/notify) to the sygnal server, but the word "pushgateway" was not replaced by nginx. The actual nginx configuration needs to be defined as following for this to work:
location /pushgateway/ {
proxy_pass http://127.0.0.1:5000/;
}
Note the both slashes around "pushgateway" and the trailing slash after "5000". Maybe this helps other people that run into the same problem and come across this issue.
from sygnal.
You should likely proxy /_matrix/push/
to wherever your sygnal instance is listening on (UNIX socket, TCP port, ...), this depends on your gunicorn settings if that's what you are using.
from sygnal.
I have the same problem. I have a reverse proxy in place, but the error occurs even if I call the push gateway on the same host via 127.0.0.1. Unfortunately the sygnal log only show that the 404 error was returned without further information about the reason...
Tried the command "curl --header 'Host: ' :/_matrix/push"
It yields the following output:
Method Not Allowed
Your browser approached me (at /_matrix/push) with the method "GET". I only allow the method HEAD here.
If I try to call curl with the "-I" or "--head" option to make a HEAD request, I get this:
ubuntu@chat-server:~/sygnal$ curl -I 127.0.0.1:5000/_matrix/push
HTTP/1.1 500 Internal Server Error
Server: TwistedWeb/19.7.0
Date: Sun, 20 Oct 2019 19:19:24 GMT
Content-Type: text/html
Content-Length: 95
And the sygnal.log file shows this:
2019-10-20 19:19:24,375 [4553] CRITICAL twisted
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.7/site-packages/twisted/web/server.py", line 217, in process
self.render(resrc)
File "/home/ubuntu/.local/lib/python3.7/site-packages/twisted/web/server.py", line 284, in render
body = resrc.render(self)
File "/home/ubuntu/.local/lib/python3.7/site-packages/twisted/web/resource.py", line 265, in render
return m(request)
File "/home/ubuntu/.local/lib/python3.7/site-packages/twisted/web/resource.py", line 275, in render_HEAD
return self.render_GET(request)
AttributeError: 'Resource' object has no attribute 'render_GET'
2019-10-20 19:19:24,376 [4553] INFO sygnal.access "-" - - [13/Jan/1970:08:16:11 +0000] "HEAD /_matrix/push HTTP/1.1" 500 - "-" "curl/7.58.0"
from sygnal.
Hey, @whigger85: this is also likely an issue with the way you are proxying Sygnal.
It'd be useful to know what your Sygnal config is (mind the secrets) and also how you are proxying it, aka your nginx / apache / whatever configuration or are you using twisted itself?
It's a bit awkward because Sygnal doesn't use twisted, yet that's the kind of traceback you are showing here.
from sygnal.
Hi, thanks for the quick reply. The sygnal config is attached. I'm using nginx with the followning entry in the related file in the "sites-available" folder:
location /pushgateway {
proxy_pass http://127.0.0.1:5000;
proxy_set_header X-Forwarded-For $remote_addr;
}
Concerning twisted: I'm a little bit confused, because it seems to be an internal dependency of Sygnal. At least I don't use it explicitly. I just installed sygnal from the repo with "pip3 installl" and then started it with "python -m sygnal.sygnal". All the twisted-related output is coming from the started process.
from sygnal.
Had to update the config file ending, as yaml is apparently not supported by github.
sygnal.txt
from sygnal.
this is a problem with the configuration of the reverse-proxy, not a sygnal bug.
from sygnal.
this is a problem with the configuration of the reverse-proxy, not a sygnal bug.
Why do you think that this is a reverse proxy configuration error? It even occurs when I access the server from localhost (effectively bypassing reverse proxy configuration) and even if I don't have a reverse proxy configuration for the sygnal port at all.
from sygnal.
the logs show that the /_matrix/push/v1/notify
request is arriving at synapse rather than sygnal; one way or another that means that the request is being routed to the wrong place and it's not a sygnal problem.
from sygnal.
the logs show that the
/_matrix/push/v1/notify
request is arriving at synapse rather than sygnal; one way or another that means that the request is being routed to the wrong place and it's not a sygnal problem.
The first post comes from the issue creator and not from me. This is not my log output! I explicitly call the following on the sygnal host:
curl -X POST http://127.0.0.1:5000/pushgateway/_matrix/push/v1/notify -H "Content-Type: application/json" --data @test.json
And get the following result:
<title>404 - No Such Resource</title>No Such Resource
No such child resource.
How can this be a proxy problem?
from sygnal.
you said "I have the same problem". If you think your problem is different, you should open a different issue.
sydent will look for /_matrix/push/v1/notify
, not /pushgateway/_matrix/push/v1/notify
.
from sygnal.
Related Issues (20)
- FCM push for iOS issue HOT 2
- Web push notifications are not working with web.push.apple.com (Safari) HOT 3
- missing setup.py file HOT 3
- UnifiedPush support HOT 11
- Upgrade dependencies HOT 1
- Documentation for using Sygnal behind a reverse proxy HOT 9
- New tagged version HOT 2
- Disable logging for health endpoint
- anyway to use gcm/fcm key as of today 24/10/2023 for android notification HOT 2
- `sygnal.__version__` is broken
- Tests failing with Twisted 23.10
- twisted Timing out client: IPv6Address HOT 1
- ios push how to cancel user_id HOT 1
- GCMPushkin assumes that content field is not null. Fails when push format is `event_id_only`
- Unable to send Push notification with content_available and mutable_content configurations in sygnal.yaml HOT 13
- Sygnal only sending data-only FCM messages HOT 4
- v0.14.0 FCM error sending notification HOT 9
- FCM v1 Upgrade - 'NoneType' object has no attribute 'items' HOT 2
- docker build failed from tar.gz source HOT 1
- FCM API Credential refresh mechanism doesn't support HTTP proxies and blocks the event loop HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sygnal.