craftcms / nitro

Speedy local dev environment for @craftcms.
https://getnitro.sh
MIT License
178 stars 24 forks source link

Error: exit status 255 #454

Closed AndrewMac closed 2 years ago

AndrewMac commented 2 years ago

Description

I've just started getting nitro errors when trying to install plugins. Any idea what be might on? I've never run into this before and can't find anything about the error

Steps to reproduce

nitro craft plugin/install whatever-plugin
connecting to spm.nitro
*** installing whatever-plugin
Error: exit status 255

Additional info

AndrewMac commented 2 years ago

Please help! I'm running into this "error status 255" with all kinds of stuff now. Can someone explain what it means, and what I should do? I'm tempted to uninstall and reinstall Nitro, but I don't know if I will lose my sites if I do that?

jasonmccallister commented 2 years ago

Hi @AndrewMac, can you skip the nitro craft command and use nitro ssh and then when in the machine run php plugin/install whatever-plugin?

AndrewMac commented 2 years ago

Hi @jasonmccallister, and thanks for picking this up.

I'm afraid nothing happens when I ssh in. I get no feedback from any craft commands.

For example:

/app $ php craft context
/app $
AndrewMac commented 2 years ago

I just tried creating a new Craft site, using 'nitro create ...' and I got an error during setup/welcome:

> @php craft setup/welcome

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28. in /app/vendor/composer/platform_check.php on line 24

Call Stack:
    0.0008     604632   1. {main}() /app/craft:0
    0.0022     607400   2. require('/app/bootstrap.php') /app/craft:8
    0.0027     608488   3. require_once('/app/vendor/autoload.php') /app/bootstrap.php:11
    0.0045     621960   4. ComposerAutoloaderInitb9e92cb94c5cb63a6c63424c2c7eaedb::getLoader() /app/vendor/autoload.php:7
    0.0063     626592   5. require('/app/vendor/composer/platform_check.php') /app/vendor/composer/autoload_real.php:25
    0.0063     627168   6. trigger_error($message = 'Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28.', $error_type = 256) /app/vendor/composer/platform_check.php:24

Script @php craft setup/welcome handling the post-create-project-cmd event returned with error code 255

I was, however, able to nitro ssh and run install/welcome there, which worked.

Funny thing about the error above, though, is that I'm running PHP 8, not 7.

 ~/Sites/dev/craft> php -v
PHP 8.1.3 (cli) (built: Mar  1 2022 09:21:02) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.3, Copyright (c), by Zend Technologies
 ~/Sites/dev/craft> which php
/usr/local/bin/php

I don't really know what's going on, things have been working just fine for months, but suddenly ...

AndrewMac commented 2 years ago

Thanks so much for your help, but it looks like I might have been wasting your time. Sorry about that!

I think I might have solved the issue. I traced things back to a plugin called "Click and Collect". It's been installed for quite some time now, but for some reason it has just now started to cause problems on my local dev environment. I'm not actually sure what changed to make it start playing up, and it still seems to be working on the live site, but strangely it's started causing all sorts of problems locally — first the nitro issues and then (after I rebuilt the nitro environment for the local site, white screens for Craft itself). I've now removed it, and Nitro commands seem to have started working again.

I've also put in a feature request for Commerce to add that click-and-collect function ;-)

AndrewMac commented 2 years ago

Everything is continuing to work as expected after removing the plugin that looked to be causing the problem.