ad-si / Transity

Keep track of your 💵, 🕘, 🐖, 🐄, 🍻 on your command line with the plain text accounting tool of the future! 🚀
https://ad-si.github.io/Transity/
GNU Affero General Public License v3.0
635 stars 17 forks source link

Error: EXDEV: cross-device link not permitted #32

Open mordax7 opened 4 years ago

mordax7 commented 4 years ago

Description: The tempy library uses rename to move the files under Linux. In this https://github.com/feramhq/transity/blob/master/scripts/transactions/hypovereinsbank.js#L156 case it moves the downloaded csv from the ~/Download/... directory to the temporary directory. This caused an error because of:

EXDEV oldpath and newpath are not on the same mounted filesystem. (Linux permits a filesystem to be mounted at multiple points, but rename() does not work across different mount points, even if the same filesystem is mounted on both.)

For more, see man rename manpage:

Log:

Open https://my.hypovereinsbank.de/login?view=/de/login.jsp
Log in
Go to transactions page
Enter range 2020-06-24 to 2020-09-12
Download CSV file to /tmp/28ccc30ea3fa35728eac46a9c4dd7e62/hypovereinsbank-transactions.csv
Nightmare runner error:

    Error: EXDEV: cross-device link not permitted, rename '/home/DEDUCTED/Downloads/15620204_Umsatzliste.csv' -> '/tmp/28ccc30ea3fa35728eac46a9c4dd7e62/hypovereinsbank-transactions.csv'
       at Object.fs.renameSync (fs.js:772:18)
       at DownloadItem.eval (eval at <anonymous> (/home/DEDUCTED/.work/github/public/transity/node_modules/nightmare/lib/runner.js:543:14), <anonymous>:43:22)
       at emitTwo (events.js:125:13)
       at DownloadItem.emit (events.js:213:7)

Workaround: I changed the filePathTemp to a path which was on the same partition as from where I ran the script.

ad-si commented 4 years ago

Can you maybe repost the issue at https://github.com/sindresorhus/tempy/issues? This would be the correct place to fix this I think.