snapcraft snap fails to launch
Metadata
Current evaluation
Fixed. The snapcraft snap launch failure caused by a pygit2 OpenSSL certificate error was resolved and released to the candidate channel.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed a pygit2 OpenSSL certificate loading error that prevented snapcraft from launching. The resolution was deployed to the candidate channel and the issue was closed. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4527 snapcraft 8 tries to open certificate on host system at a non-standard path | snapcraft | closed | Resolved in snapcraft 8.0.2 via PR #4526. The hardcoded SSL certificate path caused crashes on non-Debian distributions. The fix updates pygit2 to correctly locate certificates, preventing initialization failures on systems like Fedora. | |
| #4520 regression: remote-build fails OpenSSL error | snapcraft | closed | Resolved a regression in snapcraft 8.0.1 where remote-build failed with a pygit2 OpenSSL certificate error on Arch Linux. The fix was verified and deployed to the candidate channel. |