Closed Bug 1618136 Opened 4 years ago Closed 4 years ago

Cannot push snap 74.0b8: AttributeError: module 'platform' has no attribute 'dist'

Categories

(Release Engineering :: Release Automation: Snap, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jlorenzo, Assigned: jlorenzo)

References

Details

(Keywords: regression)

Attachments

(1 file)

Perma fail. Logs show[2]:

2020-02-26 05:55:41,353 - scriptworker.client - DEBUG - Task is validated against this schema: {'title': 'Taskcluster PushSnap task minimal schema', 'type': 'object', 'properties': {'dependencies': {'type': 'array', 'minItems': 1, 'uniqueItems': True, 'items': {'type': 'string'}}, 'scopes': {'type': 'array', 'uniqueItems': True, 'items': {'type': 'string'}}, 'payload': {'type': 'object', 'properties': {'channel': {'type': 'string'}, 'upstreamArtifacts': {'type': 'array', 'items': {'type': 'object', 'properties': {'taskType': {'type': 'string'}, 'taskId': {'type': 'string'}, 'paths': {'type': 'array', 'minItems': 1, 'uniqueItems': True, 'items': {'type': 'string'}}}, 'required': ['taskId', 'taskType', 'paths'], 'additionalProperties': False}, 'minItems': 1, 'uniqueItems': True}}, 'required': ['upstreamArtifacts'], 'additionalProperties': False}}, 'required': ['dependencies', 'scopes', 'payload']}
Traceback (most recent call last):
  File "/app/bin/pushsnapscript", line 8, in <module>
    sys.exit(main())
  File "/app/lib/python3.8/site-packages/pushsnapscript/script.py", line 42, in main
    return client.sync_main(async_main, config_path=config_path, default_config=get_default_config())
  File "/app/lib/python3.8/site-packages/scriptworker/client.py", line 165, in sync_main
    loop.run_until_complete(_handle_asyncio_loop(async_main, context))
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 612, in run_until_complete
    return future.result()
  File "/app/lib/python3.8/site-packages/scriptworker/client.py", line 204, in _handle_asyncio_loop
    await async_main(context)
  File "/app/lib/python3.8/site-packages/pushsnapscript/script.py", line 23, in async_main
    snap_store.push(context, snap_file_path, channel)
  File "/app/lib/python3.8/site-packages/pushsnapscript/snap_store.py", line 61, in push
    with _store_session(macaroon_location) as store:
  File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/app/lib/python3.8/site-packages/pushsnapscript/snap_store.py", line 77, in _store_session
    store = StoreClient()
  File "/app/lib/python3.8/site-packages/snapcraft/storeapi/_store_client.py", line 31, in __init__
    self.sso = SSOClient(self.conf)
  File "/app/lib/python3.8/site-packages/snapcraft/storeapi/_sso_client.py", line 19, in __init__
    super().__init__(
  File "/app/lib/python3.8/site-packages/snapcraft/storeapi/_client.py", line 42, in __init__
    self._snapcraft_headers = {"User-Agent": _agent.get_user_agent()}
  File "/app/lib/python3.8/site-packages/snapcraft/storeapi/_agent.py", line 39, in get_user_agent
    "/".join(platform.dist()[0:2]),  # i.e. Ubuntu/16.04
AttributeError: module 'platform' has no attribute 'dist'
exit code: 1

It could be related to bug 1616048, but I currently doubt it. A more plausible explanation to me is the fact that we switched to python 3.8[3]. If so, it's probably a good time to bump the snapcraft dependency to 3.X. So far, we've been on 2.43.1[4].

I've been able to reproduce the bug locally. I'm looking into it.

[1] https://treeherder.mozilla.org/#/jobs?repo=mozilla-beta&group_state=expanded&selectedJob=290507994&resultStatus=usercancel%2Ctestfailed%2Cbusted%2Cexception&revision=588c2ea6418034a20c33f21e122da5c3e2f335a7
[2] https://firefoxci.taskcluster-artifacts.net/U7VVpdctTZ2dz0WxYvX8mg/1/public/logs/live_backing.log
[3] https://github.com/mozilla-releng/scriptworker-scripts/pull/146
[4] https://github.com/mozilla-releng/scriptworker-scripts/blob/75e06d9c88a91ab9ed07e825db52aa9a3b6ccbcc/pushsnapscript/requirements/base.in#L6

(In reply to Julien Cristau [:jcristau] from comment #2)
👍

For the record, I managed to fix the bug on my local machine. It allowed me to publish 74.0b8. I'm checking the fix works with our infra.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: