User name does not exist

General support for problems installing or using Deluge
bookedirl
New User
New User
Posts: 5
Joined: Mon Nov 16, 2015 3:50 am

User name does not exist

Postby bookedirl » Mon Dec 21, 2020 8:26 pm

Hello,

I'm getting this error when using deluge-console

Failed to connect to 127.0.0.1:58846 with reason: Username does not exist


I'm trying to pass deluge-console commands through a script and also getting User name does not exist.

I'm running on a raspberry pi 3b using DietPi. I believe deluge version is 1.3.15.

Any idea how I can fix this?

mhertz
Compulsive Poster
Compulsive Poster
Posts: 996
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: User name does not exist

Postby mhertz » Mon Dec 21, 2020 9:11 pm

With deluge-console same rules apply as with GTK-UI thinclient, so if not running deluge-console from same user as deluged running under, then you either need have matching user/pass in auth files of both users, e.g. copy auth from main deluge profile folder and into deluge profile folder of current user(or add matching entries manually), or using an additional 'connect' command precedingly, e.g. deluge-console "connect localhost <user> <pass>; info", or, use sudo to change to same user as user running deluged, e.g. 'sudo -u deluge deluge-console info'.

I btw quickly found a thread for dietpi users having same deluge issue, and there is described the default folder where auth file is stored etc, for better reference if in doubt: https://dietpi.com/phpbb/viewtopic.php?t=5525

bookedirl
New User
New User
Posts: 5
Joined: Mon Nov 16, 2015 3:50 am

Re: User name does not exist

Postby bookedirl » Mon Dec 21, 2020 11:03 pm

I guess my real problem is running a script after deluge has finished downloading a torrent.

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3

deluge-console pause $TORRENT_ID
filebot -script fn:amc --output "/mnt/samba" --log-file /root/scripts/amc.log --action move --conflict override -non-strict --def music=y clean=y "movieFormat=Movies/{any{collection}{n+' ('+y+')'}}/{n} {'('+y+')'}{' CD'+pi}"  "ut_dir=$TORRENT_PATH/$TORRENT_NAME" "ut_kind=multi" "ut_title=$TORRENT_NAME"
deluge-console del $TORRENT_ID
filebot -script fn:cleaner $TORRENT_PATH --log-file /root/scripts/cleaner.log


This is what I'm running. And I get excluding the filebot errors:

Code: Select all

[ERROR   ] 22:59:27 client:391 RPCError Message Received!
--------------------------------------------------------------------------------
RPCRequest: daemon.login(, )
--------------------------------------------------------------------------------
  File "/usr/lib/python2.7/dist-packages/deluge/core/rpcserver.py", line 262, in dispatch
    ret = component.get("AuthManager").authorize(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/deluge/core/authmanager.py", line 89, in authorize
    raise BadLoginError("Username does not exist")

BadLoginError: Username does not exist
--------------------------------------------------------------------------------
Failed to connect to 127.0.0.1:58846 with reason: Username does not exist


I had an old raspberry pi 2 that worked using the same code a couple years baack... so the only different is the updated dietpi image and whatever os updates since then.

I'm able to run a local deluge-console using

Code: Select all

sudo -u debian-deluged deluge-console

shamael
Compulsive Poster
Compulsive Poster
Posts: 623
Joined: Sat Oct 08, 2016 9:28 am

Re: User name does not exist

Postby shamael » Wed Dec 23, 2020 12:18 pm

So it's well an impersonate issue it's seems no?
You're well able to call the console with "sudo -u debian-deluged deluge-console", so it all depends about who start your script.
Often only root can impersonate another user so if the script run as user X and the /etc/sudoers is not adapted to impersonate as "debian-deluged" it will failed.

Example with a user X, not root, no in the sudoers: "sudo -u debian-deluged deluge-console" will not work if "sudo bash" is not executed before

mhertz
Compulsive Poster
Compulsive Poster
Posts: 996
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: User name does not exist

Postby mhertz » Wed Dec 23, 2020 7:59 pm

it's strange to me because the execute plugin runs the defined shellscript from the deluged process running user i.e debian-deluged presumably, so should be able to authenticate, without sudo tricks(/abilities) or anything(e.g changed config-dir with '-c'), id presume, but for some reason doesn't, as per the logged function call showing no user or pass picked up for the login-atempt: 'RPCRequest: daemon.login(, )'.

I'd say to prepend a 'connect' command to the deluge-console commands in the script, I.e

Code: Select all

deluge-console "connect localhost <user> <pass> ; pause TORRENT_ID"
[...]
deluge-console "connect localhost <user> <pass> ; del TORRENT_ID"
[...]

User/pass is in auth file in format: 'user:pass:10' , in your deluge profile dir of deluge, possibly: '/mnt/dietpi_userdata/deluge/.config/deluge/auth'. In my example, where just using the auto-generated auth file, my connect command would just be e.g:

Code: Select all

 
deluge-console "connect localhost localclient a7bef72a890 ; pause TORRENT_ID"

For an auth file with:

Code: Select all

 
localclient:a7bef72a890:10

bookedirl
New User
New User
Posts: 5
Joined: Mon Nov 16, 2015 3:50 am

Re: User name does not exist

Postby bookedirl » Thu Dec 24, 2020 1:46 pm

So I tried this in my script and It still doesn't work. When I ran your script under root supplying the torrent id manually it worked.

I also tried as part of the console command as the dietpi set up notes say and that didn't work either.

Code: Select all

sudo -u debian-deluged deluge-console


set up notes https://dietpi.com/phpbb/viewtopic.php?p=61#p61


Return to “Support”

Who is online

Users browsing this forum: No registered users and 15 guests