snapcraft snap fails to launch
Metadata
Current evaluation
Fixed by configuring pygit2 with a known CA-certificates path in craft-application#211 (commit 86e1c2b5), backported through snapcraft#4526; the fix was nearing release on candidate.
Resolution: closed resolved
Reason: Merged craft-application#211 set a known cacerts path to prevent the OpenSSL certificate-loading failure. The corresponding snapcraft#4526 was merged, and the maintainer reported the fix would soon be available on Snapcraft's candidate channel.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Running the following command
`snapcraft --version`
gives the following stacktrace.
```
Traceback (most recent call last):
File "/snap/snapcraft/10279/bin/snapcraft", line 5, in <module>
from snapcraft.cli import run
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/cli.py", line 35, in <module>
from snapcraft.remote import RemoteBuildError
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/remote/__init__.py", line 29, in <module>
from .git import (
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/remote/git.py", line 27, in <module>
import pygit2
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/__init__.py", line 275, in <module>
settings = Settings()
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 55, in __init__
self._initialize_tls_certificate_locations()
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 61, in _initialize_tls_certificate_locations
self.set_ssl_cert_locations(
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 191, in set_ssl_cert_locations
option(_pygit2.GIT_OPT_SET_SSL_CERT_LOCATIONS, cert_file, cert_dir)
_pygit2.GitError: OpenSSL error: failed to load certificates: error:00000000:lib(0)::reason(0)
```
### To Reproduce
Run any snapcraft releated command.
### Environment
installed using snap:
`snap install snapcraft --classic`
The following version is isntalled:
`latest/stable: 8.0.1 2024-01-04 (10279) 78MB classic`
**System Info:**
```
System:
Host: commander-latitude3510 Kernel: 6.1.71-1-lts arch: x86_64 bits: 64
Desktop: KDE Plasma v: 5.27.10 Distro: EndeavourOS
```
### snapcraft.yaml
```shell
N/A
```
### Relevant log output
```shell
Traceback (most recent call last):
File "/snap/snapcraft/10279/bin/snapcraft", line 5, in <module>
from snapcraft.cli import run
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/cli.py", line 35, in <module>
from snapcraft.remote import RemoteBuildError
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/remote/__init__.py", line 29, in <module>
from .git import (
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/remote/git.py", line 27, in <module>
import pygit2
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/__init__.py", line 275, in <module>
settings = Settings()
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 55, in __init__
self._initialize_tls_certificate_locations()
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 61, in _initialize_tls_certificate_locations
self.set_ssl_cert_locations(
File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 191, in set_ssl_cert_locations
option(_pygit2.GIT_OPT_SET_SSL_CERT_LOCATIONS, cert_file, cert_dir)
_pygit2.GitError: OpenSSL error: failed to load certificates: error:00000000:lib(0)::reason(0)
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by configuring pygit2 with a known CA-certificates path in craft-application#211 (commit 86e1c2b5), backported through snapcraft#4526; the fix was nearing release on candidate. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed the launch failure by configuring pygit2 with a known CA certificate path in craft-application PR #211; the fix was available on Snapcraft's candidate channel. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by configuring pygit2 with a known CA-certificate path in craft-application PR #211; Snapcraft commit b5ab95268 applied the remote-build fix. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by configuring pygit2 with a known CA certificate path in craft-application PR #211 and Snapcraft commit b5ab95268; the maintainer said it would ship on candidate. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by configuring pygit2 with a known CA certificate path in canonical/craft-application#211; the fix was due on Snapcraft's candidate channel. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by setting a known CA certificate path for pygit2 in craft-application PR #211; the maintainer reported the fix was available on Snapcraft's candidate channel shortly. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed. The snapcraft snap launch failure caused by a pygit2 OpenSSL certificate error was resolved and released to the candidate channel. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed the pygit2 OpenSSL certificate error that prevented snapcraft from launching. The fix was applied and released to the candidate channel. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed the snapcraft launch crash caused by a pygit2 OpenSSL certificate error. The maintainer confirmed the resolution is available on the candidate channel shortly. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | The snapcraft launch failure caused by a pygit2 OpenSSL certificate error was fixed. A maintainer confirmed the resolution is ready and will be published to the candidate channel shortly. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-application#211
(confidence 99%)
Merged fix for configuring a known CA-certificates path, commit 86e1c2b5.
-
Likely Fixed By:
canonical/snapcraft#4526
(confidence 98%)
Merged Snapcraft-side change carrying the remote-build certificate fix.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5321 regression: snapcraft fails to import pygit2 on non-ubuntu systems | snapcraft | closed | Fixed by craft-application PR #729 (commit 40e4317e), replacing the hardcoded core22 certificate path so pygit2 imports correctly for Snapcraft on non-Ubuntu systems. | |
| #4527 snapcraft 8 tries to open certificate on host system at a non-standard path | snapcraft | closed | Startup crash on non-Debian hosts (pygit2 OpenSSL cert path /usr/lib/ssl/cert.pem) was fixed by PR #4526, commit b5ab95268, which set a known CA bundle path; shipped in snapcraft 8.0.2. | |
| #1867052 Snapcraft crashes while creating snap for ssh-audit | snapcraft (launchpad) | closed | Closed as stale after prolonged inactivity; no Snapcraft PR or commit was cited as resolving the ssh-audit FileNotFoundError. | |
| #1947968 snapcraft missing 22.04 branch | snapcraft (launchpad) | closed | Resolved by opening stable/ubuntu-22.04 and releasing snapcraft revisions 7010 (amd64) and 7013 (s390x), restoring the branch required by the 22.04 package. |