question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Error: No polkit authentication agent found" when trying to flash an image as non-root

See original GitHub issue
  • Etcher version: 1.0.0-beta.19
  • Operating system and architecture:
$ uname -a
Linux patamushka 4.9.0-997-generic #201612270045 SMP Tue Dec 27 05:47:01 UTC 2016 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.0 (stretch)
Release:	9.0
Codename:	stretch

What I do

  • open Etcher via CLI by running etcher-electron (as my normal system user)
  • select an image I’ve just downloaded from resin.io
  • (the disk autopopulates with my SD card)
  • click “Flash”

What I expect to happen

For the image to be written to the card

What actually happens

I get the following popup:

image

{ Error: No polkit authentication agent found.
    at /usr/share/etcher-electron/resources/app.asar/node_modules/sudo-prompt/index.js:132:23
    at ChildProcess.exithandler (child_process.js:225:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)
  cause: 
   Error: No polkit authentication agent found.
       at /usr/share/etcher-electron/resources/app.asar/node_modules/sudo-prompt/index.js:132:23
       at ChildProcess.exithandler (child_process.js:225:5)
       at emitTwo (events.js:106:13)
       at ChildProcess.emit (events.js:191:7)
       at maybeClose (internal/child_process.js:877:16)
       at Socket.<anonymous> (internal/child_process.js:334:11)
       at emitOne (events.js:96:13)
       at Socket.emit (events.js:188:7)
       at Pipe._handle.close [as _onclose] (net.js:493:12),
  isOperational: true }
    at Socket.child.stderr.on (/usr/share/etcher-electron/resources/app.asar/lib/child-writer/index.js:129:17)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:543:20)

After I click OK, another popup appears:

Attention
Oops, seems something went wrong.
[Retry]

Retrying produces the same result.

At the same time as the “Attention” popup, this appears in my system logs:

Mar 11 10:42:30 patamushka dunst[7910]: g_variant_unref: assertion 'value->ref_count > 0' failed
Mar 11 10:42:30 patamushka dunst[7910]: g_variant_unref: assertion 'value->ref_count > 0' failed
Mar 11 10:42:30 patamushka dunst[7910]: g_variant_unref: assertion 'value->ref_count > 0' failed

And this in my auth.log:

Mar 11 10:42:24 patamushka sudo:       aj : a password is required ; TTY=pts/1 ; PWD=/home/aj ; USER=root ; COMMAND=/usr/bin/env ELECTRON_RUN_AS_NODE=1 IPC_SERVER_ID=etcher-server-9763 IPC_CLIENT_ID=etcher-client-9763 SKIP=1 /usr/share/etcher-electron/etcher /usr/share/etcher-electron/resources/app.asar/lib/child-writer/writer-proxy.js /usr/share/etcher-electron/resources/app.asar /home/aj/Downloads/resin-blinky-1.24.1-2.8.3-eef8cf4afe02.img --drive /dev/mmcblk0 --unmount --check

Workaround

By sheer chance, I noticed that if I run a command with sudo–any command, e.g. sudo ls–I’m then able to flash successfully, even though I’m not running etcher-electron with sudo.

If I run via sudo etcher-electron everything works.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:15
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

10reactions
sidmlcommented, Nov 27, 2021

I got this error on i3. Running AppImage using sudo seems to work.

10reactions
soulshakecommented, Mar 12, 2017

@jviotti Thanks for the explanation, makes sense now. I’m using i3. FYI, I already had policykit-1-gnome installed (not the two others though). I installed mate-polkit-bin and it works perfectly now after a reboot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Something went wrong, no polkit identification found error
I'm trying to use balena for the first time, practicing on Iso files that I know are good, and have flashed using rufus....
Read more >
Ubuntu 18.04: No polkit authentication agent found
I'm having this issue and the right policykit is already installed. The last step just returns an error. – John Smith. May 26,...
Read more >
belena etcher problems(Resolved) - PCLinuxOS
Hello, I installed belena etcher from the repository with Synaptic but could not get it to work. I got the error shown below....
Read more >
[SOLVED] Polkit problem / Newbie Corner / Arch Linux Forums
When I run xmonad etcher shows no polkit authentication agent found but when I use xfce it works fine... GParted doesn't even run...
Read more >
What's New | Oracle, Software. Hardware. Complete.
olcne-1.5.9-1.el8 - Oracle Linux Cloud Native Environment Platform API Server, Platform Agent and Platform Command Line Interface (CLI). (Update).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found