All artisan commands fail on OpenWrt with status code 255
Debug mode
- [X] I have enabled debug mode
- [X] I have read checked the Common Issues page
Describe the bug
I spend the last few days trying to install Snipe-IT on my Wi-Fi router to no avail. All minor issues were solved, but I got stuck when trying to run composer install --no-dev --prefer-install=source command. All dependencies were downloaded into Composer cache and installed to the project successfully, after that it tried to run 2 PHP artisan commands:
"post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi", "@php artisan vendor:publish --force --tag=livewire:assets --ansi" ]
... and fail with @php artisan package:discover --ansi returning status code 255.
I soon found out that all php artisan commands fail with that error code, with no output on terminal.
By installing the package php8-mod-snmp, all php artisan commands now complain about missing SNMP MIBs before exiting with code 255. I don't why Snipe-IT needs SNMP, please see the error messages below.
I install the package "snmp-mibs" to stop it from complaining, and it again exits silently with code 255.
I created a new random project with Composer, and basic commands like php artisan --version and php artisan list worked.
Reproduction steps
- Fresh install OpenWrt 22.03.0-rc5
- Install PHP and required extensions as described in https://snipe-it.readme.io/docs/requirements and
composer.json. In fact, I already tried to install all php8-* packages. - Pull Snipe-IT 6.0.8 from GitHub
- Install Composer
- Run
composer installto download all dependencies ...
Expected behavior
All php artisan commands should work. Or at least it should show some error messages.
Screenshots
No response
Snipe-IT Version
6.0.8
Operating System
OpenWrt 22.03.0-rc5
Web Server
Nginx
PHP Version
8.1.7
Operating System
No response
Browser
No response
Version
No response
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
nginx@OpenWrt:/mnt/storage/www/snipe-it$ php-cli artisan --version
nginx@OpenWrt:/mnt/storage/www/snipe-it$ echo $?
255
# opkg install "php8-mod-snmp";
nginx@OpenWrt:/mnt/storage/www/snipe-it$ php-cli artisan --version
MIB search path: /home/nginx/.snmp/mibs:/usr/share/snmp/mibs
Cannot find module (NET-SNMP-EXTEND-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none)
Cannot find module (DISMAN-SCHEDULE-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (TUNNEL-MIB): At line 0 in (none)
Cannot find module (IPV6-FLOW-LABEL-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-PASS-MIB): At line 0 in (none)
nginx@OpenWrt:/mnt/storage/www/snipe-it$ echo $?
255
# opkg install "snmp-mibs";
nginx@OpenWrt:/mnt/storage/www/snipe-it$ php-cli artisan --version
nginx@OpenWrt:/mnt/storage/www/snipe-it$ echo $?
255
# I tried to set permission 777 on '/usr/share/snmp/mibs', but it did not change anything
Additional context
It is easy to test and reproduce this bug by downloading an OpenWrt amd64 image and boot it on QEMU. I test on a real armv7 device, but it should not matter.
If anyone is interested in debugging this but got stuck working on OpenWrt, I can provide more details how to set it up.
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Puzzling for sure. Snipe-IT itself does not require SNMP, so not exactly sure what’s happening here, but @uberbrady can probably dig a little deeper.