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

Snipeit 8.0.0 installation throwing Undefined constant "Symfony\Component\Console\Helper\STDIN" #16331

Closed
prbt2016 opened this issue Feb 25, 2025 · 5 comments

Comments

@prbt2016
Copy link

Hello,

I was in the process of manual installation of SnipeIT on AlmaLinux release 8.10 with
PHP 8.2, MYSQL 5.7, Apache 2.4 .

I used the following steps :

  1. Download Snipeit from https://github.com/snipe/snipe-it/archive/refs/tags/v8.0.0.zip
  2. Install composer in the project directory i.e curl -sS https://getcomposer.org/installer | php
  3. Run php composer.phar install --no-dev inside the project directory.
  4. Rename .env.example to .env and fill database , URL details
  5. Run php artisan key:generate to generate APP_KEY in .env file.
  6. Run php artisan migrate to populate db tables.
  7. Visit http://{{URL}}/{{TO}}/{{SNIPEIT}}/public/setup
  8. On clicking 'Next Create Database user tables' following error is thrown i.e :500 server error
  9. To debug I set APP_DEBUG=true in .env file and re-ran whole above process again
  10. Following error is thrown i.e Undefined constant "Symfony\Component\Console\Helper\STDIN". Have attached screenshot of the same :

Image

On refreshing the page i get 'Your database tables have been created' and able to proceed further.

Could you please replicate this at your end ?.

@snipe
Copy link
Owner

snipe commented Feb 25, 2025

Well that's a new one. I can't currently reproduce it, but we do use Alma for (most of) our hosted servers.

If you add the following to your index.php file in the public directory, does that work?

if(! defined('STDIN')) define('STDIN', fopen("php://stdin","r"));

Some related things I've found, just for reference:

It looks like running artisan with the --force flag handles this, but I don't think we do that within the code (because we don't normally have to.)

Laracasts
This is because Laravel will try to prompt for confirmation if the application is running in the production environment. While doing so, the Symfony/Console component will use the build-in STDIN constant to capture the input stream. And that constant is only available in the CLI environment.

@uberbrady
Copy link
Collaborator

I think the passport:install command has somehow 'gained' interactivity, when it didn't have it before.

So we never had to say --force or anything like that in the past, because it never asked any questions on STDIN. But, apparently, now it does.

So I think we can add the flag: --no-interaction to the passport:install command it and should "Just Work™".

snipe added a commit that referenced this issue Feb 25, 2025
…raction

Fixes #16331 - Don't make passport:install command require user input
@snipe snipe closed this as completed in bce2007 Feb 26, 2025
@prbt2016
Copy link
Author

Hello @uberbrady ,

The fix works fine . I have tested it.

But it isn't added to SnipeIT 8.0.1 release zip https://github.com/snipe/snipe-it/archive/refs/tags/v8.0.1.zip and got same error on installation.

It's on master branch bce2007

Any ETA for the same ?

@uberbrady
Copy link
Collaborator

It should be in 8.0.2

@prbt2016
Copy link
Author

Thanks 👍 . Checked with 8.0.2 and works fine now.

Regards.

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

3 participants