Skip to content

Trouble with matrix-server-config #66

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

Closed
saket424 opened this issue Sep 14, 2022 · 16 comments
Closed

Trouble with matrix-server-config #66

saket424 opened this issue Sep 14, 2022 · 16 comments

Comments

@saket424
Copy link

@skylord123
I am new to this project and am using nodered 3.0.2
I am successfully able to create a matrix user using the shared registration secret node

I am unable to save the access token and device id into the matrix-server-config node. When I try to save the data and deploy the list users node, the matrix-server-config node doesn't have any data after the deploy. Can you give me a clue of what I may be doing wrong and a hint for how to debug it

Thanks in advance

@saket424
Copy link
Author

I am seeing a http POST like this going to a matrix-chat endpoint inside nodered instead of to synapse. Can anyone provide any insights into what i may be doing wrong?

curl 'https://ody6.example.io:1880/matrix-chat/login' \
-H 'Accept: application/json, text/javascript, /; q=0.01'
-H 'Accept-Language: en-US,en;q=0.9'
-H 'Connection: keep-alive'
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8'
-H 'Origin: https://ody6.example.io:1880' \
-H 'Referer: https://ody6.example.io:1880/' \
-H 'Sec-Fetch-Dest: empty'
-H 'Sec-Fetch-Mode: cors'
-H 'Sec-Fetch-Site: same-origin'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36'
-H 'X-Requested-With: XMLHttpRequest'
-H 'sec-ch-ua: "Google Chrome";v="105", "Not)A;Brand";v="8", "Chromium";v="105"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "Linux"'
--data-raw 'userId=%40nrb%3Amatrix6.example.io&password=strongpassword&baseUrl=http%3A%2F%2F172.17.0.1%3A8008&displayName=Node-RED'
--compressed

yields a response

<title>Error</title>
Cannot POST /matrix-chat/login

@skylord123
Copy link
Contributor

@saket424 Can you check your logs for node-red? Wonder if this is a file permission issue or something else (especially if you run into docker this is a common problem).

@sgofferj
Copy link

I'm running into similar problems. I'm running Node RED in docker and I can't fetch the token. In Node RED, I see "Failed to login due to server error communicating with Node-RED". In the browser console, I have first seen POST https://hostname/matrix-chat/login 404.
Then I figured that I bent the URLs a little and had set httpAdminRoot: '/edit' and httpNodeRoot: '/'. After temporarily disabling those, I then got the same error in the node configuration but POST https://hostname/matrix-chat/login 401 in the browser console. The Node RED log doesn't show anything relevant with regards to the 401 error.

@skylord123
Copy link
Contributor

@sgofferj what version of NodeJS & Node-RED are you running?

@sgofferj
Copy link

@sgofferj what version of NodeJS & Node-RED are you running?

NR: 3.0.2
Node: 16.16.0
Image: nodered/node-red:latest

@saket424
Copy link
Author

saket424 commented Nov 17, 2022

@skylord123 and @sgofferj ,
I too am using nodered 3.0.2 and nodejs-16

I think the root cause is the matrix-server-config node isn't working and saving the access token specified

I am running nodered in elevated root permission mode since it may need access to raw /dev devices. So I doubt it is a file permissions issue

@skylord123
Copy link
Contributor

@sgofferj @saket424 thanks for responding! I will check this out and get back to you guys. I'm running NodeJS 14 right now on my home server and it's working. I bet this has to do with NodeJS 16. I have an update I have been working on that will resolve this if that is the case.

@saket424
Copy link
Author

saket424 commented Dec 1, 2022

@skylord123
Eagerly waiting for your update and confirmation that you have a fix for nodeJS 16 as you suspect is the case

@skylord123
Copy link
Contributor

Sorry for taking a while. Been busy with on-call work stuff.

So I tested my new changes on nodejs 12, 14, and 16 and it's working correctly. Before I do a release though there is a couple other fixes people have put in that I will be including. So expect this to be released in the next couple days.

Again, sorry for the wait.

@sgofferj
Copy link

sgofferj commented Dec 5, 2022

No need to apologize for sacrificing your spare time doing unpaid work so total strangers can do some cool stuff! 😉
Thanks for your work!

@skylord123
Copy link
Contributor

@sgofferj v0.7.0 just landed. Give it a shot and let me know how it goes. Thanks!

@sgofferj
Copy link

sgofferj commented Dec 7, 2022

@skylord123 Awesome! I'll start testing when I'm back from my trip.

@saket424
Copy link
Author

saket424 commented Dec 8, 2022

@skylord123
It appears the issue is fixed now with v0.7.0
Thanks for all the updates. I have begun with the newest synapse and element docker images and am using the nginx reverse proxy and nodered 3.0.2 also as docker
containers

I am also using https://github.com/oofnikj/docker-openwrt version 21.02.5 running as the controlling docker container for all the other containers. All traffic in and out of the other containers flows through this controlling container

@saket424 saket424 closed this as completed Dec 8, 2022
@sgofferj
Copy link

Works for me too, even with the bent URLs. Thanks!
Any plans to implement cross-verification?

@skylord123
Copy link
Contributor

skylord123 commented Dec 13, 2022

Any plans to implement cross-verification?

I have a branch I am working on but haven't had time to touch it recently. I was having some issues doing the verification which may have been fixed in the latest matrix-js-sdk/olm versions so I will have to give it another shot.

I also want to add secret storage support and this looks promising to try out:
matrix-org/matrix-js-sdk#2506 (comment)

@sgofferj
Copy link

Awesome!

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

3 participants