Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Cannot use sudo at all, reports 'File name too long'. (Read 1055 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Cannot use sudo at all, reports 'File name too long'.

Basically the title. Whenever I'm trying to sudo anything, it doesn't even ask me for a password before reporting that some kind of a filename is too long. This issue has appeared purely out of nowhere when I came back to my PC -  didn't even reboot it or anything. I am using OpenRC as my init system, if that even matters.
Code: [Select]
$ sudo pacman
sudo: pacman: File name too long
$ sudo whatever-else
sudo: whatever-else: File name too long
'su' and 'sudo -i' work perfectly fine though.

/var/log/auth:
Code: [Select]
Nov XX XX:XX:XX artix sudo[4543]:  haibane : pacman : File name too long ; TTY=pts/4 ; PWD=/home/haibane ; USER=root ; COMMAND=pacman
uname -a:
Code: [Select]
Linux artix 5.9.10-artix1-1 #1 SMP PREEMPT Sun, 22 Nov 2020 17:02:30 +0000 x86_64 GNU/Linux
I have not made any upgrades to the system prior to this issue, nor have I changed /etc/sudoers or anything related to PAM.

Re: Cannot use sudo at all, reports 'File name too long'.

Reply #1
Try opendoas, it isn't a solution completely, but it is what I mostly use. Could remove sudo pacman -Rd sudo and reinstall and see if that helps any.

Re: Cannot use sudo at all, reports 'File name too long'.

Reply #2
It didn't give the same error message, but I unintentionally broke sudo the other day. I'd modified /etc/security/limits.conf (which is owned by pam, not sudo) and then put it back to more or less standard in the past. Then I saw there was a .pacnew version. So I did sudo mv limits.conf limits.conf.old first, but then sudo stopped working totally, and I had to boot another partition and fix it from there after mounting the artix partition, with sudo mv limits.conf.pacnew limits.conf so it's possible for other things to affect sudo. Everything is fully updated and sudo still works fine here.
Have you got free hard drive space? I've had weird errors after running out of drive space, and then I was wondering what was going on.

Re: Cannot use sudo at all, reports 'File name too long'.

Reply #3
Try opendoas, it isn't a solution completely, but it is what I mostly use. Could remove sudo pacman -Rd sudo and reinstall and see if that helps any.
I'm using pkexec for now, but yeah, I'm not really okay with workarounds - I'd enjoy an actual solution. I've already tried reinstalling sudo, it didn't help.
I'd modified /etc/security/limits.conf (which is owned by pam, not sudo) and then put it back to more or less standard in the past.
I didn't edit limits.conf other than increasing limits for my user - this might be the culprit, I'll try commenting out the line once I get home. I do not have any 'pacnews' there either.
Have you got free hard drive space? I've had weird errors after running out of drive space, and then I was wondering what was going on.
For sure I do.

Re: Cannot use sudo at all, reports 'File name too long'.

Reply #4
Are you using fish shell, or do you have it installed? Searching about for recent similar problems, there's something here which mentions fish:
https://www.reddit.com/r/voidlinux/comments/jq1zh5/sudo_command_file_name_too_long/
and here with a possible solution: "I removed everything out of .config/fish except my config.fish, and sudo started working again."
https://forum.manjaro.org/t/all-sudo-command-give-me-an-file-name-is-too-long-error/31702/14

Re: Cannot use sudo at all, reports 'File name too long'.

Reply #5
Are you using fish shell, or do you have it installed? Searching about for recent similar problems, there's something here which mentions fish:
https://www.reddit.com/r/voidlinux/comments/jq1zh5/sudo_command_file_name_too_long/
and here with a possible solution: "I removed everything out of .config/fish except my config.fish, and sudo started working again."
https://forum.manjaro.org/t/all-sudo-command-give-me-an-file-name-is-too-long-error/31702/14
Oh wow... I'd never think my shell could be causing the issue.
chsh'd to bash, relogined and now I'm able to use sudo again.

Looking for the culprit, I found this line in my .config/fish/fish_variables:
Code: [Select]
SETUVAR --export fish_user_paths:/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x1e/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin\x20/home/haibane/\x2epyenv/bin
Which is indeed pretty damn long. Commenting it out resolved the issue.

Thank you for the help! I really should've checked other forums before creating another thread about this.
I've tried using bash before and the issue was still present - guess I had to explicitly chsh.

 

Re: [SOLVED] Cannot use sudo at all, reports 'File name too long'.

Reply #6
Seems like pyenv's fish implementation is rather poor - it was adding '/home/haibane/\x2epyenv/bin\x1e' every time I opened a new terminal. I've commented out the pyenv stuff in config.fish and installed this instead - https://github.com/daenney/pyenv - now everything is fine and dandy. Thank you again.