Skip to content
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

Cannot start env for local test #225

Open
Rho-bur opened this issue Dec 4, 2024 · 10 comments
Open

Cannot start env for local test #225

Rho-bur opened this issue Dec 4, 2024 · 10 comments

Comments

@Rho-bur
Copy link

Rho-bur commented Dec 4, 2024

Hi,
On Ubuntu 24.04.1 LTS I am trying to use the local test environment.
All packages are installed and updated, QIT is installed and connected.
However running qit env:up always finishes with error
`PHP Warning: file_get_contents(/home/robert/.config/woo-qit-cli/temporary-envs/e2e-67506b983c496//docker-compose.yml): Failed to open stream: No such file or directory in phar:///home/robert/.config/composer/vendor/woocommerce/qit-cli/qit/src/Environment/Environments/Environment.php on line 180

In Environment.php line 181:

Failed to start the environment. Output:
Creating network "e2e-67506b983c496_qit_network_67506b983c496" with driver "bridge"
Creating volume "e2e-67506b983c496_qit_env_volume_db_67506b983c496" with default driver
Creating qit_env_db_67506b983c496 ... done
Creating qit_env_cache_67506b983c496 ... d

ERROR: for qit_env_php_67506b983c496 Container "ef1fba113caa" is unhealthy.
ERROR: Encountered errors while bringing up the project`

I have pruned all docker history, tries different env variables but to no end.

@Rho-bur
Copy link
Author

Rho-bur commented Dec 4, 2024

Switching to docker-linux desktop gives more info:
`Downloading plugins and themes...
Starting Docker Environment...
PHP Warning: Failed loading Zend extension 'xdebug' (tried: /usr/lib/php/20220829/xdebug (/usr/lib/php/20220829/xdebug: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/xdebug.so (/usr/lib/php/20220829/xdebug.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: file_get_contents(/home/robert/.config/woo-qit-cli/temporary-envs/e2e-675071893cb9a//docker-compose.yml): Failed to open stream: No such file or directory in phar:///home/robert/.config/composer/vendor/woocommerce/qit-cli/qit/src/Environment/Environments/Environment.php on line 180

In Environment.php line 181:

Failed to start the environment. Output:
Creating network "e2e-675071893cb9a_qit_network_675071893cb9a" with driver "bridge"

ec658528c998: Downloading [==================================================>] 13.08MB/13.08MB
ae3ce2da3c77: Downloading [======>
ae3ce2da3c77: Downloading [======================
ec658528c998: Downloading [==================================================>] 13.08MB/1
ec658528c998: Downloading [======
============================================>] 13.08MB/13.08MB 490B/490B>] 392B/392B
ec658528c998: Downloading [==============================================
====>] 13.08MB/13.08MB
59fdbecde146: Downloading [==================================================>] 263B/263B
ec
ae3ce2da3c77: Downloading [=================
=================================>] 30.27MB/30.27MB==========>] 1.453MB/1.453MB
59fdbecde146: Downloading [==================================================>] 263B/263B
49ac
59fdbecde146: Downloading [===============================
cb1b491f05f3: Do
49ace4ad0bce: Downloading [==================================================>] 9.182kB/9.
182kBf05f3: Downloading [==================================================>] 86.06kB/86.06kB
cb1b491f05f3: Downloading [==================================================>
] 86.06kB/86.06kBad complete==============================================>] 9.182kB/9.182kB
cb1b491f05f3: Downloading [==================================================>] 86.06kB/86.06kB
=============>] 86.06kB/86.06kB 267B/267B
cb1b491f05f3: Download complete
69c1079a9afa: Download complet
dae3e00ca24c: Downloading [==================================================>] 490B/490B
0B8528c998: Downloading [==================================================>]
13.08MB/13.08MBloading [==================================================>] 2.45kB/2.4
69c1079a9afa: Downloading [==================================================>] 2.45kB/2.45kB
9afa: Download

1Be00ca24c: Downloading [==================================================>] 4
dae3e00ca24c: Downloading [==========================================
========>] 490B/490B
attic/qit-runner-php-8.3-fpm-alpine:latest
cfa431bda9d8: Downloading [==================================================>] 1.76
1MB/1.761MB Downloading [=====
49ace4ad0bce
: Downloading [==================================================>] 9.182kB/9.182kB
dae3e00ca24c: Downloadin
g [==================================================>] 490B/490B======>] 86.06kB/86.0
ae3ce2da3c77: Downloading [==================================================>] 30.27MB/30.27MB
[14B59fdbecde146: Downloading [==================================================>] 263B/263B
83bb70580b00: Downloading [==================================================>] 19.3kB/19.3kB
59fdbecde146: Downloading [==================================================>] 263B/263B
] 1.761MB/1.761MBading [=======================
===========================>] 12.46MB/12.46MB
loading [==================================================>] 2.45kB/2.45kB 2.45kB/2.45kB
dae3e00ca24c: Downloading [====
==============================================>] 490B/490B=============>]
5
4a19c07bc2e: Downloading [==================================================>] 267B/267B
6320f67eb626: Downloading [============ ===================>] 392B/392B
49ace4ad0bce: Downloading [==================================================>] 9.182kB/9.182kB
da1b90e62964: Down
loading [==================================================>] 12.46MB/12.46MB
69c1079a9afa: Downloading [==================================================>] 2.45kB/2.45kB
===================================>] 86.06kB/86.06kB
59fdbecde146: Downloading [=============================
cb1b491f05f3: Downloading [==================================================>]
4 de146: Downloading [==================================================>] 263B/263B
59fdbecde146: Downloadi [==================================================>] 9.182kB/9.182kB
54a19c07bc2e: Downloading [===================== =====>] 263B/263B
cfa431bda9d8: Downloading [===========================================
54a19c07bc2e: Downloading [==================================================>] 267B/267B
`

@Luc45
Copy link
Member

Luc45 commented Dec 4, 2024

If you run the command qit env:up -vvv, does it display any additional information that might provide a better hint about what's happening?

Additionally, I'd recommend addressing this xdebug error on your local PHP installation to ensure it's not causing any interference. You can paste this error into ChatGPT or a similar tool for help:

PHP Warning: Failed loading Zend extension 'xdebug' (tried: /usr/lib/php/20220829/xdebug (cannot open shared object file: No such file or directory), /usr/lib/php/20220829/xdebug.so (cannot open shared object file: No such file or directory)) in Unknown on line 0

@Rho-bur
Copy link
Author

Rho-bur commented Dec 9, 2024

Hello,
Sorry for the delayed reply, I was out the city for a few days.
So, the fact is I was able to run this only on a macos box but not on my main Ubuntu machine.
I have switched to PHP8.3 with no debug on and run the env:up with the -vvv switch.
I am attaching the result in .txt1.txt
.

@Luc45
Copy link
Member

Luc45 commented Dec 9, 2024

If you'd like I could do an AnyDesk session to debug this on your PC. Just send me your AnyDesk ID on lucas.bustamante@automattic.com

Alternatively, check things like docker ps, docker ps -a, try to do docker inspect --format "{{json .State.Health }}" qit_env_db_6756d38daaa9d, etc.

@Rho-bur
Copy link
Author

Rho-bur commented Dec 9, 2024

None of the commands give any feedback because at the time of running them that container is no more, being removed by the qit script because of the unhealthy status.
I don't have AnyDesk now installed but I'll install it tomorrow and send you the ID thank you very much.
What would be a good time interval for you?

@Luc45
Copy link
Member

Luc45 commented Dec 9, 2024

Sounds good. What I will do in this session is the following, if you'd like to do this yourself:

  • I'll clone/download this repo locally
  • I'll run php qit-cli.php env:up from the src directory with a breakpoint at line 304, eg:

\QIT_CLI\Environment\Environments\Environment::up_docker_compose

		if ( ! $up_process->isSuccessful() ) {
			static::down( $this->env_info );
			$this->output->writeln( file_get_contents( $this->env_info->temporary_env . '/docker-compose.yml' ) );
			throw new \RuntimeException( "Failed to start the environment. Output: \n" . $up_process->getOutput() . $up_process->getErrorOutput() );
		}

To basically prevent the environment from going down on a failure, and then I'll try to inspect the healthcheck of the DB container that is failing.

@Rho-bur
Copy link
Author

Rho-bur commented Dec 9, 2024

Thank you for explaining..then, in order to save you the time I'll do these steps myself and report back to you the result.

@Luc45
Copy link
Member

Luc45 commented Dec 16, 2024

howdy @Rho-bur, were you able to figure it out, after all?

@Rho-bur
Copy link
Author

Rho-bur commented Dec 16, 2024

Hello @Luc45
Unfortunately not and I apologize for this especially being me the reporter.
I was over my head at work with the usual plus the need to get acquainted with locally testing my company's plugin with QIT on macos where I could install and use it.
I am planning to resume on debugging QIT on latest Ubuntu according to the above received instruction tomorrow or the day after.
I am appreciating your hard work on developing this platform and will update you about what I find here.

@Luc45
Copy link
Member

Luc45 commented Dec 16, 2024

@Rho-bur No worries at all, thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants