Meaning of error - failed to flash


#1

After successfully compiling locally I tried a Cloud flash and got this error (see below) - what does it mean and how do I solve this?

attempting to flash firmware to your device zcts100109

undefined

Flash device failed: Compiler encountered an error

Error: Command failed with exit code 1 (EPERM): /Users/wjs/.vscode/extensions/particle.particle-vscode-core-1.8.1/src/cli/bin/darwin/amd64/particle cloud flash zcts100109 --target 1.4.1 --no-update-check

at makeError (/Users/wjs/.vscode/extensions/particle.particle-vscode-core-1.8.1/node_modules/execa/lib/error.js:59:11)

at handlePromise (/Users/wjs/.vscode/extensions/particle.particle-vscode-core-1.8.1/node_modules/execa/index.js:112:26)

#2

EPERM indicates a permission error.
What command did you use?

Try particle logout and particle login and mayby also a particle update-cli

BTW, once you have a binary created via a local build you’d rather use particle flash <deviceName> <firmware.bin>.
And to separate potential cloud building errors from OTA flashing you could also do the two steps individually.


#3

Flashing from the CLI worked. But I also moved a copy of the .bin file to the ‘/users/me/’ directory.
I guess this might be an issue with working on a mac and all the permissions OS Catalina has. However, I have Cloud Flashed before from the Workbench and it has worked fine. Hoping that @m_m might comment? The feedback could be better on the error!


#4

hm. macOS Catalina permissions errors :grimacing::man_facepalming:

I have Cloud Flashed before from the Workbench and it has worked fine

did you recently update your OS by chance? was that cloud flash done under Catalina?

with your project open, try running the Particle: Launch CLI command and then execute the following in the terminal that launches:

particle cloud flash zcts100109 --target 1.4.1 --verbose

…then launch a terminal outside of vscode (e.g. Terminal.app) and run:

readlink $(which particle)

…finally, let’s check permissions:

ls -al <your project directory>
ls -al ~/.particle/toolchains/buildscripts/1.8.0/
ls -al ~/.vscode/extensions/particle.particle-vscode-core-1.8.1/src/cli/bin/darwin/amd64/

I also moved a copy of the .bin file to the ‘/users/me/’ directory

you mean your firmware .bin or something else?


#5

did you recently update your OS by chance? was that cloud flash done under Catalina?

No and Yes (like an hour before).

I tried running Launch CLI from Workbench and got the same error as reported above.

The readlink return nothing image
project directory

toolchains

extensions

you mean your firmware .bin

Yes


#6

Hi,
I have the same problem since today. Yesterday, Cloud compilation worked fine and suddenly I get this error:

Compile failed: Compiler encountered an error
Error: Command failed with exit code 1 (EPERM): /Users/egbert/.vscode/extensions/particle.particle-vscode-core-1.8.1/src/cli/bin/darwin/amd64/particle cloud compile xenon --target 1.4.4 --no-update-check
	at makeError
[...]

I used VSCode for something else today and installed another plug-in. I also remember there was a recent VSCode update to 1.41.1 for my Mac runing 10.15.2 Catalina.

@armor: Did you resolve this in the meantime?

Thanks for any support!
Joe


#7

No - still can’t flash to a device. I have had other things to worry about so haven’t pursued this further with @m_m.


#8

i was able to connect with @armor 1-on-1 to help troubleshoot this issue. turns out our error message is confusing things some - when you opt to “view logs” after hitting an error while running CLI-dependent commands (cloud flash / compile, etc) within Workbench, you see a message like:

Targeting version:  1.4.4

Including:
    src/stroby.ino
    src/stroby.cpp
    project.properties
attempting to flash firmware to your device my-photon
Flash device failed: I didn't recognize that device name or ID
Error: Command failed with exit code 1 (EPERM): /home/me/.vscode/extensions/particle.particle-vscode-core-1.8.1/src/cli/bin/linux/amd64/particle cloud flash my-photon --target 1.4.4 --no-update-check
	at makeError (/home/me/.vscode/extensions/particle.particle-vscode-core-1.8.1/node_modules/execa/lib/error.js:59:11)
	at handlePromise (/home/me/.vscode/extensions/particle.particle-vscode-core-1.8.1/node_modules/execa/index.js:112:26)

…the Error bit:

Error: Command failed with exit code 1 (EPERM): /home/me/.vscode/extensions/particle.particle-vscode-core-1.8.1/src/cli/bin/linux/amd64/particle cloud flash my-photon --target 1.4.4 --no-update-check
	at makeError (/home/me/.vscode/extensions/particle.particle-vscode-core-1.8.1/node_modules/execa/lib/error.js:59:11)
	at handlePromise (/home/me/.vscode/extensions/particle.particle-vscode-core-1.8.1/node_modules/execa/index.js:112:26)

…is tacked on and misinterprets the CLI’s exit code as having been related to permissions (EPERM). more info can be found here.

the important part of the message is:

Flash device failed: I didn't recognize that device name or ID

in @armor’s case, this was due to targeting an unclaimed device.

for now, ignore the EPERM bit as it is inaccurate. we’ll get this fixed up in the next release of Workbench - thanks for your patience :pray:


#9

All right, so for me it was a different issue. I only got cloud compilation back working when creating a new project with the workbench, reinstalling dependencies and copying over my files.
For now it works.


#10

Actually the error was

Flash device failed: Compiler encountered an error

Nothing to do with using an unclaimed device.

It is however now reporting successful flash but then not actually completing the flash - more likely to be an internet issue than Workbench or CLI related.