Can't register device
The problem
I have freshly installed the Docker container. When I attempt to access the following URL: http://mydomain.de:8080/v1/qrcodelink?device-name=signal-api, the following error appears: {"error":"Please provide a name for the device"}.
I am using Debian Bookworm as the operating system.
Are you using the latest released version?
- [X] Yes
Have you read the troubleshooting page?
- [X] Yes
What type of installation are you running?
signal-cli-rest-api Docker Container
In which mode are you using the docker container?
Normal Mode
What's the architecture of your host system?
x86-64
Additional information
No response
CORRECTION: Running in Nativ Mode
Should be device_name instead of device-name
Thx, now the error is: {"error":"Couldn't create QR code: no data to encode"}
I call the URL: /v1/qrcodelink?device_name=signal-api
Same here, I also get the
{"error":"Couldn't create QR code: no data to encode"}
I also tried the hints from issue #231, but with no success. I am on a network with no proxy or so (although it is quite slow, LTE) and I am still getting
{"error":"Couldn't create QR code: no data to encode"}
I am using the latest docker image (0.88)
{
"versions": [
"v1",
"v2"
],
"build": 2,
"mode": "native",
"version": "0.88",
"capabilities": {
"v2/send": [
"quotes",
"mentions"
]
}
}
Could you please try if it works in normal or json-rpc mode.
In normal mode it's not working. In json-rpc mode it sends back: {"error":"This endpoint is not supported in JSON-RCP mode."}
In normal mode it's not working. In json-rpc mode it sends back: {"error":"This endpoint is not supported in JSON-RCP mode."}
Are you sure you are running the latest version? The linking should also work in json-rpc mode
I started the container with the following command: $ sudo docker run -d --name signal-api --restart=always -p 8080:8080
-v $HOME/.local/share/signal-api:/home/.local/share/signal-cli
-e 'MODE=json-rpc' bbernhard/signal-cli-rest-api
Under /v1/about I get the following output:
{"versions":["v1","v2"],"build":2,"mode":"json-rpc","version":"0.70","capabilities":{"v2/send":["quotes","mentions"]}}
I started the container with the following command: $ sudo docker run -d --name signal-api --restart=always -p 8080:8080 -v $HOME/.local/share/signal-api:/home/.local/share/signal-cli -e 'MODE=json-rpc' bbernhard/signal-cli-rest-api
Under /v1/about I get the following output:
{"versions":["v1","v2"],"build":2,"mode":"json-rpc","version":"0.70","capabilities":{"v2/send":["quotes","mentions"]}}
Your version (0.70) is heavily outdated. The current version is 0.88
I also tried the hints from issue #231, but with no success. I am on a network with no proxy or so (although it is quite slow, LTE) and I am still getting
{"error":"Couldn't create QR code: no data to encode"}I am using the latest docker image (0.88)
{ "versions": [ "v1", "v2" ], "build": 2, "mode": "native", "version": "0.88", "capabilities": { "v2/send": [ "quotes", "mentions" ] } }
Please switch to the debug mode (see https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/DEBUG.md) and try to use signal-cli directly. In case you've already tried a bunch of times, it might be worth a try to remove the signal-cli-config folder from the filesystem and start from scratch. Sometimes artifacts are left behind which block any registering attempts.
I started the container with the following command: $ sudo docker run -d --name signal-api --restart=always -p 8080:8080 -v $HOME/.local/share/signal-api:/home/.local/share/signal-cli -e 'MODE=json-rpc' bbernhard/signal-cli-rest-api Under /v1/about I get the following output: {"versions":["v1","v2"],"build":2,"mode":"json-rpc","version":"0.70","capabilities":{"v2/send":["quotes","mentions"]}}
Your version (0.70) is heavily outdated. The current version is 0.88
Now it works, for some reason I still had an old image on the server.
Thanks for the hint :)
I still get a "Link request error: Connection closed!" message. I tried it in debug mode and from with the docker container. It seems to be a signal-cli issue (or more probable an issue of my setup with WSL2 and signal-cli?).
I also filed an issue here https://github.com/AsamK/signal-cli/issues/1567.
Started Signal REST API
{"versions":["v1","v2"],"build":2,"mode":"json-rpc","version":"0.88","capabilities":{"v2/send":["quotes","mentions"]}}
To register a secondary device to an existing account, go to
http://localhost:9022/v1/qrcodelink?device_name=chatally
+ set -e
+ [ -z /home/.local/share/signal-cli ]
+ usermod -u 1000 signal-api
usermod: no changes
+ groupmod -g 1000 signal-api
+ chown 1000:1000 -R /home/.local/share/signal-cli
+ cat
+ cap_prefix=-cap_
+ cat /proc/sys/kernel/cap_last_cap
+ seq -s ,-cap_ 0 37
+ caps=-cap_0,-cap_1,-cap_2,-cap_3,-cap_4,-cap_5,-cap_6,-cap_7,-cap_8,-cap_9,-cap_10,-cap_11,-cap_12,-cap_13,-cap_14,-cap_15,-cap_16,-cap_17,-cap_18,-cap_19,-cap_20,-cap_21,-cap_22,-cap_23,-cap_24,-cap_25,-cap_26,-cap_27,-cap_28,-cap_29,-cap_30,-cap_31,-cap_32,-cap_33,-cap_34,-cap_35,-cap_36,-cap_37
+ [ json-rpc = json-rpc ]
+ /usr/bin/jsonrpc2-helper
time="2024-08-19T08:24:12Z" level=info msg="Updated jsonrpc2.yml"
+ [ -n ]
+ service supervisor start
Starting supervisor: supervisord.
+ supervisorctl start all
+ hostname -I
+ awk {print $1}
+ export HOST_IP=172.17.0.2
+ exec setpriv --reuid=1000 --regid=1000 --init-groups --inh-caps=-cap_0,-cap_1,-cap_2,-cap_3,-cap_4,-cap_5,-cap_6,-cap_7,-cap_8,-cap_9,-cap_10,-cap_11,-cap_12,-cap_13,-cap_14,-cap_15,-cap_16,-cap_17,-cap_18,-cap_19,-cap_20,-cap_21,-cap_22,-cap_23,-cap_24,-cap_25,-cap_26,-cap_27,-cap_28,-cap_29,-cap_30,-cap_31,-cap_32,-cap_33,-cap_34,-cap_35,-cap_36,-cap_37 signal-cli-rest-api -signal-cli-config=/home/.local/share/signal-cli
time="2024-08-19T08:24:13Z" level=info msg="Started Signal Messenger REST API"
[GIN] 2024/08/19 - 08:24:15 | 200 | 54.6µs | 172.17.0.1 | GET "/v1/about"
[GIN] 2024/08/19 - 08:24:15 | 204 | 151.5µs | 172.17.0.1 | POST "/v1/configuration"
time="2024-08-19T08:24:28Z" level=debug msg="json-rpc command: {\"jsonrpc\":\"2.0\",\"method\":\"startLink\",\"id\":\"7a74377b-8c82-415a-8b4a-61d0517cbdb8\",\"params\":{}}"
time="2024-08-19T08:24:35Z" level=debug msg="json-rpc received data: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-3,\"message\":\"Link request error: Connection closed!\",\"data\":null},\"id\":\"7a74377b-8c82-415a-8b4a-61d0517cbdb8\"}\n"
time="2024-08-19T08:24:35Z" level=debug msg="json-rpc command response message: "
time="2024-08-19T08:24:35Z" level=debug msg="json-rpc response error: Link request error: Connection closed!"
time="2024-08-19T08:24:35Z" level=debug msg="json-rpc command error code: -3"
[GIN] 2024/08/19 - 08:24:35 | 400 | 6.6569352s | 172.17.0.1 | GET "/v1/qrcodelink?device_name=chatally"
Today, without me doing anything different (I have even scripted the server startup and cleaning of configuration files), it suddenly worked and displayed the QR code which allowed me to link the server to my Signal account. Seems the Signal server has better and worse days and does not always play well with third-party applications.