Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If destructive-mode is disabled, we need to run lxd init --auto #140

Open
rgildein opened this issue May 3, 2024 · 1 comment
Open

If destructive-mode is disabled, we need to run lxd init --auto #140

rgildein opened this issue May 3, 2024 · 1 comment
Labels
Status: Triage Type: Bug Something isn't working

Comments

@rgildein
Copy link

rgildein commented May 3, 2024

Bug Description

With destructive-mode disabled, we need to run lxd init --auto to be able to build on LXD.

Example can be found in this run: https://github.com/canonical/charm-advanced-routing/actions/runs/8935512230/job/24546799845

To Reproduce

  release:
    needs: check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Upload charm to charmhub
        uses: canonical/charming-actions/upload-charm@2.4.0
        with:
          credentials: "${{ secrets.CHARMHUB_TOKEN }}"
          github-token: "${{ secrets.GITHUB_TOKEN }}"
          channel: "latest/edge"
          destructive-mode: false

Environment

ubuntu-latest

Relevant log output

2024-05-03T08:45:47.8720637Z Current runner version: '2.316.0'
2024-05-03T08:45:47.8743470Z ##[group]Operating System
2024-05-03T08:45:47.8744114Z Ubuntu
2024-05-03T08:45:47.8744480Z 22.04.4
2024-05-03T08:45:47.8744905Z LTS
2024-05-03T08:45:47.8745213Z ##[endgroup]
2024-05-03T08:45:47.8745602Z ##[group]Runner Image
2024-05-03T08:45:47.8746103Z Image: ubuntu-22.04
2024-05-03T08:45:47.8746525Z Version: 20240422.1.0
2024-05-03T08:45:47.8747468Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240422.1/images/ubuntu/Ubuntu2204-Readme.md
2024-05-03T08:45:47.8748981Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240422.1
2024-05-03T08:45:47.8749863Z ##[endgroup]
2024-05-03T08:45:47.8750260Z ##[group]Runner Image Provisioner
2024-05-03T08:45:47.8750783Z 2.0.369.1
2024-05-03T08:45:47.8751138Z ##[endgroup]
2024-05-03T08:45:47.8753478Z ##[group]GITHUB_TOKEN Permissions
2024-05-03T08:45:47.8755155Z Actions: write
2024-05-03T08:45:47.8755831Z Attestations: write
2024-05-03T08:45:47.8756329Z Checks: write
2024-05-03T08:45:47.8756692Z Contents: write
2024-05-03T08:45:47.8757174Z Deployments: write
2024-05-03T08:45:47.8757600Z Discussions: write
2024-05-03T08:45:47.8758059Z Issues: write
2024-05-03T08:45:47.8758407Z Metadata: read
2024-05-03T08:45:47.8758794Z Packages: write
2024-05-03T08:45:47.8759277Z Pages: write
2024-05-03T08:45:47.8759639Z PullRequests: write
2024-05-03T08:45:47.8760068Z RepositoryProjects: write
2024-05-03T08:45:47.8760597Z SecurityEvents: write
2024-05-03T08:45:47.8761012Z Statuses: write
2024-05-03T08:45:47.8761352Z ##[endgroup]
2024-05-03T08:45:47.8763498Z Secret source: Actions
2024-05-03T08:45:47.8764084Z Prepare workflow directory
2024-05-03T08:45:47.9388448Z Prepare all required actions
2024-05-03T08:45:47.9544557Z Getting action download info
2024-05-03T08:45:48.1240805Z Download action repository 'actions/checkout@v4' (SHA:0ad4b8fadaa221de15dcec353f45205ec38ea70b)
2024-05-03T08:45:48.4856351Z Download action repository 'canonical/charming-actions@2.4.0' (SHA:631c2d944da2bd12430f1f3a954c8fffcf2385cd)
2024-05-03T08:45:49.1481207Z Complete job name: release
2024-05-03T08:45:49.2491047Z ##[group]Run actions/checkout@v4
2024-05-03T08:45:49.2491421Z with:
2024-05-03T08:45:49.2491709Z   repository: canonical/charm-advanced-routing
2024-05-03T08:45:49.2492240Z   token: ***
2024-05-03T08:45:49.2492486Z   ssh-strict: true
2024-05-03T08:45:49.2492735Z   ssh-user: git
2024-05-03T08:45:49.2492979Z   persist-credentials: true
2024-05-03T08:45:49.2493455Z   clean: true
2024-05-03T08:45:49.2493715Z   sparse-checkout-cone-mode: true
2024-05-03T08:45:49.2494028Z   fetch-depth: 1
2024-05-03T08:45:49.2494286Z   fetch-tags: false
2024-05-03T08:45:49.2494532Z   show-progress: true
2024-05-03T08:45:49.2494792Z   lfs: false
2024-05-03T08:45:49.2495007Z   submodules: false
2024-05-03T08:45:49.2495256Z   set-safe-directory: true
2024-05-03T08:45:49.2495530Z ##[endgroup]
2024-05-03T08:45:49.4053915Z Syncing repository: canonical/charm-advanced-routing
2024-05-03T08:45:49.4056118Z ##[group]Getting Git version info
2024-05-03T08:45:49.4057328Z Working directory is '/home/runner/work/charm-advanced-routing/charm-advanced-routing'
2024-05-03T08:45:49.4058643Z [command]/usr/bin/git version
2024-05-03T08:45:49.4059214Z git version 2.43.2
2024-05-03T08:45:49.4060959Z ##[endgroup]
2024-05-03T08:45:49.4075412Z Temporarily overriding HOME='/home/runner/work/_temp/d069951a-330e-47d5-99dd-9f86ad142e54' before making global git config changes
2024-05-03T08:45:49.4077071Z Adding repository directory to the temporary git global config as a safe directory
2024-05-03T08:45:49.4078801Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/charm-advanced-routing/charm-advanced-routing
2024-05-03T08:45:49.4081226Z Deleting the contents of '/home/runner/work/charm-advanced-routing/charm-advanced-routing'
2024-05-03T08:45:49.4088581Z ##[group]Initializing the repository
2024-05-03T08:45:49.4091464Z [command]/usr/bin/git init /home/runner/work/charm-advanced-routing/charm-advanced-routing
2024-05-03T08:45:49.4146149Z hint: Using 'master' as the name for the initial branch. This default branch name
2024-05-03T08:45:49.4147356Z hint: is subject to change. To configure the initial branch name to use in all
2024-05-03T08:45:49.4148474Z hint: of your new repositories, which will suppress this warning, call:
2024-05-03T08:45:49.4149249Z hint: 
2024-05-03T08:45:49.4150790Z hint: 	git config --global init.defaultBranch <name>
2024-05-03T08:45:49.4151429Z hint: 
2024-05-03T08:45:49.4152132Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2024-05-03T08:45:49.4153313Z hint: 'development'. The just-created branch can be renamed via this command:
2024-05-03T08:45:49.4154117Z hint: 
2024-05-03T08:45:49.4154520Z hint: 	git branch -m <name>
2024-05-03T08:45:49.4156647Z Initialized empty Git repository in /home/runner/work/charm-advanced-routing/charm-advanced-routing/.git/
2024-05-03T08:45:49.4160552Z [command]/usr/bin/git remote add origin https://github.com/canonical/charm-advanced-routing
2024-05-03T08:45:49.4192938Z ##[endgroup]
2024-05-03T08:45:49.4193447Z ##[group]Disabling automatic garbage collection
2024-05-03T08:45:49.4195800Z [command]/usr/bin/git config --local gc.auto 0
2024-05-03T08:45:49.4223887Z ##[endgroup]
2024-05-03T08:45:49.4224349Z ##[group]Setting up auth
2024-05-03T08:45:49.4229191Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2024-05-03T08:45:49.4257268Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-05-03T08:45:49.4539879Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2024-05-03T08:45:49.4566522Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-05-03T08:45:49.4792456Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2024-05-03T08:45:49.4825568Z ##[endgroup]
2024-05-03T08:45:49.4826643Z ##[group]Fetching the repository
2024-05-03T08:45:49.4834747Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +3c08578caf6b830a5364c46749f91cebb6b98ed3:refs/remotes/origin/main
2024-05-03T08:45:49.6977391Z From https://github.com/canonical/charm-advanced-routing
2024-05-03T08:45:49.6979080Z  * [new ref]         3c08578caf6b830a5364c46749f91cebb6b98ed3 -> origin/main
2024-05-03T08:45:49.7004677Z ##[endgroup]
2024-05-03T08:45:49.7005410Z ##[group]Determining the checkout info
2024-05-03T08:45:49.7006862Z ##[endgroup]
2024-05-03T08:45:49.7014331Z [command]/usr/bin/git sparse-checkout disable
2024-05-03T08:45:49.7056749Z [command]/usr/bin/git config --local --unset-all extensions.worktreeConfig
2024-05-03T08:45:49.7084743Z ##[group]Checking out the ref
2024-05-03T08:45:49.7089366Z [command]/usr/bin/git checkout --progress --force -B main refs/remotes/origin/main
2024-05-03T08:45:49.7166409Z Switched to a new branch 'main'
2024-05-03T08:45:49.7167544Z branch 'main' set up to track 'origin/main'.
2024-05-03T08:45:49.7172999Z ##[endgroup]
2024-05-03T08:45:49.7210711Z [command]/usr/bin/git log -1 --format='%H'
2024-05-03T08:45:49.7234085Z '3c08578caf6b830a5364c46749f91cebb6b98ed3'
2024-05-03T08:45:49.7532755Z ##[group]Run canonical/charming-actions/upload-charm@2.4.0
2024-05-03T08:45:49.7533193Z with:
2024-05-03T08:45:49.7546374Z   credentials: ***
2024-05-03T08:45:49.7546977Z   github-token: ***
2024-05-03T08:45:49.7547384Z   channel: latest/edge
2024-05-03T08:45:49.7547652Z   destructive-mode: false
2024-05-03T08:45:49.7547926Z   charm-path: .
2024-05-03T08:45:49.7548178Z   charmcraft-channel: latest/stable
2024-05-03T08:45:49.7548486Z   upload-image: true
2024-05-03T08:45:49.7548732Z   pull-image: true
2024-05-03T08:45:49.7548966Z ##[endgroup]
2024-05-03T08:45:49.9042788Z [command]/usr/bin/sudo snap install charmcraft --classic --channel latest/stable
2024-05-03T08:46:11.4650569Z charmcraft 2.6.0 from Canonical** installed
2024-05-03T08:46:11.4700397Z [command]/usr/bin/sudo charmcraft pack --quiet
2024-05-03T08:46:13.2764153Z LXD has not been properly initialized.
2024-05-03T08:46:13.2766168Z Recommended resolution: Execute 'lxd init --auto' to initialize LXD.
2024-05-03T08:46:13.2767414Z Visit https://documentation.ubuntu.com/lxd/en/latest/getting_started/ for instructions on installing and configuring LXD for your operating system.
2024-05-03T08:46:13.2768578Z Full execution log: '/root/.local/state/charmcraft/log/charmcraft-20240503-084613.095844.log'
2024-05-03T08:46:13.3513460Z ##[error]The process '/usr/bin/sudo' failed with exit code 1
2024-05-03T08:46:13.3526243Z ##[error]Error: The process '/usr/bin/sudo' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/canonical/charming-actions/2.4.0/dist/upload-charm/index.js:3763:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/canonical/charming-actions/2.4.0/dist/upload-charm/index.js:3746:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/canonical/charming-actions/2.4.0/dist/upload-charm/index.js:3640:27)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
2024-05-03T08:46:13.3529817Z [command]/usr/bin/sudo test -d /root/snap/charmcraft/common/cache/charmcraft/log
2024-05-03T08:46:13.3627334Z No charmcraft logs generated, skipping artifact upload.
2024-05-03T08:46:13.3753413Z Post job cleanup.
2024-05-03T08:46:13.4476965Z [command]/usr/bin/git version
2024-05-03T08:46:13.4516998Z git version 2.43.2
2024-05-03T08:46:13.4558013Z Temporarily overriding HOME='/home/runner/work/_temp/1f372e75-773a-4e17-9d25-dd3b4624cdbb' before making global git config changes
2024-05-03T08:46:13.4559659Z Adding repository directory to the temporary git global config as a safe directory
2024-05-03T08:46:13.4562859Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/charm-advanced-routing/charm-advanced-routing
2024-05-03T08:46:13.4596200Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2024-05-03T08:46:13.4628460Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-05-03T08:46:13.4868447Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2024-05-03T08:46:13.4887461Z http.https://github.com/.extraheader
2024-05-03T08:46:13.4898261Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2024-05-03T08:46:13.4925611Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-05-03T08:46:13.5381283Z Cleaning up orphan processes

Additional context

No response

@rgildein rgildein added Status: Triage Type: Bug Something isn't working labels May 3, 2024
rgildein added a commit to rgildein/charm-advanced-routing that referenced this issue May 3, 2024
rgildein added a commit to rgildein/charm-advanced-routing that referenced this issue May 3, 2024
rgildein added a commit to canonical/charm-advanced-routing that referenced this issue May 3, 2024
@rgildein
Copy link
Author

rgildein commented May 6, 2024

Using official actions to setup LXD before this actions works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant