Commit graph

107 commits

Author SHA1 Message Date
Andras Bacsai
ed979f42ef Fix SSH multiplexing contention for concurrent scheduled tasks (#6736)
When multiple scheduled tasks or database backups run concurrently on
the same server, they compete for the same SSH multiplexed connection
socket, causing race conditions and SSH exit code 255 errors.

This fix adds a `disableMultiplexing` parameter to bypass SSH
multiplexing for jobs that may run concurrently:

- Add `disableMultiplexing` param to `generateSshCommand()`
- Add `disableMultiplexing` param to `instant_remote_process()`
- Update `ScheduledTaskJob` to use `disableMultiplexing: true`
- Update `DatabaseBackupJob` to use `disableMultiplexing: true`
- Add debug logging to track execution without multiplexing
- Add unit tests for the new parameter

Each backup and scheduled task now gets an isolated SSH connection,
preventing contention on the shared multiplexed socket.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 09:54:30 +01:00
Andras Bacsai
05fc5d70c5 Fix: Pass backup timeout to remote SSH process
Allows user-configured backup timeouts > 3600 to be respected. Previously, the SSH process used a hardcoded 3600 second timeout regardless of the job timeout setting. Now the timeout is passed through to instant_remote_process() for all backup operations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:37:38 +01:00
Andras Bacsai
b90ff0e09a refactor(remoteProcess): remove redundant file transfer functions for improved clarity 2025-09-22 12:54:37 +02:00
Andras Bacsai
60e31a1381 refactor(remoteProcess): remove file transfer handling from remote_process and instant_remote_process functions to simplify code 2025-09-15 17:59:35 +02:00
Andras Bacsai
393745b68c Revert "refactor(file-transfer): replace base64 encoding with direct file transfer method across multiple database actions for improved clarity and efficiency"
This reverts commit 18068857b1.
2025-09-15 17:55:08 +02:00
Andras Bacsai
3255f42385 refactor(remoteProcess): remove command log comments for file transfers to simplify code 2025-09-15 15:39:27 +02:00
Andras Bacsai
f18dff186d refactor(remoteProcess): remove debugging statement from transfer_file_to_container function for cleaner code 2025-09-10 13:25:23 +02:00
Andras Bacsai
ccc9ceb734 refactor(remoteProcess): remove debugging statement from transfer_file_to_server function to clean up code 2025-09-09 08:56:16 +02:00
Andras Bacsai
18068857b1 refactor(file-transfer): replace base64 encoding with direct file transfer method across multiple database actions for improved clarity and efficiency 2025-09-08 14:04:24 +02:00
Andras Bacsai
4bd29bf966 refactor(ssh): enhance error handling in SSH command execution and improve connection validation logging 2025-09-07 18:45:44 +02:00
Andras Bacsai
579cc25898 fix(ssh): introduce SshRetryHandler and SshRetryable trait for enhanced SSH command retry logic with exponential backoff and error handling 2025-09-07 17:17:35 +02:00
Andras Bacsai
81d6cb539b refactor(remoteProcess): update sanitize_utf8_text function to accept nullable string parameter for improved type safety 2025-06-10 10:53:23 +02:00
Andras Bacsai
8e8400f595 feat(utf8-handling): implement UTF-8 sanitization for command outputs and enhance error handling in logs processing 2025-06-05 14:27:39 +02:00
Andras Bacsai
b7d18fc28c fix: getcontainer status should timeout after 30s 2025-01-10 12:04:59 +01:00
Lucas Michot
b1d04912a0 Remove all useless catch block useless variables. 2024-10-31 15:19:37 +01:00
Andras Bacsai
9518040d23 refactor: Remove CleanupSshKeysJob from schedule in Kernel.php 2024-09-19 12:06:56 +02:00
peaklabs-dev
42ff7b19a4
Fix: Few multiplexing things 2024-09-17 15:54:22 +02:00
peaklabs-dev
144508218e
Fix: SSH multiplexing 2024-09-17 12:26:11 +02:00
peaklabs-dev
f9375f91ec
Feat: Create a Multiplexing Helper 2024-09-16 22:33:43 +02:00
peaklabs-dev
86722939cd
Fix. Remove write to SSH key on every remote command execution 2024-09-16 21:34:27 +02:00
Andras Bacsai
8862b50c98 chore: Remove unnecessary SSH command execution time logging 2024-09-12 12:42:47 +02:00
Andras Bacsai
16e472da19 chore: Update constants.ssh.mux_enabled in remoteProcess.php 2024-09-12 12:16:20 +02:00
Andras Bacsai
a95ebb4d56
Merge branch 'next' into fix-ssh-multiplexing-docker-desktop-windows 2024-09-12 12:14:24 +02:00
Andras Bacsai
75f266fa9f fix: cloudflare tunnel with new multiplexing feature 2024-09-12 12:07:50 +02:00
peaklabs-dev
4aeb8ff02b
Fix: SSH Multiplexing on docker desktop on Windows 2024-09-12 10:40:06 +02:00
Andras Bacsai
c7c2924990 fix: Update remoteProcess.php to handle null values in logItem properties 2024-09-10 12:05:10 +02:00
Andras Bacsai
77455cd444 fix: scp through cloudflare 2024-09-10 10:19:13 +02:00
Andras Bacsai
1d72f76072 fix: appwrite template + parser 2024-09-09 15:04:51 +02:00
peaklabs-dev
c8218e6901
Fix: Enabel mux 2024-09-08 19:15:37 +02:00
peaklabs-dev
cc10d08a7c
Feat: Implement SSH Multiplexing 2024-09-08 18:13:00 +02:00
Andras Bacsai
e4854aaa1b Refactor muxFilename method to use UUID instead of IP, port, and user 2024-09-05 14:41:04 +02:00
mahansky
3b533c7d06
fix same commands different batch 2024-09-04 13:57:03 +02:00
mahansky
63a07e7649
deployment log improvements 2024-09-03 20:09:42 +02:00
Andras Bacsai
3f9f197282 fix: docker cleanup job 2024-08-21 10:50:05 +02:00
Thijmen
d86274cc37 Fix styling 2024-06-10 20:43:34 +00:00
Andras Bacsai
4ab3f41665 Remove debug statement in remoteProcess.php 2024-04-17 12:47:45 +02:00
Andras Bacsai
35b07a9c18 Refactor code to add sudo prefix for certain commands in multiple files 2024-04-17 10:49:34 +02:00
Andras Bacsai
41f4b36593 wip: non-root 2024-04-16 20:57:54 +02:00
Andras Bacsai
a04c7831b1 wip: non-root user for remote servers 2024-04-16 15:42:38 +02:00
Andras Bacsai
cbd2580736 Fix SSH command generation in remoteProcess.php 2024-04-15 11:46:23 +02:00
Andras Bacsai
933e395945 feat: dynamic mux time 2024-04-12 23:50:23 +02:00
Andras Bacsai
ff79a2d3f4 Commented out ray() function call in remoteProcess.php 2024-04-09 13:02:16 +02:00
Andras Bacsai
353245bb7d fix: hashed random delimeter in ssh commands + make sure to remove the delimeter from the command 2024-04-09 11:48:57 +02:00
Andras Bacsai
a9cc5cc351 Fix server functionality check and cleanup SSH keys 2024-04-09 08:46:00 +02:00
Andras Bacsai
2509406d1c fix: startproxy event
fix: add data to async remove processes
2024-03-12 11:22:02 +01:00
Andras Bacsai
af3c575d84 fix: server disabled 2024-02-26 14:22:24 +01:00
Andras Bacsai
bba1cb3832 fix: ec2 does not have uptime command lol
version++
2024-02-15 13:44:40 +01:00
Andras Bacsai
788d1711db Refactor SSH command generation in remoteProcess.php 2024-01-26 09:36:08 +01:00
Andras Bacsai
7e9a54ce67 Fix SSH command generation and disable mux in validateConnection() 2024-01-26 08:54:56 +01:00
Andras Bacsai
f8c19e1fb3 Update contact links in error and subscription views 2024-01-26 08:39:54 +01:00