Giter VIP home page Giter VIP logo

Comments (11)

devjeff avatar devjeff commented on September 18, 2024 3

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.

evilham avatar evilham commented on September 18, 2024

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.

devjeff avatar devjeff commented on September 18, 2024

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:

<title>405 - Method Not Allowed</title>

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.

evilham avatar evilham commented on September 18, 2024

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.

devjeff avatar devjeff commented on September 18, 2024

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.

devjeff avatar devjeff commented on September 18, 2024

Had to update the config file ending, as yaml is apparently not supported by github.
sygnal.txt

from sygnal.

richvdh avatar richvdh commented on September 18, 2024

this is a problem with the configuration of the reverse-proxy, not a sygnal bug.

from sygnal.

devjeff avatar devjeff commented on September 18, 2024

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.

richvdh avatar richvdh commented on September 18, 2024

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.

devjeff avatar devjeff commented on September 18, 2024

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.

richvdh avatar richvdh commented on September 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.