Coder Social home page Coder Social logo

Comments (10)

fooness avatar fooness commented on July 29, 2024 1

Now there’s one more problem, but I’m not sure it’s related to this issue …

Screenshot 2020-09-02 at 13 54 23

from synapse-admin.

awesome-michael avatar awesome-michael commented on July 29, 2024

I assume you are working on Ubuntu. It seems you have the wrong "yarn" installed. See https://stackoverflow.com/questions/46013544/yarn-install-command-error-no-such-file-or-directory-install

from synapse-admin.

fooness avatar fooness commented on July 29, 2024

Thank you for your reply. This seems to work, somewhat. It’s necessary to install node >= 10, too, from probably external resources … e.g. via curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

Maybe this should be part of the README, in case others are having the same problems.

from synapse-admin.

awesome-michael avatar awesome-michael commented on July 29, 2024

Is the homeserver you configured reachable from your system? The network error may indicate that's not the case. Are there errors in the browsers console or in the network tab of the browsers developer tools?

from synapse-admin.

fooness avatar fooness commented on July 29, 2024

It’s definitely reachable, I’m interacting with it through Element. No network errors, but some errors in the console, yes …

Navigated to http://<some_ip>/#/users
The development server has disconnected.
Refresh the page if necessary. 0.chunk.js:152786:13
[HMR] Waiting for update signal from WDS... log.js:24
Download the React DevTools for a better development experience: https://fb.me/react-devtools react-dom.development.js:24994
checkAuth […] authProvider.js:48
getList users dataProvider.js:134
httpClient https://some.domain/_synapse/admin/v2/users?deactivated=false&dir=f&from=0&guests=true&limit=10&order_by=id dataProvider.js:7
checkAuth […] authProvider.js:48
XHROPTIONShttps://some.domain/_synapse/admin/v2/users?deactivated=false&dir=f&from=0&guests=true&limit=10&order_by=id
[HTTP/1.1 404 Not Found 46ms]
TypeError: NetworkError when attempting to fetch resource. index.js:1
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://some.domain/_synapse/admin/v2/users?deactivated=false&dir=f&from=0&guests=true&limit=10&order_by=id. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://some.domain/_synapse/admin/v2/users?deactivated=false&dir=f&from=0&guests=true&limit=10&order_by=id. (Reason: CORS request did not succeed).
checkError undefined 2 authProvider.js:39
Warning: Missing translation for key: "NetworkError when attempting to fetch resource."

from synapse-admin.

awesome-michael avatar awesome-michael commented on July 29, 2024

The 404 error could mean that the endpoint is not correct (which version of synapse are you talking to? The latest version of synapse-admin need synapse to be at least v1.18.0)
But maybe the CORS errors are the problem. Maybe the server running synapse does not set the correct headers?

from synapse-admin.

fooness avatar fooness commented on July 29, 2024

synapse shouldn’t be the problem.

root@host:/var/www/element# dpkg -l | grep matrix-synapse
ii  matrix-synapse-py3             1.19.0+bionic1                      amd64        Open federated Instant Messaging and VoIP server

I don’t think we do set any headers manually … is there some way to, hm, allow the access from the interface-server-ip? I don’t really know that much about CORS headers. But, I mean, we can connect to our homeserver from Element Desktop, too, so I wouldn’t quite understand why the connection from the interface would not work.

from synapse-admin.

fooness avatar fooness commented on July 29, 2024

I just tried adding the following to my homeserver’s nginx sites file, as seen in: https://serverfault.com/a/716283

  location /_synapse {
     if ($request_method = 'OPTIONS') {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
        add_header 'Access-Control-Max-Age' 1728000;
        add_header 'Content-Type' 'text/plain charset=UTF-8';
        add_header 'Content-Length' 0;
        return 204;
     }
     if ($request_method = 'POST') {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
     }
     if ($request_method = 'GET') {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
     }
  }

Still results in errors:

GEThttps://some.domain/_synapse/admin/v2/users?deactivated=false&dir=f&from=0&guests=true&limit=10&order_by=id
[HTTP/1.1 404 Not Found 33ms]

TypeError: NetworkError when attempting to fetch resource. index.js:1

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://some.domain/_synapse/admin/v2/users?deactivated=false&dir=f&from=0&guests=true&limit=10&order_by=id. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Maybe the CORS is not the problem, but why is this error 404 shown there in the first line?

from synapse-admin.

fooness avatar fooness commented on July 29, 2024

Maybe related: #65

My nginx config is as described in the synapse docs …

  location /_matrix {
    proxy_pass http://127.0.0.1:8008;
    proxy_set_header X-Forwarded-For $remote_addr;
    client_max_body_size 10M;
  }

from synapse-admin.

awesome-michael avatar awesome-michael commented on July 29, 2024

Seems your nginx config is missing the _synapse endpoint which is used by the admin api. Hence the 404

from synapse-admin.

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.