Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer fails to unlink file for postwhite #524

Open
fbfeix opened this issue Oct 22, 2023 · 2 comments
Open

Installer fails to unlink file for postwhite #524

fbfeix opened this issue Oct 22, 2023 · 2 comments
Labels

Comments

@fbfeix
Copy link

fbfeix commented Oct 22, 2023

Impacted versions

  • Distribution: Ubuntu
  • Codename: Jammy Jellyfish 22.04.3 LTS
  • Arch: 64 Bits
  • Database: not applicable
  • Python 3.10.12

Steps to reproduce

Just running the installer on a clean install of Ubuntu 22.04.3 with Python 3.10.12 on revision 4a2e9f2. It is not an upgrade but the very first execution of the installer.

Full trace using --debug option or current behaviour

Traceback (most recent call last):
  File "/root/modoboa-installer/run.py", line 282, in <module>
    main(sys.argv[1:])
  File "/root/modoboa-installer/run.py", line 266, in main
    scripts.install(appname, config, args.upgrade, args.restore)
  File "/root/modoboa-installer/modoboa_installer/scripts/__init__.py", line 29, in install
    getattr(script, appname.capitalize())(config, upgrade, archive_path).run()
  File "/root/modoboa-installer/modoboa_installer/scripts/base.py", line 206, in run
    self.post_run()
  File "/root/modoboa-installer/modoboa_installer/scripts/postfix.py", line 100, in post_run
    install("postwhite", self.config, self.upgrade, self.archive_path)
  File "/root/modoboa-installer/modoboa_installer/scripts/__init__.py", line 29, in install
    getattr(script, appname.capitalize())(config, upgrade, archive_path).run()
  File "/root/modoboa-installer/modoboa_installer/scripts/base.py", line 206, in run
    self.post_run()
  File "/root/modoboa-installer/modoboa_installer/scripts/postwhite.py", line 47, in post_run
    self.install_from_archive(SPF_TOOLS_REPOSITORY, install_dir)
  File "/root/modoboa-installer/modoboa_installer/scripts/postwhite.py", line 41, in install_from_archive
    os.unlink(target)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/master.zip'

Expected behavior

Should install postwhite without problems. Unlinking should be successful on a clean ubuntu.

fbfeix pushed a commit to fbfeix/modoboa-installer that referenced this issue Oct 22, 2023
…script

Added zipfile and urllib.request in 'postwhite.py' to improve the handling of archive downloads and extractions from specified repositories. Refactored 'install_from_archive' to increase the script's portability by removing the 'wget' command, improving reliability across different systems. Included robust error handling to improve user experience and problem diagnosis in case of download or extraction failures.
fbfeix pushed a commit to fbfeix/modoboa-installer that referenced this issue Oct 22, 2023
@tonioo
Copy link
Member

tonioo commented Nov 23, 2023

@fbfeix I see you're working on a fix for that issue. Do you think you could create a PR soon for that?

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale label Mar 13, 2024
@stale stale bot closed this as completed Apr 22, 2024
@tonioo tonioo reopened this Apr 22, 2024
@stale stale bot removed the stale Stale label Apr 22, 2024
@tonioo tonioo added bug stale Stale labels Apr 22, 2024
@stale stale bot removed the stale Stale label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants