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

incus remote add --auth-type oidc unable to create the configuration file error #345

Closed
6 tasks
rgl opened this issue Dec 29, 2023 · 6 comments
Closed
6 tasks
Labels
Bug Confirmed to be a bug Easy Good for new contributors

Comments

@rgl
Copy link

rgl commented Dec 29, 2023

Required information

  • Distribution: Debian
  • Distribution version: 12
  • The output of "incus info" or if that fails:
    • Kernel version: Linux pandora 6.1.0-16-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.67-1 (2023-12-12) x86_64 GNU/Linux
    • LXC version: N/A
    • Incus version: 0.4
    • Storage backend in use: btrfs

Issue description

When executing the incus remote add incus.test --auth-type oidc command in a machine without the ~/.config directory, the following error is displayed:

vagrant@pandora:~$ ll
total 24
drwx------ 3 vagrant vagrant 4096 dez 29 12:11 ./
drwxr-xr-x 3 root    root    4096 dez 22 07:41 ../
-rw-r--r-- 1 vagrant vagrant  220 dez 22 07:41 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3526 dez 22 07:41 .bashrc
-rw-r--r-- 1 vagrant vagrant  807 dez 22 07:41 .profile
drwx------ 2 vagrant vagrant 4096 dez 29 12:11 .ssh/
-rw-r--r-- 1 vagrant vagrant    0 dez 22 07:42 .sudo_as_admin_successful

vagrant@pandora:~$ incus remote add incus.test --auth-type oidc
URL: https://pandora.incus.test:8443/realms/pandora/device?user_code=HODQ-QPSB
Code: HODQ-QPSB

Error: Unable to create the configuration file: open /home/vagrant/.config/incus/config.yml: no such file or directory

Please note that running with --debug did not display anything related to the directory creation.

Workaround: Manually create the .config/incus directory before calling incus.

Steps to reproduce

  1. See the description.

Information to attach

  • Any relevant kernel output (dmesg)
  • Container log (incus info NAME --show-log)
  • Container configuration (incus config show NAME --expanded)
  • Main daemon log (at /var/log/incus/incusd.log)
  • Output of the client with --debug
  • Output of the daemon with --debug (alternatively output of incus monitor --pretty while reproducing the issue)
@stgraber
Copy link
Member

Could you check what happens if you only create .config and not .config/incus?

I know we have some logic to create the directory if missing, but it may be assuming that some of the default XDG directories are already present.

@stgraber stgraber added Bug Confirmed to be a bug Easy Good for new contributors labels Dec 29, 2023
@rgl
Copy link
Author

rgl commented Dec 29, 2023

I have to create both directories.

@stgraber
Copy link
Member

I've tried using my root user here to get a user where I don't care about .config but I've been unable to reproduce the issue:

root@castiana:~# rm -Rf .config/
root@castiana:~# incus remote add test cluster.dcmtl.stgraber.org
To start your first container, try: incus launch images:ubuntu/22.04
Or for a virtual machine: incus launch images:ubuntu/22.04 --vm

Generating a client certificate. This may take a minute...
URL: https://services.stgraber.org/oidc/realms/master/device?user_code=WMMS-LUKR
Code: WMMS-LUKR

root@castiana:~# incus remote^C
root@castiana:~# rm -Rf .config/
root@castiana:~# incus remote add test cluster.dcmtl.stgraber.org --auth-type oidc
To start your first container, try: incus launch images:ubuntu/22.04
Or for a virtual machine: incus launch images:ubuntu/22.04 --vm

URL: https://services.stgraber.org/oidc/realms/master/device?user_code=PHFP-ZCOG
Code: PHFP-ZCOG

root@castiana:~# 

@stgraber
Copy link
Member

Oh, is that a system that only has incus-client installed?

@stgraber
Copy link
Member

I suspect that's the case as that would trigger a code path that would lead to what you're reporting.

@rgl
Copy link
Author

rgl commented Dec 29, 2023

Indeed, it only has the client installed.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Development

No branches or pull requests

2 participants