Skip to content
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

Code has the wrong length error message #6

Closed
odinblister opened this issue Oct 7, 2019 · 12 comments
Closed

Code has the wrong length error message #6

odinblister opened this issue Oct 7, 2019 · 12 comments

Comments

@odinblister
Copy link

I'm trying to get this to work. I followed the instructions, and added a Print folder to my Remarkable home. The printer showed up in my list of printers. When I print, nothing happens. I then went to the cups web interface and saw that the printer "reMarkable" has the status:

"Idle - "2019/10/07 17:19:46 auth.go:62: Code has the wrong length, it should be 8""

Any ideas of what this means?

@ofosos
Copy link
Owner

ofosos commented Oct 19, 2019

This is an error message from rmapi, you can head over to them and ask. Please report back, when you do.

@isovector
Copy link

I just ran into this too!

@ofosos
Copy link
Owner

ofosos commented Oct 31, 2019

Did you authenticate with the remarkable cloud beforehand? You need to authenticate with the user that runs the backend, or you need to copy the secrets file over to the user that runs the backend.

@isovector
Copy link

@ofosos ahh, i didn't realize it didn't run as me! that's almost certainly the issue. i'll dig in, cheers!

@isovector
Copy link

That did it, thanks. The solution was:

# mkdir /home/cups
# vim /etc/passwd
-- change home directory for cups to /home/cups
# sudo -u cups rmapi
-- authenticate rmapi as normal

@ofosos
Copy link
Owner

ofosos commented Nov 3, 2019

Great!

@ofosos ofosos closed this as completed Nov 3, 2019
@muhark
Copy link

muhark commented Nov 11, 2020

Hi, I'm having this same problem.
I've followed the instructions for installation, and on the first try of:

docker run -v $HOME/.rmapi/:/home/user/.rmapi/ -it rmapi

I get access to the shell, but when subsequently trying to run:

docker run -v $HOME/.rmapi/:/home/user/.rmapi/ rmapi help

or anything else (dropping the "help"), I get the Code has the wrong length error.

It looks to me like the token isn't being saved correctly, but I'm not sure how to fix this (or what the token should look like).

Docker version 19.03.8, build afacb8b
Linux Kernel: 5.7.14-200.fc32.x86_64

@ofosos
Copy link
Owner

ofosos commented Nov 12, 2020

Hey @muhark this looks like an rmapi bug

@raffraffraff
Copy link

Getting the same error in my /var/log/cups/error_log. I don't have a user 'cups', and I can see that the print job runs the remarkable/rmapi command as root. So I authenticated rmapi as root. However, the CUPS error_log still shows this error.

More importantly: this log spams the /var/log/cups/error_log with over 7000 errors per second, continuously. I knew something was 'wrong' when my laptop fans kicked in. I checked the file and it was already 250mb in size. Not sure where this 'pathalogical' logging comes from but I thought I'd warn anyone else who stumbled here through a Google search.

@ofosos
Copy link
Owner

ofosos commented Dec 2, 2020

@raffraffraff What distribution are you on that print jobs get run as root?

@raffraffraff
Copy link

raffraffraff commented Dec 3, 2020 via email

@isovector
Copy link

I just ran into this again. The issue was that the $cupsuser was my account, but whoami running the script was cups. Thus, the cups user was trying to use my credentials, but it didn't have permission to read them. I changed the RMAPI_CONFIG line to point to the cups credentials:

export RMAPI_CONFIG=/home/cups/.config/rmapi/rmapi.conf

and everything worked fine.

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

5 participants