auto_backup
auto_backup copied to clipboard
missing pysftp error breaks Odoo website
Using Odoo v9 free and the 9.0 branch on a clean Debian Stretch x64 install, I forgot to install the pysftp module and then wondered why the web page was screwed up, no CSS and other resources were found.
Then I discovered this error in the log, and after installing pysftp, everything was back to normal (phew):
File "/usr/lib/python2.7/dist-packages/openerp/addons/auto_backup/backup_scheduler.py", line 35, in <module>
raise ImportError('This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)')
ImportError: This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)
This user error really shouldn't break the web site, but instead just logged as a normal error, also right on the auto-backup config-page:
Hi @grexe,
Didn't you get a dialog in the beginning when installing this module? By default it should throw up a dialog in Odoo notifying you that you should install PySFTP on your computer first. See these lines: https://github.com/Yenthe666/auto_backup/blob/8.0/auto_backup/backup_scheduler.py#L30-L33
No @Yenthe666, I followed the docs and checked out the git repo, installing via console, not the web UI.
I know it's a user error, but that shouldn't break the server in such a way that it doesn't start up... maybe a Odoo/platform issue even?
@grexe interesting. If you install a module from the console I assume that the warning is not thrown while there is an issue. I always install mine through the GUI so I've never noticed.. I don't know a quick fix out of the head for this though.
@grexe could you please apply this pull request (https://github.com/Yenthe666/auto_backup/pull/39) and test this? This should show you a neat warning in the terminal too if I'm not mistaking.
@Yenthe666 I have the same problem. In a fresh install, I have not installed pysftp, then I have updated the modules list, and I have not installed auto-backup. Now, I have restarted Odoo. At this point, Odoo tries to import your module, even if it is not installed, so it crashes. I really think you should avoid "raise ImportError", as suggested here https://stackoverflow.com/questions/42643698