docker-platformio-core icon indicating copy to clipboard operation
docker-platformio-core copied to clipboard

PermissionError

Open donutnick opened this issue 6 years ago • 9 comments

I run on gcloud-build is PermissionError

HEAD is now at 5461b4b [feat] Add blink feature BUILD Pulling image: sglahn/platformio-core:latest latest: Pulling from sglahn/platformio-core f5d23c7fed46: Pulling fs layer bac1b0ed365c: Pulling fs layer 0699bcf8d873: Pulling fs layer f306e429bf35: Pulling fs layer 4250f7263938: Pulling fs layer f9bd61bce74f: Pulling fs layer f306e429bf35: Waiting 4250f7263938: Waiting f9bd61bce74f: Waiting bac1b0ed365c: Verifying Checksum bac1b0ed365c: Download complete f5d23c7fed46: Verifying Checksum f5d23c7fed46: Download complete 0699bcf8d873: Verifying Checksum 0699bcf8d873: Download complete f306e429bf35: Verifying Checksum f306e429bf35: Download complete 4250f7263938: Verifying Checksum 4250f7263938: Download complete f9bd61bce74f: Verifying Checksum f9bd61bce74f: Download complete f5d23c7fed46: Pull complete bac1b0ed365c: Pull complete 0699bcf8d873: Pull complete f306e429bf35: Pull complete 4250f7263938: Pull complete f9bd61bce74f: Pull complete Digest: sha256:fc86e40a9f92c8d69973133de3ce9b52911018834c5aa30159815ccf2766fc6f Status: Downloaded newer image for sglahn/platformio-core:latest docker.io/sglahn/platformio-core:latest Error: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/platformio/main.py", line 88, in main cli(None, None, None) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in call return self.main(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.7/site-packages/platformio/commands/init.py", line 37, in invoke return super(PlatformioCLI, self).invoke(ctx) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1134, in invoke Command.invoke(self, ctx) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/platformio/main.py", line 36, in cli maintenance.on_platformio_start(ctx, force, caller) File "/usr/local/lib/python3.7/site-packages/platformio/maintenance.py", line 38, in on_platformio_start telemetry.on_command() File "/usr/local/lib/python3.7/site-packages/platformio/telemetry.py", line 276, in on_command resend_backuped_reports() File "/usr/local/lib/python3.7/site-packages/platformio/telemetry.py", line 417, in resend_backuped_reports tm = app.get_state_item("telemetry", {}) File "/usr/local/lib/python3.7/site-packages/platformio/app.py", line 331, in get_state_item with State() as state: File "/usr/local/lib/python3.7/site-packages/platformio/app.py", line 107, in init self.path = join(get_project_core_dir(), "appstate.json") File "/usr/local/lib/python3.7/site-packages/platformio/project/helpers.py", line 87, in get_project_core_dir raise e File "/usr/local/lib/python3.7/site-packages/platformio/project/helpers.py", line 81, in get_project_core_dir os.makedirs(core_dir) File "/usr/local/lib/python3.7/os.py", line 221, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/builder/home/.platformio'

============================================================

An unexpected error occurred. Further steps:

  • Verify that you have the latest version of PlatformIO using pip install -U platformio command

  • Try to find answer in FAQ Troubleshooting section https://docs.platformio.org/page/faq.html

  • Report this problem to the developers https://github.com/platformio/platformio-core/issues

============================================================

ERROR ERROR: build step 0 "sglahn/platformio-core:latest" failed: exit status 1

donutnick avatar Nov 17 '19 01:11 donutnick

I'm experiencing the same issue.

lorenzoromagnoli avatar Mar 31 '20 11:03 lorenzoromagnoli

The solution is to avoid using the latest version and instead specify 3.6.0 manually. It looks like breaking changes were introduced with platformio starting with version 4.0.0, this Docker image should be updated.

ceoloide avatar Apr 22 '20 02:04 ceoloide

I updated the image, sorry that it took so long. Latest is no on 4.3.4.

sglahn avatar Aug 05 '20 09:08 sglahn

Looks like this issue exists again as of release 5.0.1, which I'm pulling. Reverting didn't work for my until getting all the way back to 3.6.0, which introduced a separate error (being unable to pull from the Heltec repo, which may be out of our control here). Logs below:

Building from 5.0.1:

HEAD is now at a16885b reformat cloudbuild yaml
BUILD
Pulling image: sglahn/platformio-core:latest
latest: Pulling from sglahn/platformio-core
bb79b6b2107f: Pulling fs layer
35e30c3f3e2b: Pulling fs layer
b13c2c0e2577: Pulling fs layer
263be93302fa: Pulling fs layer
10552aaad875: Pulling fs layer
83f8d942d40f: Pulling fs layer
263be93302fa: Waiting
10552aaad875: Waiting
83f8d942d40f: Waiting
35e30c3f3e2b: Verifying Checksum
35e30c3f3e2b: Download complete
b13c2c0e2577: Verifying Checksum
b13c2c0e2577: Download complete
263be93302fa: Verifying Checksum
263be93302fa: Download complete
10552aaad875: Verifying Checksum
10552aaad875: Download complete
bb79b6b2107f: Verifying Checksum
bb79b6b2107f: Download complete
83f8d942d40f: Verifying Checksum
83f8d942d40f: Download complete
bb79b6b2107f: Pull complete
35e30c3f3e2b: Pull complete
b13c2c0e2577: Pull complete
263be93302fa: Pull complete
10552aaad875: Pull complete
83f8d942d40f: Pull complete
Digest: sha256:66a33d0b3b96763c0a07be330784be79800c9fa855a6b7fce6eafb6ca251c7e7
Status: Downloaded newer image for sglahn/platformio-core:latest
docker.io/sglahn/platformio-core:latest
Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/platformio/__main__.py", line 109, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/platformio/commands/__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/platformio/__main__.py", line 63, in cli
    maintenance.on_platformio_start(ctx, force, caller)
  File "/usr/local/lib/python3.9/site-packages/platformio/maintenance.py", line 44, in on_platformio_start
    telemetry.on_command()
  File "/usr/local/lib/python3.9/site-packages/platformio/telemetry.py", line 292, in on_command
    resend_backuped_reports()
  File "/usr/local/lib/python3.9/site-packages/platformio/telemetry.py", line 443, in resend_backuped_reports
    tm = app.get_state_item("telemetry", {})
  File "/usr/local/lib/python3.9/site-packages/platformio/app.py", line 187, in get_state_item
    with State() as state:
  File "/usr/local/lib/python3.9/site-packages/platformio/app.py", line 90, in __init__
    self.path = join(get_project_core_dir(), "appstate.json")
  File "/usr/local/lib/python3.9/site-packages/platformio/project/helpers.py", line 50, in get_project_core_dir
    return ProjectConfig.get_instance(
  File "/usr/local/lib/python3.9/site-packages/platformio/project/config.py", line 395, in get_optional_dir
    result = self._get_core_dir(exists)
  File "/usr/local/lib/python3.9/site-packages/platformio/project/config.py", line 386, in _get_core_dir
    raise e
  File "/usr/local/lib/python3.9/site-packages/platformio/project/config.py", line 380, in _get_core_dir
    os.makedirs(core_dir)
  File "/usr/local/lib/python3.9/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/builder/home/.platformio'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

ERROR
ERROR: build step 0 "sglahn/platformio-core:latest" failed: step exited with non-zero status: 1

Building from 3.6.0

BUILD
Pulling image: sglahn/platformio-core:3.6.0
3.6.0: Pulling from sglahn/platformio-core
05d1a5232b46: Pulling fs layer
5cee356eda6b: Pulling fs layer
89d3385f0fd3: Pulling fs layer
80ae6b477848: Pulling fs layer
28bdf9e584cc: Pulling fs layer
a0cd6b0afff0: Pulling fs layer
cd4c682e75b6: Pulling fs layer
fb577485a6fc: Pulling fs layer
fe6e82f9f16b: Pulling fs layer
84c2a5b1178c: Pulling fs layer
80ae6b477848: Waiting
28bdf9e584cc: Waiting
a0cd6b0afff0: Waiting
cd4c682e75b6: Waiting
fb577485a6fc: Waiting
fe6e82f9f16b: Waiting
84c2a5b1178c: Waiting
89d3385f0fd3: Verifying Checksum
89d3385f0fd3: Download complete
5cee356eda6b: Verifying Checksum
5cee356eda6b: Download complete
05d1a5232b46: Verifying Checksum
05d1a5232b46: Download complete
a0cd6b0afff0: Verifying Checksum
a0cd6b0afff0: Download complete
80ae6b477848: Verifying Checksum
80ae6b477848: Download complete
cd4c682e75b6: Verifying Checksum
cd4c682e75b6: Download complete
fb577485a6fc: Verifying Checksum
fb577485a6fc: Download complete
28bdf9e584cc: Verifying Checksum
28bdf9e584cc: Download complete
fe6e82f9f16b: Verifying Checksum
fe6e82f9f16b: Download complete
84c2a5b1178c: Verifying Checksum
84c2a5b1178c: Download complete
05d1a5232b46: Pull complete
5cee356eda6b: Pull complete
89d3385f0fd3: Pull complete
80ae6b477848: Pull complete
28bdf9e584cc: Pull complete
a0cd6b0afff0: Pull complete
cd4c682e75b6: Pull complete
fb577485a6fc: Pull complete
fe6e82f9f16b: Pull complete
84c2a5b1178c: Pull complete
Digest: sha256:56d0d10dc00243bb4eb6c7ecb40be8b0084e7e22a066d3a50741db756a89dae3
Status: Downloaded newer image for sglahn/platformio-core:3.6.0
docker.io/sglahn/platformio-core:3.6.0
********************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for IoT development > https://platformio.org/platformio-ide
- support us with PlatformIO Plus > https://pioplus.com
********************************************************************************

Processing heltec_wireless_stick (platform: espressif32; board: heltec_wifi_lora_32; framework: arduino)
--------------------------------------------------------------------------------
LibraryManager: Installing Heltec ESP32 Dev-Boards @ ^1.1.0
git version 2.11.0
Cloning into '/workspace/.piolibdeps/_tmp_installing-nDK8M0-package'...
fatal: unable to access 'https://github.com/heltecautomation/Heltec ESP32 Dev-Boards/': The requested URL returned error: 400
Error: VCS: Could not process command ['git', 'clone', '--recursive', '--depth', '1', 'https://github.com/heltecautomation/Heltec ESP32 Dev-Boards', '/workspace/.piolibdeps/_tmp_installing-nDK8M0-package']
ERROR
ERROR: build step 0 "sglahn/platformio-core:3.6.0" failed: step exited with non-zero status: 1

allen-n avatar Jan 03 '21 01:01 allen-n

Hi, Is "/builder/home/.platformio" a volume mount or is it a directory on the host machine? What are the permissions of this directory? Can you run a simple build like

docker run --rm \
    --mount type=bind,source="$(pwd)",target=/workspace \
    -u `id -u $USER`:`id -g $USER` \
    sglahn/platformio-core:latest \
   run

successful? I can't reproduce the error at the moment.

sglahn avatar Jan 03 '21 18:01 sglahn

facing the same issue on Google cloud build

ark02 avatar Jan 16 '21 09:01 ark02

facing the same issue on Google cloud build

daniel-maiorano avatar Mar 05 '21 16:03 daniel-maiorano

any updates on this issue @sglahn ? Still failing on Google cloud build.

nicosandller avatar Nov 12 '21 05:11 nicosandller

BTW anyone else with this problem, replace this guy's docker image with mine to make it work.

Here:

https://github.com/nicosandller/platformio_build

nicosandller avatar Dec 01 '21 11:12 nicosandller