snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.9k stars 3.15k forks source link

Function mcrypt_get_iv_size() is deprecated error when running php artisan snipeit:legacy-recrypt #7606

Closed asmiah closed 4 years ago

asmiah commented 4 years ago

Please confirm you have done the following before posting your bug report:

Describe the bug Getting below error when running: php artisan snipeit:legacy-recrypt as per: https://snipe-it.readme.io/v4.0/docs/upgrading-to-v4

In McryptEncrypter.php line 46:

Function mcrypt_get_iv_size() is deprecated

To Reproduce Steps to reproduce the behavior:

  1. running upgrade from v3 to v4 and trying to Step 10

Expected behavior For the command to just work?

Screenshots image

Server (please complete the following information):

Desktop (please complete the following information):

Smartphone (please complete the following information):

Error Messages

In McryptEncrypter.php line 46:

Function mcrypt_get_iv_size() is deprecated

from laravel.log production.ERROR: Function mcrypt_get_iv_size() is deprecated {"exception":"[object] (ErrorException(code: 0): Function mcrypt_get_iv_size() is deprecated at /var/www/html/snipeit/app/LegacyEncrypter/McryptEncrypter.php:46)

Additional context

Add any other context about the problem here.

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

hapm commented 4 years ago

Looks like the reencryption tool is broken for php >= 7.2. You could still run it on >=7.1.2 and <7.2, but the command will not work with 7.3 for sure. As for expected behaviour: there should be a check, that errors out cleanly when the command is run on php>=7.2.

asmiah commented 4 years ago

Okay I'll roll back and try again :(

asmiah commented 4 years ago

@hapm Thanks for your prompt response, not sure if you can help with this, I had got this error initially but didn't ask after your last comment as I assumed it may also be php 7.3 related.

So I have reverted back to a snapshot and upgraded to php 7.1 now.

Snipe loads but in the laravel.log I can see the below:

[2019-11-20 13:41:27] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined function App\Models\ldap_connect()' in /var/www/html/snipeit/app/Models/Ldap.php:43

php ldap is installed if I run: yum install php-ldap

I see:

Package php-ldap-7.1.33-1.el7.remi.x86_64 already installed and latest version Nothing to do

Any ideas?

hapm commented 4 years ago

Check if the ldap module is enabled:

php -m | grep ldap

If not, enable it as is appropriate for your plattform, possibly one of:

php7enmod ldap 
php7enmod php-ldap
phpenmod ldap
phpenmod php-ldap

If the module is enabled, but not recognized, this could mean there is a different php configuration loaded for your site. Put a phpinfo file in your public folder and visit it to check the php environment configuration.

asmiah commented 4 years ago

So regardless of what I did and what version of PHP I used I was unable to do an in place upgrade of Snipe on the same server running php5.6 and trying to upgrade to php7.1 php7.2 and php7.3

I then resulted to setting up a new server with php7.2 installing snipe a fresh and then doing a database migration from current to new server and then running php artisan migrate...

The new version of Snipe(v4.7.8) then worked fine.

A quick few questions though on a seperate note/issue:

So when we intend to check a machine out we would like the status to automatically change to deployed from "Reserved" or "In stock - built" is there any exisiting functionality that does this?

Secondly as I understand, LDAP enabled should allow me to login using my LDAP credentials and should the password not match it fall back to local authentication, however this is not working and I cannot get any users to login authenticating with LDAP, when I test the connection this works successfully under "Admin"->"LDAP" and I can also authenticate using the username and password field under "Admin"->"LDAP" LDAP Sync under "People" also works fine without any issues.

can anyone advise?

@snipe please can you help/advise?

stale[bot] commented 4 years ago

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] commented 4 years ago

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.