Not able to run snapcraft login on mac m1

Bug #1925374 reported by Thomas Rich
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Medium
Sergio Schvezov

Bug Description

Hey there, I'm getting this error when I run the following command:

snapcraft login
Sorry, an error occurred in Snapcraft:
'arm64'
Traceback (most recent call last):
  File "/opt/homebrew/bin/snapcraft", line 8, in <module>
    sys.exit(run())
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/snapcraft/cli/store.py", line 749, in login
    store_client = storeapi.StoreClient()
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/snapcraft/storeapi/_store_client.py", line 44, in __init__
    self.sso = SSOClient(self.conf)
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/snapcraft/storeapi/_sso_client.py", line 17, in __init__
    super().__init__(
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/snapcraft/storeapi/_client.py", line 59, in __init__
    self._snapcraft_headers = {"User-Agent": _agent.get_user_agent()}
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/snapcraft/storeapi/_agent.py", line 49, in get_user_agent
    arch = snapcraft.ProjectOptions().deb_arch
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/snapcraft/project/_project_options.py", line 238, in __init__
    self._set_machine(target_deb_arch)
  File "/opt/homebrew/Cellar/snapcraft/4.4.1_1/libexec/lib/python3.9/site-packages/snapcraft/project/_project_options.py", line 358, in _set_machine
    self.__machine_info = _ARCH_TRANSLATIONS[self.__target_machine]
KeyError: 'arm64'
We would appreciate it if you created a bug report at
https://launchpad.net/snapcraft/+filebug with the above text included.
You can find the traceback in file '/var/folders/9t/gz9jrxmd2lxfs4_g7_rjpm7w0000gn/T/tmptx7spl9n/trace.txt'.

Any ideas on why this is happening and how to get it to work would be appreciated. Thanks!

Tags: craft-267
Revision history for this message
Michał Sawicz (saviq) wrote :

Confirmed. To get there, here are the steps I followed:

$ brew install openssl@1.1 rust
$ env LDFLAGS="-L$(brew --prefix openssl@1.1)/lib" CFLAGS="-I$(brew --prefix openssl@1.1)/include" pip install cryptography
$ pip install git+https://github.com/snapcore/snapcraft.git#egg=snapcraft
$ snapcraft --version

Changed in snapcraft:
status: New → Confirmed
Changed in snapcraft:
status: Confirmed → Triaged
importance: Undecided → Medium
assignee: nobody → Sergio Schvezov (sergiusens)
tags: added: craft-267
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: Triaged → In Progress
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
Revision history for this message
Thomas Rich (tnrich) wrote :

Can confirm the fix! Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.