You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple charmcraft yaml w/ stage packages breaks with error: Unknown error: E:The method driver /snap/charmcraft/4914/usr/lib/apt/methods/http could not be found..
name: test
type: charm
title: test charm
summary: test summary
description: test description
base: [email protected]
parts:
charm:
plugin: nil
stage-packages:
- wget
platforms:
amd64:
To Reproduce
use the charmcraft.yaml above and run charmcraft pack
Environment
$ charmcraft --version
charmcraft 3.2.1
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
charmcraft.yaml
name: testtype: charmtitle: test charmsummary: test summarydescription: test descriptionbase: [email protected]parts:
charm:
plugin: nilstage-packages:
- wgetplatforms:
amd64:
Relevant log output
Unknown error: E:The method driver /snap/charmcraft/4914/usr/lib/apt/methods/http could not be found.
Failed to execute charmcraft in instance.
The text was updated successfully, but these errors were encountered:
Hi - this is blocked by #1839 and #1844, where we'd need to do the work to make stage packages work.
However, given what you're trying to stage, it's likely not going to do what you intend it to do. Rather than installing wget on the target machine, using stage-packages would include the contents of the wget package in the charm itself, in a way that may not actually make the wget executable included there usable.
If what you expect is for the package to be installed on the machine where the charm is installed, you may want to look at the charm libraries provided under the operator-libs-linux charm, specifically the apt library.
You can use that library to install wget (or any other packages you need) on the system during the install event, which would make it available both for the charm to run using subprocess.run and for other processes on the system to use.
Hi! Thanks for the explanation:) the wget is just for demonstration purposes.
I am already using the apt lib but there is an issue where it is not compatible with noble (ppa).
Hence I have resorted to this as a fallback which I found wasn't quite working at the moment too.
I think I will need to fall back to sub process runs for the time being to unblock myself.
Thanks!
Bug Description
A simple charmcraft yaml w/ stage packages breaks with error:
Unknown error: E:The method driver /snap/charmcraft/4914/usr/lib/apt/methods/http could not be found.
.To Reproduce
use the charmcraft.yaml above and run
charmcraft pack
Environment
$ charmcraft --version
charmcraft 3.2.1
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
charmcraft.yaml
Relevant log output
Unknown error: E:The method driver /snap/charmcraft/4914/usr/lib/apt/methods/http could not be found. Failed to execute charmcraft in instance.
The text was updated successfully, but these errors were encountered: