YunoHost-Apps / vaultwarden_ynh

Open source password management solutions for YunoHost
https://bitwarden.com/
GNU General Public License v3.0
54 stars 17 forks source link

Installation error : failed to parse the `edition` key #176

Closed croulibri closed 1 year ago

croulibri commented 2 years ago

Hello,

YunoHost 4.3.6.2 (stable) on Kimsufi KS1

I am trying again (and again) to install Vaultwarden, the type of error has changed in a few month, from rust installation failure to segmentation fault... and now "failed to parse the edition key" I am sure one day I will be able to install Vaultwarden :-)

See the bellow log:

2022-02-22 10:39:54,279: DEBUG - + pushd /var/www/vaultwarden/build
2022-02-22 10:39:54,279: DEBUG - /var/www/vaultwarden/build /var/cache/yunohost/app_tmp_work_dirs/app_g7hvydwj/scripts
2022-02-22 10:39:54,280: DEBUG - + ynh_exec_warn_less ynh_exec_as vaultwarden env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/www/vaultwarden/.cargo/bin:/var/www/vaultwarden/.local/bin:/usr/local/sbin cargo build --features sqlite --release
2022-02-22 10:39:54,281: DEBUG - + [[ 9 -eq 1 ]]
2022-02-22 10:39:54,282: DEBUG - + ynh_exec_as vaultwarden env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/www/vaultwarden/.cargo/bin:/var/www/vaultwarden/.local/bin:/usr/local/sbin cargo build --features sqlite --release
2022-02-22 10:39:54,282: DEBUG - + local user=vaultwarden
2022-02-22 10:39:54,283: DEBUG - + shift 1
2022-02-22 10:39:54,284: DEBUG - ++ whoami
2022-02-22 10:39:54,293: DEBUG - + [[ vaultwarden = root ]]
2022-02-22 10:39:54,295: DEBUG - + sudo -u vaultwarden env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/www/vaultwarden/.cargo/bin:/var/www/vaultwarden/.local/bin:/usr/local/sbin cargo build --features sqlite --release
2022-02-22 10:39:55,270: DEBUG - error: failed to parse manifest at `/var/www/vaultwarden/build/Cargo.toml`
2022-02-22 10:39:55,271: DEBUG - 
2022-02-22 10:39:55,272: DEBUG - Caused by:
2022-02-22 10:39:55,273: DEBUG -   failed to parse the `edition` key
2022-02-22 10:39:55,273: DEBUG - 
2022-02-22 10:39:55,275: DEBUG - Caused by:
2022-02-22 10:39:55,276: DEBUG -   supported edition values are `2015` or `2018`, but `2021` is unknown
2022-02-22 10:39:55,290: DEBUG - + ynh_exit_properly
2022-02-22 10:39:55,291: DEBUG - + local exit_code=101
2022-02-22 10:39:55,296: DEBUG - + '[' 101 -eq 0 ']'
2022-02-22 10:39:55,829: DEBUG - + ynh_clean_setup
2022-02-22 10:39:55,832: DEBUG - + ynh_clean_check_starting
2022-02-22 10:39:55,834: DEBUG - + '[' -n '' ']'
2022-02-22 10:39:55,835: DEBUG - + '[' -n '' ']'
2022-02-22 10:39:56,895: ERROR - Impossible d'installer vaultwarden : Une erreur est survenue dans le script d'installation de l'application

Has anyone ever faced this issue ?

Astrrra commented 2 years ago

I am facing the same error when upgrading it on my server.

tituspijean commented 2 years ago

I have just encountered the same issue. Full log: https://paste.yunohost.org/raw/ibezalagah Full log would have been helpful... indeed there's an interesting set of warnings a bit earlier in mine:

2022-04-29 07:31:40,102: WARNING - warning: it looks like you have an existing installation of Rust at:
2022-04-29 07:31:40,103: WARNING - warning: /usr/bin
2022-04-29 07:31:40,104: WARNING - warning: rustup should not be installed alongside Rust. Please uninstall your existing Rust first.
2022-04-29 07:31:40,105: WARNING - warning: Otherwise you may have confusion unless you are careful with your PATH
2022-04-29 07:31:40,105: WARNING - warning: If you are sure that you want both rustup and your already installed Rust
2022-04-29 07:31:40,106: WARNING - warning: then please reply `y' or `yes' or set RUSTUP_INIT_SKIP_PATH_CHECK to yes
2022-04-29 07:31:40,107: WARNING - warning: or pass `-y' to ignore all ignorable checks.
2022-04-29 07:31:40,107: WARNING - error: cannot install while Rust is installed
2022-04-29 07:31:40,108: WARNING - warning: continuing (because the -y flag is set and the error is ignorable)

After uninstalling Rust at the system level (apt remove rustc), the app installs with no issue. My guess is that the commands call the system binary and not the Rust version installed in the app's directory.

croulibri commented 2 years ago

Thanks @tituspijean for your advices, that's true a apt remove rustc solved my problem. But as I read warning: continuing (because the -y flag is set and the error is ignorable) I thought this was not the cause of the failure. I was mistaken...

And Vaultwarden is now uptaded :slightly_smiling_face:

tituspijean commented 2 years ago

Let me reopen this. We need to make sure the app calls the right binary. :)

rosbeef commented 1 year ago

the error is DEBUG - error: failed to parse manifest at /var/www/vaultwarden/build/Cargo.toml 2022-04-29 07:32:00,670: DEBUG - 2022-04-29 07:32:00,671: DEBUG - Caused by: 2022-04-29 07:32:00,671: DEBUG - failed to parse the edition key 2022-04-29 07:32:00,672: DEBUG - 2022-04-29 07:32:00,672: DEBUG - Caused by: 2022-04-29 07:32:00,672: DEBUG - this version of Cargo is older than the 2021 edition, and only supports 2015 and 2018 editions.

i have a rust version problem in #200 too

it is a version problem of rust or cargo maybe remove rustc at each time before the update or install script, should be the solution.

yalh76 commented 1 year ago

how to remove rustc ?

rosbeef commented 1 year ago

i'm trying apt remove rustc then upgrade VW ... it takes a while ...

rosbeef commented 1 year ago

done and it works. but maybe you #201 PR should correct the problem without removing the installed rustc