frappe / press

Full service cloud hosting for the Frappe stack - powers Frappe Cloud
https://frappe.cloud
GNU Affero General Public License v3.0
279 stars 195 forks source link

Unable to obtain TLS certificate due to no file or directory or at times permissions #2266

Open tkayage opened 2 weeks ago

tkayage commented 2 weeks ago

I am using Press on a docker dev container setup. I tried to mount a new directory via volume which the frappe user has all the rights to write to this directory however i still get no file or directory. I haven't seen a setup tutorial that uses a containerised setup on press. Please check the following stack trace.

Data: { "certificate": ".domain.com", "team": "Team(p0qv2303sj)", "user": "johndoe@gmail.com" } Exception: Traceback with variables (most recent call last): File "apps/press/press/press/doctype/tls_certificate/tls_certificate.py", line 93, in _obtain_certificate ) = ca.obtain( self = <TLSCertificate: .domain.com> settings = ca = <press.press.doctype.tls_certificate.tls_certificate.LetsEncrypt object at 0x7ffff8df2150> e = FileNotFoundError(2, 'No such file or directory') File "apps/press/press/press/doctype/tls_certificate/tls_certificate.py", line 319, in obtain self._obtain() self = <press.press.doctype.tls_certificate.tls_certificate.LetsEncrypt object at 0x7ffff8df2150> domain = 'domain.com' rsa_key_size = **** wildcard = 1 File "apps/press/press/press/doctype/tls_certificate/tls_certificate.py", line 356, in _obtain self._obtain_wildcard() self = <press.press.doctype.tls_certificate.tls_certificate.LetsEncrypt object at 0x7ffff8df2150> File "apps/press/press/press/doctype/tls_certificate/tls_certificate.py", line 372, in _obtain_wildcard self.run(self._certbot_command(), environment=environment) self = <press.press.doctype.tls_certificate.tls_certificate.LetsEncrypt object at 0x7ffff8df2150> domain = environment = environ({'NODE_VERSION': '18.18.2', 'HOSTNAME': '8850f82a6b9b', 'GIT_ASKPASS': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass.sh', 'NODE_VERSION_14': '16.20.2', 'SHLVL': '2', 'BROWSER': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/helpers/browser.sh', 'DEV_SERVER': 'true', 'HOME': '/home/frappe', 'OLDPWD': 'sites', 'PORT': '5400', 'TERM_PROGRAM_VERSION': '1.95.0', 'NVM_BIN': '/home/frappe/.nvm/versions/node/v18.18.2/bin', 'VSCODE_IPC_HOOK_CLI': '/tmp/vscode-ipc-3c8fe717-b7e0-4f9c-aa38-aa5a3b7e5ade.sock', 'PYENV_SHELL': 'rosetta', 'NVM_INC': '/home/frappe/.nvm/versions/node/v18.18.2/include/node', 'PYTHONUNBUFFERED': 'true', 'HONCHO_PROCESS_NAME': 'worker.1', 'VSCODE_GIT_ASKPASS_MAIN': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass-main.js', 'PS1': '\[\x1b]633;A\x07\](env) \[\e]0;\u@\h: \w\a... File "apps/press/press/press/doctype/tls_certificate/tls_certificate.py", line 424, in run raise e self = <press.press.doctype.tls_certificate.tls_certificate.LetsEncrypt object at 0x7ffff8df2150> command = 'certbot certonly --dns-route53 --logs-dir /workspace/logs --work-dir /workspace --config-dir /workspace --force-renewal --agree-tos --eff-email --email johndoe@gmail.com --staple-ocsp --key-type rsa --rsa-key-size 2048 --cert-name .domain.com --domains .domain.com' environment = environ({'NODE_VERSION': '18.18.2', 'HOSTNAME': '8850f82a6b9b', 'GIT_ASKPASS': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass.sh', 'NODE_VERSION_14': '16.20.2', 'SHLVL': '2', 'BROWSER': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/helpers/browser.sh', 'DEV_SERVER': 'true', 'HOME': '/home/frappe', 'OLDPWD': 'sites', 'PORT': '5400', 'TERM_PROGRAM_VERSION': '1.95.0', 'NVM_BIN': '/home/frappe/.nvm/versions/node/v18.18.2/bin', 'VSCODE_IPC_HOOK_CLI': '/tmp/vscode-ipc-3c8fe717-b7e0-4f9c-aa38-aa5a3b7e5ade.sock', 'PYENV_SHELL': 'rosetta', 'NVM_INC': '/home/frappe/.nvm/versions/node/v18.18.2/include/node', 'PYTHONUNBUFFERED': 'true', 'HONCHO_PROCESS_NAME': 'worker.1', 'VSCODE_GIT_ASKPASS_MAIN': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass-main.js', 'PS1': '\[\x1b]633;A\x07\](env) \[\e]0;\u@\h: \w\a... File "apps/press/press/press/doctype/tls_certificate/tls_certificate.py", line 414, in run subprocess.check_output( self = <press.press.doctype.tls_certificate.tls_certificate.LetsEncrypt object at 0x7ffff8df2150> command = 'certbot certonly --dns-route53 --logs-dir /workspace/logs --work-dir /workspace --config-dir /workspace --force-renewal --agree-tos --eff-email --email johndoe@gmail.com --staple-ocsp --key-type rsa --rsa-key-size 2048 --cert-name .domain.com --domains .domain.com' environment = environ({'NODE_VERSION': '18.18.2', 'HOSTNAME': '8850f82a6b9b', 'GIT_ASKPASS': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass.sh', 'NODE_VERSION_14': '16.20.2', 'SHLVL': '2', 'BROWSER': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/helpers/browser.sh', 'DEV_SERVER': 'true', 'HOME': '/home/frappe', 'OLDPWD': 'sites', 'PORT': '5400', 'TERM_PROGRAM_VERSION': '1.95.0', 'NVM_BIN': '/home/frappe/.nvm/versions/node/v18.18.2/bin', 'VSCODE_IPC_HOOK_CLI': '/tmp/vscode-ipc-3c8fe717-b7e0-4f9c-aa38-aa5a3b7e5ade.sock', 'PYENV_SHELL': 'rosetta', 'NVM_INC': '/home/frappe/.nvm/versions/node/v18.18.2/include/node', 'PYTHONUNBUFFERED': 'true', 'HONCHO_PROCESS_NAME': 'worker.1', 'VSCODE_GIT_ASKPASS_MAIN': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass-main.js', 'PS1': '\[\x1b]633;A\x07\](env) \[\e]0;\u@\h: \w\a... File "/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 466, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, timeout = None popenargs = (['certbot', 'certonly', '--dns-route53', '--logs-dir', '/workspace/logs', '--work-dir', '/workspace', '--config-dir', '/workspace', '--force-renewal', '--agree-tos', '--eff-email', '--email', 'johndoe@gmail.com', '--staple-ocsp', '--key-type', 'rsa', '--rsa-key-size', '2048', '--cert-name', '.domain.com', '--domains', '.domain.com'],) kwargs = {'stderr': -2, 'env': environ({'NODE_VERSION': '18.18.2', 'HOSTNAME': '8850f82a6b9b', 'GIT_ASKPASS': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass.sh', 'NODE_VERSION_14': '16.20.2', 'SHLVL': '2', 'BROWSER': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/helpers/browser.sh', 'DEV_SERVER': 'true', 'HOME': '/home/frappe', 'OLDPWD': 'sites', 'PORT': '5400', 'TERM_PROGRAM_VERSION': '1.95.0', 'NVM_BIN': '/home/frappe/.nvm/versions/node/v18.18.2/bin', 'VSCODE_IPC_HOOK_CLI': '/tmp/vscode-ipc-3c8fe717-b7e0-4f9c-aa38-aa5a3b7e5ade.sock', 'PYENV_SHELL': 'rosetta', 'NVM_INC': '/home/frappe/.nvm/versions/node/v18.18.2/include/node', 'PYTHONUNBUFFERED': 'true', 'HONCHO_PROCESS_NAME': 'worker.1', 'VSCODE_GIT_ASKPASS_MAIN': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass-main.js', 'PS1': '\[\x1b]633;A\x07\](env) \... kw = 'check' File "/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 548, in run with Popen(popenargs, *kwargs) as process: input = None capture_output = False timeout = None check = True popenargs = (['certbot', 'certonly', '--dns-route53', '--logs-dir', '/workspace/logs', '--work-dir', '/workspace', '--config-dir', '/workspace', '--force-renewal', '--agree-tos', '--eff-email', '--email', 'johndoe@gmail.com', '--staple-ocsp', '--key-type', 'rsa', '--rsa-key-size', '2048', '--cert-name', '.domain.com', '--domains', '.domain.com'],) kwargs = {'stdout': -1, 'stderr': -2, 'env': environ({'NODE_VERSION': '18.18.2', 'HOSTNAME': '8850f82a6b9b', 'GIT_ASKPASS': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass.sh', 'NODE_VERSION_14': '16.20.2', 'SHLVL': '2', 'BROWSER': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/helpers/browser.sh', 'DEV_SERVER': 'true', 'HOME': '/home/frappe', 'OLDPWD': 'sites', 'PORT': '5400', 'TERM_PROGRAM_VERSION': '1.95.0', 'NVM_BIN': '/home/frappe/.nvm/versions/node/v18.18.2/bin', 'VSCODE_IPC_HOOK_CLI': '/tmp/vscode-ipc-3c8fe717-b7e0-4f9c-aa38-aa5a3b7e5ade.sock', 'PYENV_SHELL': 'rosetta', 'NVM_INC': '/home/frappe/.nvm/versions/node/v18.18.2/include/node', 'PYTHONUNBUFFERED': 'true', 'HONCHO_PROCESS_NAME': 'worker.1', 'VSCODE_GIT_ASKPASS_MAIN': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass-main.js', 'PS1': '\[\x1b]633;A... File "/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, self = <Popen: returncode: 255 args: ['certbot', 'certonly', '--dns-route53', '--lo...> args = ['certbot', 'certonly', '--dns-route53', '--logs-dir', '/workspace/logs', '--work-dir', '/workspace', '--config-dir', '/workspace', '--force-renewal', '--agree-tos', '--eff-email', '--email', 'johndoe@gmail.com', '--staple-ocsp', '--key-type', 'rsa', '--rsa-key-size', '2048', '--cert-name', '.domain.com', '--domains', '.domain.com'] bufsize = -1 executable = None stdin = None stdout = -1 stderr = -2 preexec_fn = None close_fds = True shell = False cwd = None env = environ({'NODE_VERSION': '18.18.2', 'HOSTNAME': '8850f82a6b9b', 'GIT_ASKPASS': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass.sh', 'NODE_VERSION_14': '16.20.2', 'SHLVL': '2', 'BROWSER': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/helpers/browser.sh', 'DEV_SERVER': 'true', 'HOME': '/home/frappe', 'OLDPWD': 'sites', 'PORT': '5400', 'TERM_PROGRAM_VERSION': '1.95.0', 'NVM_BIN': '/home/frappe/.nvm/versions/node/v18.18.2/bin', 'VSCODE_IPC_HOOK_CLI': '/tmp/vscode-ipc-3c8fe717-b7e0-4f9c-aa38-aa5a3b7e5ade.sock', 'PYENV_SHELL': 'rosetta', 'NVM_INC': '/home/frappe/.nvm/versions/node/v18.18.2/include/node', 'PYTHONUNBUFFERED': 'true', 'HONCHO_PROCESS_NAME': 'worker.1', 'VSCODE_GIT_ASKPASS_MAIN': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass-main.js', 'PS1': '\[\x1b]633;A\x07\](env) \[\e]0;\u@\h: \w\a... universal_newlines = None startupinfo = None creationflags = 0 restore_signals = True start_new_session = False pass_fds = () user = None group = None extra_groups = None encoding = None errors = None text = None umask = -1 pipesize = -1 process_group = -1 gid = None gids = None uid = None p2cread = -1 p2cwrite = -1 c2pread = 18 c2pwrite = 19 errread = -1 errwrite = 19 f = <_io.BufferedReader name=18> File "/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 1950, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) self = <Popen: returncode: 255 args: ['certbot', 'certonly', '--dns-route53', '--lo...> args = ['certbot', 'certonly', '--dns-route53', '--logs-dir', '/workspace/logs', '--work-dir', '/workspace', '--config-dir', '/workspace', '--force-renewal', '--agree-tos', '--eff-email', '--email', 'johndoe@gmail.com', '--staple-ocsp', '--key-type', 'rsa', '--rsa-key-size', '2048', '--cert-name', '.domain.com', '--domains', '*.domain.com'] executable = b'certbot' preexec_fn = None close_fds = True pass_fds = () cwd = None env = environ({'NODE_VERSION': '18.18.2', 'HOSTNAME': '8850f82a6b9b', 'GIT_ASKPASS': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass.sh', 'NODE_VERSION_14': '16.20.2', 'SHLVL': '2', 'BROWSER': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/helpers/browser.sh', 'DEV_SERVER': 'true', 'HOME': '/home/frappe', 'OLDPWD': 'sites', 'PORT': '5400', 'TERM_PROGRAM_VERSION': '1.95.0', 'NVM_BIN': '/home/frappe/.nvm/versions/node/v18.18.2/bin', 'VSCODE_IPC_HOOK_CLI': '/tmp/vscode-ipc-3c8fe717-b7e0-4f9c-aa38-aa5a3b7e5ade.sock', 'PYENV_SHELL': 'rosetta', 'NVM_INC': '/home/frappe/.nvm/versions/node/v18.18.2/include/node', 'PYTHONUNBUFFERED': 'true', 'HONCHO_PROCESS_NAME': 'worker.1', 'VSCODE_GIT_ASKPASS_MAIN': '/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass-main.js', 'PS1': '\[\x1b]633;A\x07\](env) \[\e]0;\u@\h: \w\a... startupinfo = None creationflags = 0 shell = False p2cread = -1 p2cwrite = -1 c2pread = 18 c2pwrite = 19 errread = -1 errwrite = 19 restore_signals = True gid = None gids = None uid = None umask = -1 start_new_session = False process_group = -1 orig_executable = 'certbot' errpipe_read = 20 errpipe_write = 21 low_fds_to_close = [] env_list = b'NODE_VERSION=18.18.2', b'HOSTNAME=8850f82a6b9b', b'GIT_ASKPASS=/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass.sh', b'NODE_VERSION_14=16.20.2', b'SHLVL=2', b'BROWSER=/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/helpers/browser.sh', b'DEV_SERVER=true', b'HOME=/home/frappe', b'OLDPWD=sites', b'PORT=5400', b'TERM_PROGRAM_VERSION=1.95.0', b'NVM_BIN=/home/frappe/.nvm/versions/node/v18.18.2/bin', b'VSCODE_IPC_HOOK_CLI=/tmp/vscode-ipc-3c8fe717-b7e0-4f9c-aa38-aa5a3b7e5ade.sock', b'PYENV_SHELL=rosetta', b'NVM_INC=/home/frappe/.nvm/versions/node/v18.18.2/include/node', b'PYTHONUNBUFFERED=true', b'HONCHO_PROCESS_NAME=worker.1', b'VSCODE_GIT_ASKPASS_MAIN=/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/extensions/git/dist/askpass-main.js', b'PS1=\[\x1b]633;A\x07\ \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[... k = b'AWS_SECRET_ACCESS_KEY' v = 'XXXXXXXXXXXXXXXXXXXXXXXXXX' executable_list = (b'/home/frappe/.vscode-server/extensions/ms-python.python-2024.16.1-linux-x64/python_files/deactivate/bash/certbot', b'env/bin/certbot', b'/home/frappe/.local/bin/certbot', b'/home/frappe/.pyenv/shims/certbot', b'/home/frappe/.vscode-server/extensions/ms-python.python-2024.16.1-linux-x64/python_files/deactivate/bash/certbot', b'env/bin/certbot', b'/vscode/vscode-server/bin/linux-x64/912bb683695358a54ae0c670461738984cbb5b95/bin/remote-cli/certbot', b'/home/frappe/.local/bin/certbot', b'/home/frappe/.local/bin/certbot', b'/home/frappe/.pyenv/bin/certbot', b'/home/frappe/.nvm/versions/node/v18.18.2/bin/certbot', b'/home/frappe/.local/bin/certbot', b'/home/frappe/.pyenv/bin/certbot', b'/usr/local/sbin/certbot', b'/usr/local/bin/certbot', b'/usr/sbin/certbot', b'/usr/bin/certbot', b'/sbin/certbot', b'/bin/certbot') fds_to_keep = {21} errpipe_data = bytearray(b'OSError:2:') part = b'' pid = 32352 sts = 65280 exception_name = bytearray(b'OSError') hex_errno = bytearray(b'2') err_msg = 'No such file or directory' child_exception_type = <class 'OSError'> errno_num = 2 child_exec_never_called = False err_filename = 'certbot' builtins.FileNotFoundError: [Errno 2] No such file or directory: 'certbot'