Progress, installed PIO into a virtual environment and gave it all to the www-data user and now it executes but throws another permission denied exception internally, at least now there’s a stack trace
Build Failed, code 1
PermissionError: Traceback (most recent call last):
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/__main__.py", line 103, in main
cli() # pylint: disable=no-value-for-parameter
^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/cli.py", line 85, in invoke
return super().invoke(ctx)
^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/__main__.py", line 56, in cli
maintenance.on_cmd_start(ctx, caller)
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/maintenance.py", line 35, in on_cmd_start
telemetry.on_cmd_start(ctx)
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/telemetry.py", line 173, in on_cmd_start
log_command(cmd_ctx)
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/telemetry.py", line 186, in log_command
log_event("cmd_run", params)
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/telemetry.py", line 168, in log_event
TelemetryLogger().log_event(name, params, instant_sending=instant_sending)
^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/util.py", line 132, in get_instance
_instances[cls] = cls(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/telemetry.py", line 78, in __init__
self._http_session = HTTPSession()
^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/http.py", line 52, in __init__
self.headers.update({"User-Agent": app.get_user_agent()})
^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 277, in get_user_agent
if not get_setting("enable_telemetry"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 208, in get_setting
with State() as state:
^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 88, in __init__
self.path = resolve_state_path("core_dir", "appstate.json")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 79, in resolve_state_path
os.makedirs(state_dir)
File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/var/www/.platformio'
============================================================
An unexpected error occurred. Further steps:
* Verify that you have the latest version of PlatformIO using
`python -m pip install -U platformio` command
* Try to find answer in FAQ Troubleshooting section
https://docs.platformio.org/page/faq/index.html
* Report this problem to the developers
https://github.com/platformio/platformio-core/issues
============================================================
Traceback (most recent call last):
File "/var/www/private/piovenv/piovenv/bin/pio", line 8, in <module>
sys.exit(main())
^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/__main__.py", line 134, in main
maintenance.on_platformio_exit()
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/maintenance.py", line 65, in on_platformio_exit
telemetry.on_exit()
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/telemetry.py", line 177, in on_exit
TelemetryLogger().send()
^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/util.py", line 132, in get_instance
_instances[cls] = cls(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/telemetry.py", line 78, in __init__
self._http_session = HTTPSession()
^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/http.py", line 52, in __init__
self.headers.update({"User-Agent": app.get_user_agent()})
^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 277, in get_user_agent
if not get_setting("enable_telemetry"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 208, in get_setting
with State() as state:
^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 88, in __init__
self.path = resolve_state_path("core_dir", "appstate.json")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 79, in resolve_state_path
os.makedirs(state_dir)
File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/var/www/.platformio'
Exception ignored in atexit callback: <function _finalize at 0x767d8bd73e20>
Traceback (most recent call last):
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/telemetry.py", line 313, in _finalize
telemetry = TelemetryLogger()
^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/util.py", line 132, in get_instance
_instances[cls] = cls(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/telemetry.py", line 78, in __init__
self._http_session = HTTPSession()
^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/http.py", line 52, in __init__
self.headers.update({"User-Agent": app.get_user_agent()})
^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 277, in get_user_agent
if not get_setting("enable_telemetry"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 208, in get_setting
with State() as state:
^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 88, in __init__
self.path = resolve_state_path("core_dir", "appstate.json")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/private/piovenv/piovenv/lib/python3.12/site-packages/platformio/app.py", line 79, in resolve_state_path
os.makedirs(state_dir)
File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/var/www/.platformio'
Is this because it has no permissions in creating a directory at “/var/www/.platformio”? why is it doing that? it makes no sense according to where the virtual environment is and where the repository is.