cli icon indicating copy to clipboard operation
cli copied to clipboard

Fatal error after executing a deployment or a backup

Open PaperCoder opened this issue 11 months ago • 5 comments

I'm getting a Fatal Error after execution a deployment or backup with the Platform.sh CLI

Creating a backup of master.
Note: this may delete an older backup if the quota has been reached.

Are you sure you want to continue? [Y/n] y

Waiting for the activity: [bfk4u7pc2qtnq] User created a backup of Master

Creating backup of master
Created backup kv3x53whzxb7nunm4d5zktwdrq
[============================] 00:00:45 (complete)

The activity succeeded: [bfk4u7pc2qtnq] User created a backup of Master
Backup name: kv3x53whzxb7nunm4d5zktwdrq
Fatal error: Uncaught Error: Class "Symfony\Component\Console\Event\ConsoleTerminateEvent" not found in phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php:1036
Stack trace:
#0 phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/src/Application.php(429): Symfony\Component\Console\Application->doRunCommand(Object(Platformsh\Cli\Command\Backup\BackupCreateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php(255): Platformsh\Cli\Application->doRunCommand(Object(Platformsh\Cli\Command\Backup\BackupCreateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/bin/platform(37): Symfony\Component\Console\Application->run()
#4 /tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0(10): require('phar:///tmp/pla...')
#5 {main}
  thrown in phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php on line 1036

I'm getting the same Fatal Error when deploying. The task self is executed correctly and doesn't fail, but it seems, that the closing of the task is a problem.

I'm using the following Platform.sh CLI Version: Platform.sh CLI 5.0.23

PaperCoder avatar Jan 29 '25 10:01 PaperCoder

Update in this case: I'm now getting the error not only at the end of a task, also in between. For example:

platform domain:add example.com
Selected project: Example Project (rwiotbx4h3kju)
Selected environment: master (type: production)

Adding the domain: example.com

Are you sure you want to continue? [Y/n] 

Waiting for the activity: [wfm3gsrdxajli] User added domain example.com

[-->-------------------------] 00:00:03 (in progress)Fatal error: Uncaught Error: Class "Symfony\Component\Console\Event\ConsoleErrorEvent" not found in phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php:1027
Stack trace:
#0 phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/src/Application.php(429): Symfony\Component\Console\Application->doRunCommand(Object(Platformsh\Cli\Command\Domain\DomainAddCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php(255): Platformsh\Cli\Application->doRunCommand(Object(Platformsh\Cli\Command\Domain\DomainAddCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/bin/platform(37): Symfony\Component\Console\Application->run()
#4 /tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0(10): require('phar:///tmp/pla...')
#5 {main}
  thrown in phar:///tmp/platformsh-cli-8.2.26-4.22.0/phar-4.22.0/vendor/symfony/console/Application.php on line 1027

PaperCoder avatar Mar 12 '25 12:03 PaperCoder

I think this should be addressed in #94 :

Stop deleting the files on error, which prevents Phar class loading errors when a running Phar's file has disappeared.

pjcdawkins avatar Mar 12 '25 22:03 pjcdawkins

As in, I believe the problem you mention is triggered when you have >1 CLI process running concurrently on the same machine, and one command errors before the other finishes.

pjcdawkins avatar Mar 12 '25 22:03 pjcdawkins

@pjcdawkins what exactly do you mean with "on the same machine"? I just trigger one command after the other.

I'll check the behaviour with the new CLI version 5.1.0

PaperCoder avatar May 08 '25 13:05 PaperCoder

The CLI does configure OpenSSH, so that when you make an SSH connection to platform.sh, the CLI runs briefly to refresh certificates. So that's possibly what's happening while you're directly running another CLI command. If so, it should be resolved in 5.1.0.

pjcdawkins avatar May 08 '25 21:05 pjcdawkins

The update to the newest CLI version 5.1.0 fixed the problem🥳 t

PaperCoder avatar May 12 '25 10:05 PaperCoder