Skip to content

[Bug] Install failure using deploy script in Debian LXC - database encryption relatedΒ #417

@tgmct

Description

@tgmct

Hey there! πŸ‘‹ Thanks for taking the time to report this bug β€” we appreciate it!

Please keep in mind: PegaProx is developed and maintained entirely by volunteers in our free time. We do our best, but we can't work magic πŸͺ„ β€” please be patient, we'll get to your issue as soon as we can.

Want to help keep PegaProx alive?

  • ⭐ Star the project β€” it's free and helps a lot!
  • πŸ’– Become a Sponsor β€” helps us dedicate more time to development
  • 🀝 Contributing code or docs is always welcome too!

Describe the bug

The result of performing an installation using the curl deploy script in a Debian LXC container is that the service FAILS to start.

Steps to Reproduce

  1. curl -sSL https://raw.githubusercontent.com/PegaProx/project-pegaprox/refs/heads/main/deploy.sh | sudo bash
  2. select option 2 - 443 access

Expected behavior

start process at end of installation

Environment

  • PegaProx Version: unknown - does NOT start
  • Installation Method: see steps to reproduce
  • OS: Debian LXC (13)
  • Browser: n/a
  • Behind Reverse Proxy? n/a
  • UI? n/a

Logs

journalctl -u pegaprox -f
May 14 17:02:09 pegaprox5 pegaprox[3319]: ~~~~~~~~~^^
May 14 17:02:09 pegaprox5 pegaprox[3319]: File "/usr/lib/python3.13/pathlib/_abc.py", line 482, in is_file
May 14 17:02:09 pegaprox5 pegaprox[3319]: return S_ISREG(self.stat(follow_symlinks=follow_symlinks).st_mode)
May 14 17:02:09 pegaprox5 pegaprox[3319]: ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 14 17:02:09 pegaprox5 pegaprox[3319]: File "/usr/lib/python3.13/pathlib/_local.py", line 517, in stat
May 14 17:02:09 pegaprox5 pegaprox[3319]: return os.stat(self, follow_symlinks=follow_symlinks)
May 14 17:02:09 pegaprox5 pegaprox[3319]: ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 14 17:02:09 pegaprox5 pegaprox[3319]: PermissionError: [Errno 13] Permission denied: '/etc/pegaprox/secret.key'
May 14 17:02:09 pegaprox5 systemd[1]: pegaprox.service: Main process exited, code=exited, status=1/FAILURE
May 14 17:02:09 pegaprox5 systemd[1]: pegaprox.service: Failed with result 'exit-code'.
May 14 17:02:14 pegaprox5 systemd[1]: pegaprox.service: Scheduled restart job, restart counter is at 214.
May 14 17:02:14 pegaprox5 systemd[1]: Started pegaprox.service - PegaProx - Proxmox Cluster Management.
May 14 17:02:14 pegaprox5 pegaprox[3324]: [DBCRYPTO] plain DB detected at /opt/PegaProx/config/pegaprox.db β€” auto-encrypting before first connection. This is a one-time operation.
May 14 17:02:14 pegaprox5 pegaprox[3324]: [DBCRYPTO] auto-encrypt check failed: [Errno 13] Permission denied: '/etc/pegaprox/secret.key'
May 14 17:02:14 pegaprox5 pegaprox[3324]: Traceback (most recent call last):
May 14 17:02:14 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/app.py", line 702, in main
May 14 17:02:14 pegaprox5 pegaprox[3324]: _r = _dbcrypto.ensure_db_encrypted(_db_path)
May 14 17:02:14 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/dbcrypto.py", line 200, in ensure_db_encrypted
May 14 17:02:14 pegaprox5 pegaprox[3324]: result = _run_inline_migration(db_path)
May 14 17:02:14 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/dbcrypto.py", line 243, in _run_inline_migration
May 14 17:02:14 pegaprox5 pegaprox[3324]: mk = load_master_key()
May 14 17:02:14 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/keystore.py", line 85, in load_master_key
May 14 17:02:14 pegaprox5 pegaprox[3324]: _CACHED = _resolve()
May 14 17:02:14 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/keystore.py", line 146, in _resolve
May 14 17:02:14 pegaprox5 pegaprox[3324]: if p.is_file():
May 14 17:02:14 pegaprox5 pegaprox[3324]: ~~~~~~~~~^^
May 14 17:02:14 pegaprox5 pegaprox[3324]: File "/usr/lib/python3.13/pathlib/_abc.py", line 482, in is_file
May 14 17:02:14 pegaprox5 pegaprox[3324]: return S_ISREG(self.stat(follow_symlinks=follow_symlinks).st_mode)
May 14 17:02:14 pegaprox5 pegaprox[3324]: ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 14 17:02:14 pegaprox5 pegaprox[3324]: File "/usr/lib/python3.13/pathlib/_local.py", line 517, in stat
May 14 17:02:14 pegaprox5 pegaprox[3324]: return os.stat(self, follow_symlinks=follow_symlinks)
May 14 17:02:14 pegaprox5 pegaprox[3324]: ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 14 17:02:14 pegaprox5 pegaprox[3324]: PermissionError: [Errno 13] Permission denied: '/etc/pegaprox/secret.key'
May 14 17:02:14 pegaprox5 pegaprox[3324]: Error loading server settings from database: [Errno 13] Permission denied: '/etc/pegaprox/secret.key'
May 14 17:02:15 pegaprox5 pegaprox[3324]: [push] inbox table ensure failed: [Errno 13] Permission denied: '/etc/pegaprox/secret.key'
May 14 17:02:15 pegaprox5 pegaprox[3324]: Gevent monkey-patching applied
May 14 17:02:15 pegaprox5 pegaprox[3324]: [ws-patch] simple-websocket PerMessageDeflate disabled
May 14 17:02:15 pegaprox5 pegaprox[3324]: Checking optional libraries...
May 14 17:02:15 pegaprox5 pegaprox[3324]: βœ“ websockets (VNC/SSH console)
May 14 17:02:15 pegaprox5 pegaprox[3324]: βœ“ paramiko (SSH features)
May 14 17:02:15 pegaprox5 pegaprox[3324]: βœ“ gevent (high performance)
May 14 17:02:15 pegaprox5 pegaprox[3324]: βœ“ argon2-cffi (secure password hashing)
May 14 17:02:15 pegaprox5 pegaprox[3324]: βœ“ XenAPI (XCP-ng integration)
May 14 17:02:15 pegaprox5 pegaprox[3324]: Traceback (most recent call last):
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox_multi_cluster.py", line 228, in
May 14 17:02:15 pegaprox5 pegaprox[3324]: main(debug_mode=debug_mode)
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~^^^^^^^^^^^^^^^^^^^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/app.py", line 717, in main
May 14 17:02:15 pegaprox5 pegaprox[3324]: app = create_app()
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/app.py", line 340, in create_app
May 14 17:02:15 pegaprox5 pegaprox[3324]: load_enabled_plugins(app)
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~~~~~~~~~~~~~~~~~^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/api/plugins.py", line 225, in load_enabled_plugins
May 14 17:02:15 pegaprox5 pegaprox[3324]: states = _get_plugin_states()
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/api/plugins.py", line 120, in _get_plugin_states
May 14 17:02:15 pegaprox5 pegaprox[3324]: db = get_db()
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/db.py", line 4111, in get_db
May 14 17:02:15 pegaprox5 pegaprox[3324]: _db = PegaProxDB()
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/db.py", line 88, in init
May 14 17:02:15 pegaprox5 pegaprox[3324]: self._init_db()
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~~~~~~~~~~^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/db.py", line 196, in _init_db
May 14 17:02:15 pegaprox5 pegaprox[3324]: conn = self.conn
May 14 17:02:15 pegaprox5 pegaprox[3324]: ^^^^^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/db.py", line 188, in conn
May 14 17:02:15 pegaprox5 pegaprox[3324]: return self._get_connection()
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~~~~~~~~~~~~~~~~~^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/db.py", line 172, in _get_connection
May 14 17:02:15 pegaprox5 pegaprox[3324]: self._local.conn = dbcrypto.connect(
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~~~~~~~~~~~~~^
May 14 17:02:15 pegaprox5 pegaprox[3324]: self.db_path,
May 14 17:02:15 pegaprox5 pegaprox[3324]: ^^^^^^^^^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: check_same_thread=False, # We handle thread safety ourselves
May 14 17:02:15 pegaprox5 pegaprox[3324]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: timeout=30.0
May 14 17:02:15 pegaprox5 pegaprox[3324]: ^^^^^^^^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: )
May 14 17:02:15 pegaprox5 pegaprox[3324]: ^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/dbcrypto.py", line 98, in connect
May 14 17:02:15 pegaprox5 pegaprox[3324]: _apply_sqlcipher_pragmas(conn, db_path)
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/dbcrypto.py", line 112, in _apply_sqlcipher_pragmas
May 14 17:02:15 pegaprox5 pegaprox[3324]: mk = load_master_key()
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/keystore.py", line 85, in load_master_key
May 14 17:02:15 pegaprox5 pegaprox[3324]: _CACHED = _resolve()
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/opt/PegaProx/pegaprox/core/keystore.py", line 146, in _resolve
May 14 17:02:15 pegaprox5 pegaprox[3324]: if p.is_file():
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~~~~~~^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/usr/lib/python3.13/pathlib/_abc.py", line 482, in is_file
May 14 17:02:15 pegaprox5 pegaprox[3324]: return S_ISREG(self.stat(follow_symlinks=follow_symlinks).st_mode)
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: File "/usr/lib/python3.13/pathlib/_local.py", line 517, in stat
May 14 17:02:15 pegaprox5 pegaprox[3324]: return os.stat(self, follow_symlinks=follow_symlinks)
May 14 17:02:15 pegaprox5 pegaprox[3324]: ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 14 17:02:15 pegaprox5 pegaprox[3324]: PermissionError: [Errno 13] Permission denied: '/etc/pegaprox/secret.key'
May 14 17:02:15 pegaprox5 systemd[1]: pegaprox.service: Main process exited, code=exited, status=1/FAILURE
May 14 17:02:15 pegaprox5 systemd[1]: pegaprox.service: Failed with result 'exit-code'.


Screenshots

Checklist

  • I have searched existing issues to make sure this is not a duplicate
  • I am using the latest version of PegaProx

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions