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
custom commands stopped and topgrade exited #380
Comments
You can test this with the following simple configuration: Ubuntu-22.04> reini@ubuntu:~$ grep -vE '^#|^$' ~/tmp/topgrade/topgrade.toml
assume_yes = true
disable = ["myrepos"]
no_retry = true
ssh_arguments = "-o ConnectTimeout=2"
cleanup = true
[git]
[composer]
[pre_commands]
[commands]
"01 Custom command 01" = "~/tmp/topgrade/command01.sh"
"02 Custom command 02" = "~/tmp/topgrade/command02.sh"
"03 Custom command 03" = "~/tmp/topgrade/command03.sh"
[brew]
greedy_cask = true
[linux]
[windows]
[npm]
[firmware]
[flatpak]
Ubuntu-22.04> reini@ubuntu:~$ more ~/tmp/topgrade/command0*
::::::::::::::
/home/reini/tmp/topgrade/command01.sh
::::::::::::::
#!/usr/bin/env sh
echo "Custom command 01"
::::::::::::::
/home/reini/tmp/topgrade/command02.sh
::::::::::::::
#!/usr/bin/env sh
echo "Custom command 02"
::::::::::::::
/home/reini/tmp/topgrade/command03.sh
::::::::::::::
#!/usr/bin/env sh
echo "Custom command 03"
Ubuntu-22.04> reini@ubuntu:~$ topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands
Due to a design issue with notify-send it could be that topgrade hangs when it's finished.
If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file.
If you don't want this message to appear any longer set display_preamble = false in the config file.
For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and https://github.com/topgrade-rs/topgrade/issues/288.
── 11:51:31 - Self update ──────────────────────────────────────────────────────
Topgrade is up-to-date
── 11:51:32 - 01 Custom command 01 ─────────────────────────────────────────────
Custom command 01
── 11:51:33 - 02 Custom command 02 ─────────────────────────────────────────────
[1]+ Stopped topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands
Ubuntu-22.04> reini@ubuntu:~$ jobs
[1]+ Stopped topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands |
I can confirm that it works on Mac with zsh here. It also works in a multipass Ubuntu 22.04 vm (aarch64) on my Mac with similar .bashrc settings, but not on a real Linux machine (x86_64/amd64). topgrade with the above test config:
So maybe this is only a problem on x86_64/amd64 machines. Please fix this urgent, as topgrade did not work on Linux now when you use custom commands. |
I think I have this same issue after the upgrade as well. Replicating this by doing
Tested on both Ubuntu and MacOS. |
Sorry, on the Mac vm I tested it with an old topgrade 9.0.1 that works. With a new version it also did not work: Multipass~Ubuntu-22.04> [ssh] ubuntu@mac:~/tmp/topgrade$ topgrade --version; topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands; topgrade --version
Topgrade 10.3.2
Due to a design issue with notify-send it could be that topgrade hangs when it's finished.
If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file.
If you don't want this message to appear any longer set display_preamble = false in the config file.
For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and https://github.com/topgrade-rs/topgrade/issues/288.
── 12:39:23 - Self update ──────────────────────────────────────────────────────
Topgrade is up-to-date
── 12:39:23 - 01 Custom command 01 ─────────────────────────────────────────────
Custom command 01
── 12:39:23 - 02 Custom command 02 ─────────────────────────────────────────────
[2]+ Stopped topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands
Topgrade 10.3.2 |
So I think testing this only on a Mac with zsh is not enough ... Please fix it or revert the patch or add an option (in config) to disable this behavior. Thanks in advance. |
Have you guys set |
I use starship prompt which I'm sure does that for me. |
Do you use tmux/zellij or something like that? |
PS1 is set in a default Ubuntu installation and I also set it to something different and PROMPT_COMMAND is also used. Multipass~Ubuntu-22.04> [ssh] ubuntu@mac:~$ set|grep -E '^PS1|^PROMPT_COMMAND'
PROMPT_COMMAND='history -a;history -c;history -r;__ps1_long_path;'
PS1='\[\e[1;37m\]Multipass~Ubuntu-22.04>\[\e[0;0m\] $(_show_virtual_env)[ssh] \[\e]0;\u@\h:\w\a\]\[\e[0;32m\]\u\[\e[0m\]@\[\e[0;34m\]\h\[\e[0m\]:\[\e[0;36m\]\w\[\e[0m\]$(__git_ps1 '\''\[\033[0;33m\] (%s)\[\033[0m\]'\'')$ ' |
Without PS1 and PROMPT_COMMAND set it did also not work: Multipass~Ubuntu-22.04> [ssh] ubuntu@MBP-009:~$ unset PS1
unset PROMPT_COMMAND
topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands; topgrade --version
Due to a design issue with notify-send it could be that topgrade hangs when it's finished.
If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file.
If you don't want this message to appear any longer set display_preamble = false in the config file.
For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and https://github.com/topgrade-rs/topgrade/issues/288.
── 14:06:33 - Self update ──────────────────────────────────────────────────────
Topgrade is up-to-date
── 14:06:34 - 01 Custom command 01 ─────────────────────────────────────────────
Custom command 01
── 14:06:34 - 02 Custom command 02 ─────────────────────────────────────────────
[1]+ Stopped topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands
Topgrade 10.3.2 |
On Raspian GNU/Linux 11 (armv7l) does it now also not work: Raspbian-11> [ssh] pi@octoprint:~$ topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands
Due to a design issue with notify-send it could be that topgrade hangs when it's finished.
If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file.
If you don't want this message to appear any longer set display_preamble = false in the config file.
For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and https://github.com/topgrade-rs/topgrade/issues/288.
── 14:13:10 - Self update ──────────────────────────────────────────────────────
[00:00:00] [========================================] 4.35MiB/4.35MiB (0s) Done
Topgrade upgraded to 10.3.2:
## What's Changed
* use documented way of updating by @vzze in https://github.com/topgrade-rs/topgrade/pull/344
* Add support for please (access elevation) by @dsully in https://github.com/topgrade-rs/topgrade/pull/310
* run_custom_command: use interactive shell on unix by @utkarshgupta137 in https://github.com/topgrade-rs/topgrade/pull/347
* ruby_gems: Fixes asdf by @DottoDev in https://github.com/topgrade-rs/topgrade/pull/350
* vim: Adds Astrovim support by @DottoDev in https://github.com/topgrade-rs/topgrade/pull/352
* CI: Update cross to v0.2.5 by @guihkx in https://github.com/topgrade-rs/topgrade/pull/354
* Silence misleading warning on other platforms. by @jstelzer in https://github.com/topgrade-rs/topgrade/pull/353
* apt: Recognise mist by @DottoDev in https://github.com/topgrade-rs/topgrade/pull/351
* pip3: Check for EXTERNALLY-MANAGED (PEP 668) by @TGRCdev in https://github.com/topgrade-rs/topgrade/pull/367
* pacdef: support new version 1.x by @arctic-penguin in https://github.com/topgrade-rs/topgrade/pull/364
* Support antidote by @r-darwish in https://github.com/topgrade-rs/topgrade/pull/368
* cargo: add cleanup step (using cargo-cache) by @IsaacTay in https://github.com/topgrade-rs/topgrade/pull/371
* skip skip-notify warning on Win by @DottoDev in https://github.com/topgrade-rs/topgrade/pull/362
* 10.3.2 patch by @DottoDev in https://github.com/topgrade-rs/topgrade/pull/378
## New Contributors
* @dsully made their first contribution in https://github.com/topgrade-rs/topgrade/pull/310
* @utkarshgupta137 made their first contribution in https://github.com/topgrade-rs/topgrade/pull/347
* @TGRCdev made their first contribution in https://github.com/topgrade-rs/topgrade/pull/367
* @IsaacTay made their first contribution in https://github.com/topgrade-rs/topgrade/pull/371
**Full Changelog**: https://github.com/topgrade-rs/topgrade/compare/v10.3.1...v10.3.2
Respawning...
Due to a design issue with notify-send it could be that topgrade hangs when it's finished.
If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file.
If you don't want this message to appear any longer set display_preamble = false in the config file.
For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and https://github.com/topgrade-rs/topgrade/issues/288.
── 14:13:13 - 01 Custom command 01 ─────────────────────────────────────────────
Custom command 01
── 14:13:14 - 02 Custom command 02 ─────────────────────────────────────────────
[1]+ Stopped topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands
Raspbian-11> [ssh] pi@octoprint:~$ topgrade --version
Topgrade 10.3.2 |
I would vote to revoke this change, test successfully on all topgrade supported platforms before merging it again! |
@utkarshgupta137 An alternative to
which executes the command on the foreground (tested in my Ubuntu and MacOS machines) while still being able to expand the user's aliases and functions. |
I found in the source code (https://github.com/topgrade-rs/topgrade/blob/master/src/main.rs#L119) when setting environment variable TOPGRADE_NO_SELF_UPGRADE the self update is skipped: Multipass~Ubuntu-22.04> [ssh] ubuntu@mac:~$ TOPGRADE_NO_SELF_UPGRADE=true topgrade --config ~/tmp/topgrade/topgrade.toml --only custom_commands; topgrade --version
Due to a design issue with notify-send it could be that topgrade hangs when it's finished.
If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file.
If you don't want this message to appear any longer set display_preamble = false in the config file.
For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and https://github.com/topgrade-rs/topgrade/issues/288.
── 16:26:26 - 01 Custom command 01 ─────────────────────────────────────────────
Custom command 01
── 16:26:26 - 02 Custom command 02 ─────────────────────────────────────────────
Custom command 02
── 16:26:26 - 03 Custom command 03 ─────────────────────────────────────────────
Custom command 03
── 16:26:26 - Summary ──────────────────────────────────────────────────────────
01 Custom command 01: OK
02 Custom command 02: OK
03 Custom command 03: OK
Topgrade 10.3.1 I think this can be used as a workaround in conjunction with an old version of topgrade. |
Should work now |
thank you @DottoDev! Hopefully it can be published in crates.io soon. |
The crate is also updated now |
What did you expect to happen?
Topgrade runs all custom commands
What actually happened?
Topgrade stops after the first custom command when starting the second one and send itself in the background without continuing the scripts.
Topgrade hangs then in the background without continuing.
Downgrading to an older version did also not work, because it is automatically updated and I could not find an option to disable self-update.
So topgrade could not be used anymore.
Additional Details
New Contributors
Full Changelog: v10.3.1...v10.3.2
Respawning...
DEBUG Configuration at /home/reini/.config/topgrade.toml
DEBUG Path .config/PrusaSlicer expanded to .config/PrusaSlicer
DEBUG Loaded configuration: ConfigFile { pre_sudo: None, pre_commands: Some({}), post_commands: None, commands: Some({"01 Update downloaded apps": "
/bin/update_downloaded-apps.sh", "12 Create/update/.config/topgrade-myrepos", "20 Sync home with git": "/.ssh/config.known_hosts": "/.config/topgrade-ssh_config.known-hosts", "13 Create/update/.ssh/pssh_lists": "/.config/topgrade-pssh_lists", "14 Clone/update Git repositories (with MyRepos)": "/bin/sync-home-with-git.sh", "50 Backup": "/bin/backup-user", "90 Update & backup home routers": "/.config/topgrade-update_routers", "99 Status of Git repositories (with MyRepo)": "/.config/topgrade-myrepos --status"}), git_repos: None, predefined_git_repos: None, disable: Some([Myrepos]), ignore_failures: None, remote_topgrades: Some(["octoprint.lan"]), remote_topgrade_path: None, ssh_arguments: Some("-o ConnectTimeout=2"), git_arguments: None, tmux_arguments: None, set_title: None, display_time: None, display_preamble: None, assume_yes: Some(true), yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, python: None, no_retry: Some(true), run_in_tmux: None, cleanup: Some(true), notify_each_step: None, accept_all_windows_updates: None, skip_notify: None, bashit_branch: None, only: None, composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: Some(true), autoremove: None }), linux: Some(Linux { yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, arch_package_manager: None, show_arch_news: None, garuda_update_arguments: None, trizen_arguments: None, pikaur_arguments: None, pamac_arguments: None, dnf_arguments: None, nix_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, rpm_ostree: None, emerge_sync_flags: None, emerge_update_flags: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: Some([".config/PrusaSlicer"]), pull_predefined: None }), windows: Some(Windows { accept_all_updates: None, self_rename: None, open_remotes_in_new_terminal: None, enable_winget: None, wsl_update_pre_release: None, wsl_update_use_web_download: None }), npm: Some(NPM { use_sudo: None }), yarn: None, vim: None, firmware: Some(Firmware { upgrade: None }), vagrant: None, flatpak: Some(Flatpak { use_sudo: None }), distrobox: None }DEBUG Detected "/usr/bin/notify-send" as "notify-send"
DEBUG Version: 10.3.2
DEBUG OS: x86_64-unknown-linux-gnu
DEBUG Args { inner: ["/home/reini/bin/topgrade", "--only", "custom_commands", "-v"] }
DEBUG Binary path: Ok("/home/reini/bin/topgrade")
DEBUG Self Update: true
Due to a design issue with notify-send it could be that topgrade hangs when it's finished.
If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file.
If you don't want this message to appear any longer set display_preamble = false in the config file.
For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and #288.
DEBUG Detected "/usr/bin/git" as "git"
DEBUG Cannot find "doas"
DEBUG Cannot find "please"
DEBUG Detected "/usr/bin/sudo" as "sudo"
DEBUG Detected "/usr/bin/pwsh" as "pwsh"
DEBUG Executing command
/usr/bin/pwsh -NoProfile -Command 'Split-Path $profile'
DEBUG Path "/home/reini/.config/powershell" exists
DEBUG Path "/home/reini/.config/emacs" doesn't exist
DEBUG Path "/home/reini/.emacs.d" doesn't exist
DEBUG /home/reini/.ideavimrc does not exists
DEBUG /home/reini/.intellimacs does not exists
DEBUG /home/reini/.zshrc is a file. Checking /home/reini
DEBUG Checking if /home/reini is a git repository
DEBUG Executing command
/usr/bin/git rev-parse --show-toplevel
DEBUG Command failed: Err(
0: Command failed:
/usr/bin/git rev-parse --show-toplevel
1:
/usr/bin/git
failed: exit status: 128Location:
src/steps/git.rs:167
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.)
DEBUG /home/reini/.config/fish does not exists
DEBUG /home/reini/.config/openbox does not exists
DEBUG /home/reini/.config/bspwm does not exists
DEBUG /home/reini/.config/i3 does not exists
DEBUG /home/reini/.config/sway does not exists
DEBUG Checking if /home/reini/.config/powershell is a git repository
DEBUG Executing command
/usr/bin/git rev-parse --show-toplevel
DEBUG Command failed: Err(
0: Command failed:
/usr/bin/git rev-parse --show-toplevel
1:
/usr/bin/git
failed: exit status: 128Location:
src/steps/git.rs:167
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.)
DEBUG Step "01 Update downloaded apps"
── 11:17:42 - 01 Update downloaded apps ────────────────────────────────────────
DEBUG Executing command
/bin/bash -i -c ~/bin/update_downloaded-apps.sh
2023-03-13 11:17:42: Update as-tree
2023-03-13 11:17:43: Update bat
2023-03-13 11:17:43: Update delta
2023-03-13 11:17:44: Update fd
2023-03-13 11:17:44: Update fzf
2023-03-13 11:17:45: Update gitui
2023-03-13 11:17:45: Update hexyl
2023-03-13 11:17:45: Update lnav
ERROR: Download URL for lnav not available
2023-03-13 11:17:46: Update pandoc
2023-03-13 11:17:46: Update rclone
2023-03-13 11:17:47: Update ripgrep
2023-03-13 11:17:47: Update shellcheck
DEBUG Step "12 Create/update ~/.ssh/config.known_hosts"
── 11:17:48 - 12 Create/update ~/.ssh/config.known_hosts ───────────────────────
DEBUG Executing command
/bin/bash -i -c ~/.config/topgrade-ssh_config.known-hosts
[1]+ Stopped topgrade --only custom_commands -v
Ubuntu-22.04> reini@ubuntu:~$ jobs -l
[1]+ 36581 Stopped (tty input) topgrade --only custom_commands -v
Ubuntu-22.04> reini@ubuntu:~$ topgrade --version
Topgrade 10.3.2
See also my comment in pull request #347 (#347 (comment))
The text was updated successfully, but these errors were encountered: