So further investigation, the "cannot authenticate to snap store: " part
of the error is only added by snapd for an unexpected error:

https://github.com/snapcore/snapd/blob/master/store/auth.go#L190-L204

I believe this is being called via the refreshDischarges() method,
intended to keep the store macaroon up to date.  This is called by any
snapd API that talks to the store, so it isn't surprising we'd hit it
during gnome-software start up.

I wonder if changing your Ubuntu One password would be enough for the
store to refuse to refresh the macaroon?

So it looks like the fix probably requires the following:

 1. snapd to handle the INVALID_CREDENTIALS response from the store and
produce an error response that snapd-glib can distinguish.

 2. snapd-glib to handle this error case and map it to one of its error
codes (either a new one, or fold it into invalid-auth-data?)

 3. if snapd-glib produces a new error code, for gnome-software's snap
plugin to map this to an appropriate error code.

The end result should be for gnome-software to call the /v2/login end
point again, probably passing its existing macaroon so it updates the
existing snapd user rather than creating another (i.e. what would happen
to paid snaps for a discarded snapd user ID when it comes time to
refresh?).  I'll follow up with the snappy team to verify that this is
the way forward.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-software in Ubuntu.
https://bugs.launchpad.net/bugs/1724316

Title:
  "Sorry, something went wrong cannot authenticate to snap store ..."
  without any way to fix

Status in gnome-software package in Ubuntu:
  Confirmed

Bug description:
  When I open this application, I see a message near the top that says
  "Sorry, something went wrong cannot authenticate to snap store:
  Provided email/password is not correct."

  I can close this message dialog, but there appears to be no way to
  remedy the problem.

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: ubuntu-software 3.26.1-0ubuntu2
  ProcVersionSignature: Ubuntu 4.13.0-16.19-generic 4.13.4
  Uname: Linux 4.13.0-16-generic x86_64
  NonfreeKernelModules: zfs zunicode zavl zcommon znvpair
  ApportVersion: 2.20.7-0ubuntu3
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Oct 17 13:08:16 2017
  EcryptfsInUse: Yes
  InstalledPlugins:
   gnome-software-plugin-flatpak N/A
   gnome-software-plugin-limba   N/A
   gnome-software-plugin-snap    3.26.1-0ubuntu2
  PackageArchitecture: all
  SourcePackage: gnome-software
  UpgradeStatus: Upgraded to artful on 2017-10-16 (0 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-software/+bug/1724316/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to