signal-cli-rest-api icon indicating copy to clipboard operation
signal-cli-rest-api copied to clipboard

Error: "Couldn't create QR code: no data to encode"

Open jaanli opened this issue 1 year ago • 1 comments

The problem

Unable to link to a device unfortunately.

I was able to run these steps on a Lightsail Ubuntu AWS machine: https://github.com/bbernhard/signal-cli-rest-api?tab=readme-ov-file#getting-started

To test, I sent a few test messages using the example:

$ curl -X POST -H "Content-Type: application/json" 'http://localhost:8080/v2/send'
-d '{"message": "Test via Signal API!", "number": "+4412345", "recipients": [ "+44987654" ]}' However, when I continue along this repo's readme, and run step 1:

docker run -p 8080:8080
-v $(PWD)/signal-cli-config:/home/.local/share/signal-cli
-e 'MODE=normal' bbernhard/signal-cli-rest-api:0.57 This succeeds.

But when I proceed to step 2, I get this error:

{"error":"Couldn't create QR code: no data to encode"} Screenshot:

image The full log:

$ sudo docker run -p 8080:8080
-v $(pwd)/signal-cli-config:/home/.local/share/signal-cli
-e 'MODE=normal' bbernhard/signal-cli-rest-api:0.57

  • 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 40
  • 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,-cap_38,-cap_39,-cap_40
  • [ normal = json-rpc ]
  • hostname -i
  • export HOST_IP=xxx
  • 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,-cap_38,-cap_39,-cap_40 signal-cli-rest-api -signal-cli-config=/home/.local/share/signal-cli time="2024-04-21T15:19:39Z" level=info msg="Started Signal Messenger REST API" [GIN] 2024/04/21 - 15:19:57 | 400 | 2.608821556s | 172.17.0.1 | GET "/v1/qrcodelink?device_name=local" Has anyone else run into this? Any ideas on how to debug?

The goal is to integrate with the Claude API (https://docs.anthropic.com/claude/reference/getting-started-with-the-api) and my Open Interpreter (https://github.com/OpenInterpreter/open-interpreter).

Really excited to test this out!!

Via https://github.com/filipre/signalbot/issues/51

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

jaanli avatar Apr 25 '24 14:04 jaanli

Did you first register with a dedicated phone number and now decided to switch to linking a device? In any case, please remove the signal-cli-config folder from the filesystem and try again. In case it doesn't work in normal mode, please try to switch to json-rpc mode (you can later just switch back to normal mode, if you prefer).

bbernhard avatar Apr 27 '24 18:04 bbernhard

Yep, thank you @bbernhard . Solved by a complete restart, carefully checking the paths, and testing it on a physical separate phone/device/google voice number/twilio number combination from scratch.

jaanli avatar May 16 '24 10:05 jaanli