Closed code-IM-perfect closed 2 years ago
NVM, I think it was something with PowerShell, using CMD there were no errors
Same error... different reason... :shrug: Illegal base 64 character. NOTE: This uri is the one generated from SignalDesktop
I thought maybe it was the dash (-) The dash DID get generated by SignalDesktop so maybe not an encoding issue on the cli. @AsamK Am I correct? Does that the character 20 referred to in the error is in the uuid?
signal-cli -u PHONENUMBER addDevice --uri "sgnl://linkdevice?uuid=xxxxxxxxxxxxxxxxxxx-xx&pub_key=xxxxxx"
ERROR AddDeviceCommand - Add device link failed
org.asamk.signal.manager.api.InvalidDeviceLinkException: Invalid device link uri
at org.asamk.signal.manager.api.DeviceLinkUrl.parseDeviceLinkUri(DeviceLinkUrl.java:36)
at org.asamk.signal.commands.AddDeviceCommand.handleCommand(AddDeviceCommand.java:49)
at org.asamk.signal.App.handleLocalCommand(App.java:289)
at org.asamk.signal.App.init(App.java:229)
at org.asamk.signal.Main.main(Main.java:60)
Caused by: java.lang.IllegalArgumentException: Illegal base64 character 20
at java.base/java.util.Base64$Decoder.decode0(Base64.java:848)
at java.base/java.util.Base64$Decoder.decode(Base64.java:566)
at java.base/java.util.Base64$Decoder.decode(Base64.java:589)
at org.asamk.signal.manager.api.DeviceLinkUrl.parseDeviceLinkUri(DeviceLinkUrl.java:34)
... 4 common frames omitted
Add device link failed.
Apparently a newly generated code causes me the same error. It does not have a dash.
This is also running inside an alpine docker container.
I thought the default ash shell was the issue, but changing to bash did not fix it.
According to the stack trace, the character 20 referes to the pub_key value.
Thanks for the clarification @AsamK .
Does that mean the pub_key sent is somehow being mangled by bash? Does some other encoding need to happen? Or perhaps my method (below) is causing an issue.
All other commands - device registration, captcha and usage seems to be working as intended.
Here is how I am getting the code to the CLI.. .perhaps you see a step here that is creating some invalid characters.
I echo the link to the screen during container load to compare it and it "looks" the same :shrug:
With a bit more exploration, I've discovered that generating several different QR codes from the desktop client (by choosing Preferences->Privacy->Clear data) will eventually generate a sgnl:// link that will be accepted by the cli. This was successful on two different accounts one needed about 8 different attempts to work and then next about 15. All failed links resulted in the error detailed above ...
Illegal base64 character 20
Just a note for future users having this error message:
Pay attention to the quotes around the URI. In my case, using single quotes (I am using bash) fixed the trouble.
BTW Thank you for providing signal-cli! :)
Hi, Sorry for disturbing you but
.\signal-cli -u PhoneNumber addDevice --uri "sgnl://linkdevice?uuid=************&pub_key=****************"
gives me
This was the exact URL I got from the bar code.