-
Notifications
You must be signed in to change notification settings - Fork 133
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
[BUG] The callback is not executed #236
Comments
What If I stop |
Weird, could you provide me with the exact key + value callback config you're trying to execute? |
You can use the example from the wiki:
or |
This is super weird. I'm using the exact same version of Pueue on the same Linux distribution, but I cannot reproduce your issue, even when taking the exact line you posted above. Callbacks seem to work perfectly fine. The fact that its Could you check Stop any previous pueued instances and run Just execute any command with |
Below is a session which demonstrates the issue. You can see
[vasily@vostro ~]$ bat /home/vasily/.local/share/pueue/state.json
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: /home/vasily/.local/share/pueue/state.json
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ {
2 │ "settings": {
3 │ "client": {
4 │ "restart_in_place": false,
5 │ "read_local_logs": true,
6 │ "show_confirmation_questions": false,
7 │ "show_expanded_aliases": false,
8 │ "dark_mode": false,
9 │ "max_status_lines": null,
10 │ "status_time_format": "%H:%M:%S",
11 │ "status_datetime_format": "%Y-%m-%d\n%H:%M:%S"
12 │ },
13 │ "daemon": {
14 │ "default_parallel_tasks": 1,
15 │ "pause_group_on_failure": false,
16 │ "pause_all_on_failure": false,
17 │ "callback": "touch ~/old",
18 │ "callback_log_lines": 10,
19 │ "groups": { "default": 1 }
20 │ },
21 │ "shared": {
22 │ "pueue_directory": "/home/vasily/.local/share/pueue",
23 │ "use_unix_socket": true,
24 │ "unix_socket_path": "/home/vasily/.local/share/pueue/pueue_vasily.socket",
25 │ "host": "127.0.0.1",
26 │ "port": "6924",
27 │ "daemon_cert": "/home/vasily/.local/share/pueue/certs/daemon.cert",
28 │ "daemon_key": "/home/vasily/.local/share/pueue/certs/daemon.key",
29 │ "shared_secret_path": "/home/vasily/.local/share/pueue/shared_secret"
30 │ }
31 │ },
32 │ "tasks": {},
33 │ "groups": { "default": "Running" },
34 │ "config_path": null
35 │ }
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[vasily@vostro ~]$
[vasily@vostro ~]$ bat ~/.config/pueue/pueue.yml
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: /home/vasily/.config/pueue/pueue.yml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ ---
2 │ client:
3 │ restart_in_place: false
4 │ read_local_logs: true
5 │ show_confirmation_questions: false
6 │ show_expanded_aliases: false
7 │ dark_mode: false
8 │ max_status_lines: ~
9 │ status_time_format: "%H:%M:%S"
10 │ status_datetime_format: "%Y-%m-%d\n%H:%M:%S"
11 │ daemon:
12 │ default_parallel_tasks: 1
13 │ pause_group_on_failure: false
14 │ pause_all_on_failure: false
15 │ callback: "touch ~/new"
16 │ callback_log_lines: 10
17 │ groups: {}
18 │ shared:
19 │ pueue_directory: /home/vasily/.local/share/pueue
20 │ use_unix_socket: true
21 │ unix_socket_path: /home/vasily/.local/share/pueue/pueue_vasily.socket
22 │ host: 127.0.0.1
23 │ port: "6924"
24 │ daemon_cert: /home/vasily/.local/share/pueue/certs/daemon.cert
25 │ daemon_key: /home/vasily/.local/share/pueue/certs/daemon.key
26 │ shared_secret_path: /home/vasily/.local/share/pueue/shared_secret
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[vasily@vostro ~]$
[vasily@vostro ~]$ exa -l ~/{new,old}
"/home/vasily/new": No such file or directory (os error 2)
"/home/vasily/old": No such file or directory (os error 2)
[vasily@vostro ~]$
[vasily@vostro ~]$ pwd
/home/vasily
[vasily@vostro ~]$
[vasily@vostro ~]$ pueued -vvv
09:31:36 [INFO] Parsing config files
09:31:36 [INFO] Checking path: "/etc/pueue/pueue.yml"
09:31:36 [INFO] Checking path: "/home/vasily/.config/pueue/pueue.yml"
09:31:36 [INFO] Found config file at: "/home/vasily/.config/pueue/pueue.yml"
09:31:36 [INFO] Checking path: "./pueue.yml"
09:31:36 [INFO] Start restoring state
09:31:36 [DEBUG] (1) pueue_daemon_lib::state_helper: State saved at: "/home/vasily/.local/share/pueue/state.json"
09:31:45 [DEBUG] (4) pueue_lib::network::protocol: Received 3987 bytes
09:31:45 [DEBUG] (4) pueue_lib::network::protocol: Received message: Add(AddMessage { command: "sleep 2", path: "/home/vasily", envs: {"[REDACTED]": "[REDACTED]"}, start_immediately: false, stashed: false, group: "default", enqueue_at: None, dependencies: [], label: None, print_task_id: false })
09:31:45 [DEBUG] (4) pueue_daemon_lib::network::socket: Received instruction: Add(AddMessage { command: "sleep 2", path: "/home/vasily", envs: {"[REDACTED]": "[REDACTED]"}, start_immediately: false, stashed: false, group: "default", enqueue_at: None, dependencies: [], label: None, print_task_id: false })
09:31:45 [INFO] Didn't find pueue alias file.
09:31:45 [DEBUG] (4) pueue_daemon_lib::state_helper: State saved at: "/home/vasily/.local/share/pueue/state.json"
09:31:45 [DEBUG] (4) pueue_lib::network::protocol: Sending message: Success("New task added (id 0).")
09:31:45 [INFO] Started task: sleep 2
09:31:45 [DEBUG] (7) pueue_daemon_lib::state_helper: State saved at: "/home/vasily/.local/share/pueue/state.json"
09:31:47 [INFO] Task 0 just finished
09:31:47 [DEBUG] (7) pueue_daemon_lib::task_handler::callback: Spawned callback for task 0
09:31:47 [DEBUG] (7) pueue_daemon_lib::state_helper: State saved at: "/home/vasily/.local/share/pueue/state.json"
09:31:47 [INFO] Callback finished with exit code Some(ExitStatus(ExitStatus(0)))
09:31:53 [DEBUG] (5) pueue_lib::network::protocol: Received 25 bytes
09:31:53 [DEBUG] (5) pueue_lib::network::protocol: Received message: Clean(CleanMessage { successful_only: true })
09:31:53 [DEBUG] (5) pueue_daemon_lib::network::socket: Received instruction: Clean(CleanMessage { successful_only: true })
09:31:53 [DEBUG] (5) pueue_daemon_lib::state_helper: State saved at: "/home/vasily/.local/share/pueue/state.json"
09:31:53 [DEBUG] (5) pueue_daemon_lib::state_helper: State saved at: "/home/vasily/.local/share/pueue/state.json"
09:31:53 [DEBUG] (5) pueue_lib::network::protocol: Sending message: Success("All successfully finished tasks have been removed")
^C09:31:58 [INFO] Killing all running tasks
09:31:58 [DEBUG] (7) pueue_daemon_lib::state_helper: State saved at: "/home/vasily/.local/share/pueue/state.json"
[vasily@vostro ~]$
[vasily@vostro ~]$ pueue add -- sleep 2
New task added (id 0).
[vasily@vostro ~]$ pueue clean -s
All successfully finished tasks have been removed
[vasily@vostro ~]$
[vasily@vostro ~]$ exa -l ~/{old,new}
"/home/vasily/new": No such file or directory (os error 2)
.rw-r--r-- 0 vasily 7 сеп 12:23 /home/vasily/old
[vasily@vostro ~]$
[vasily@vostro ~]$ bat ~/.config/pueue/pueue.yml
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: /home/vasily/.config/pueue/pueue.yml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ ---
2 │ client:
3 │ restart_in_place: false
4 │ read_local_logs: true
5 │ show_confirmation_questions: false
6 │ show_expanded_aliases: false
7 │ dark_mode: false
8 │ max_status_lines: ~
9 │ status_time_format: "%H:%M:%S"
10 │ status_datetime_format: "%Y-%m-%d\n%H:%M:%S"
11 │ daemon:
12 │ default_parallel_tasks: 1
13 │ pause_group_on_failure: false
14 │ pause_all_on_failure: false
15 │ callback: touch ~/new
16 │ callback_log_lines: 10
17 │ groups: {}
18 │ shared:
19 │ pueue_directory: /home/vasily/.local/share/pueue
20 │ use_unix_socket: true
21 │ unix_socket_path: /home/vasily/.local/share/pueue/pueue_vasily.socket
22 │ host: 127.0.0.1
23 │ port: "6924"
24 │ daemon_cert: /home/vasily/.local/share/pueue/certs/daemon.cert
25 │ daemon_key: /home/vasily/.local/share/pueue/certs/daemon.key
26 │ shared_secret_path: /home/vasily/.local/share/pueue/shared_secret
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[vasily@vostro ~]$
[vasily@vostro ~]$ bat /home/vasily/.local/share/pueue/state.json
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: /home/vasily/.local/share/pueue/state.json
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ {
2 │ "settings": {
3 │ "client": {
4 │ "restart_in_place": false,
5 │ "read_local_logs": true,
6 │ "show_confirmation_questions": false,
7 │ "show_expanded_aliases": false,
8 │ "dark_mode": false,
9 │ "max_status_lines": null,
10 │ "status_time_format": "%H:%M:%S",
11 │ "status_datetime_format": "%Y-%m-%d\n%H:%M:%S"
12 │ },
13 │ "daemon": {
14 │ "default_parallel_tasks": 1,
15 │ "pause_group_on_failure": false,
16 │ "pause_all_on_failure": false,
17 │ "callback": "touch ~/old",
18 │ "callback_log_lines": 10,
19 │ "groups": { "default": 1 }
20 │ },
21 │ "shared": {
22 │ "pueue_directory": "/home/vasily/.local/share/pueue",
23 │ "use_unix_socket": true,
24 │ "unix_socket_path": "/home/vasily/.local/share/pueue/pueue_vasily.socket",
25 │ "host": "127.0.0.1",
26 │ "port": "6924",
27 │ "daemon_cert": "/home/vasily/.local/share/pueue/certs/daemon.cert",
28 │ "daemon_key": "/home/vasily/.local/share/pueue/certs/daemon.key",
29 │ "shared_secret_path": "/home/vasily/.local/share/pueue/shared_secret"
30 │ }
31 │ },
32 │ "tasks": {},
33 │ "groups": { "default": "Running" },
34 │ "config_path": null
35 │ }
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[vasily@vostro ~]$ |
Daamn. During the large-scale refactoring for v1.0.0, the logic for overwriting the settings on the recovered state of the previous session got somehow lost. I'll fix this in a patch release as soon as I managed to reproduce this in tests. I want some regression tests for this. Thanks for your detailed bug report and detailed log outputs. |
New patch has been released |
Describe the bug
The callback is not executed.
To Reproduce
Put any command with visible effect as
daemon.callback
in~/.config/pueue/pueue.yml
.There are examples in the wiki, or just
touch
a file in the home directory.Restart the daemon:
systemctl --user restart pueued.service
Add an example task:
pueue add -- sleep 2
Expected behavior
The callback should run when the task finishes.
I don't see a notification when I try the
notify-send
example. When I try totouch
a file as a callback - no file is created. The log doesn't say anything about a callback:It seems that it isn't executed.
Additional context
I'm using pueue 1.0.1 on Arch Linux, installed from the
community
with pacman.The text was updated successfully, but these errors were encountered: