lfd / PaStA

The Patch Stack Analysis
GNU General Public License v2.0
33 stars 20 forks source link

Error: process_mail.sh failed, probably due to long pathnames #16

Closed bulwahn closed 5 years ago

bulwahn commented 5 years ago

When processing a raw mailbox, the process_mail.sh script fails:

2019-03-15 06:29:14,943 Repository.Mbox INFO     Processing raw mailbox gmail-export
./process_mail.sh: line 43: $MAIL: ambiguous redirect
Unable to parse Message ID for : empty Message-ID
xargs: ./process_mail.sh: exited with status 255; aborting
2019-03-15 06:29:15,244 Repository.Mbox INFO     Executing ./process_mailbox_maildir.sh gmail-export /home/lukas/repositories/github.com/lfd/PaStA/resources/linux/resources/mbox/ /home/lukas/mbox-archives/latest 
2019-03-15 06:29:15,245 Repository.Mbox ERROR    Mail processor failed!

My first investigation showed that this issue only appears when called in my setup with a quite deep path, namely /home/lukas/repositories/github.com/lfd/PaStAresources/linux/resources/mbox/raw, but the issue does not appear when executing the same command with the same input data on a shorter path as /home/lukas/tmp.

Probably we are hitting here the limit of passing a command in bash that is larger than 127 characters and hence, we need to take some special care to actually get the arguments properly, alternatively the needed values could simply be passed by shell environment variables to the script.

rralf commented 5 years ago

Hi,

I tried to reproduce it with a very long filename, and looks like it works for me. So that's not the issue.

The path /home/lukas/mbox-archives/latest is a symlink and not the mailbox file, right? Shouldn't this point to the mailbox file /home/lukas/mbox-archives/latest/mbox?

I just tried to erroneously point to a symlink: yep, that seems to be the issue.

There are already some checks in python that check permissions and existence, but none pointing to raw symlinks instead of a mailbox file...

Nevertheless, mailbox files inside directories with symlinks generally do work, so you probably just need to append /mbox.

Thanks Ralf

bulwahn commented 5 years ago

Okay, so then when I reproduced it, I actually "fixed" the problem without seeing it and was so surprised that I thought it must have been the long pathname. I will fix my config, rerun pasta and if successful, close this issue.

bulwahn commented 5 years ago

So after fixing the config file, it did work as expected. We can consider this as a non-bug and close it.