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

Running php upgrade does not continue, no errors. #15190

Closed
2 tasks done
edd080 opened this issue Jul 30, 2024 · 18 comments
Closed
2 tasks done

Running php upgrade does not continue, no errors. #15190

edd080 opened this issue Jul 30, 2024 · 18 comments

Comments

@edd080
Copy link

edd080 commented Jul 30, 2024

Debug mode

Describe the bug

Trying to upgrade from version 7.0.9 to 7.0.10 , I run the php upgrade.php command and its just stops, no errors.

Reproduction steps

  1. open command prompt as admin
  2. go to where the snipe directory is located
  3. Run the command "php upgrade.php"

Expected behavior

Start processing the upgrade command and maybe upgrade to the latest version..

Screenshots

snipe_upgrade

Snipe-IT Version

7.0.9

Operating System

Windows 10

Web Server

IIS

PHP Version

8.1.27

Operating System

Windows 11

Browser

Google, Firefox, Edge

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

Copy link

welcome bot commented Jul 30, 2024

👋 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.

@Odoxa
Copy link

Odoxa commented Aug 1, 2024

Hello, I have exactly the same issue. On my environment we have Windows Server 2022 and PHP 8.1.29.
I don't know is someone was able to find a workaround regarding this.

Best regards,

@edd080
Copy link
Author

edd080 commented Aug 1, 2024

It seems that since version 7.0.9 the upgrade.php module got updated; from other issues posted here I noticed a user posted a link to the following here .
I then modified the current upgrade.php:
the below is a portion of the code of the original upgrade.php (red box):
Original-upgradephp
which I modified (from the link) with the following code (red box)
Modified-upgradephp
I then ran the php upgrade.php and it now gives me the below usual "error"
upgrade-output
i use the skip compatibility checks which allowed me to continue..
upgrade-output2

The json requirements URL is accessible by the way, I am able to open it from the browser on the same server.

Any help would be appreciated, thanks ..

@brianhoganm
Copy link

Hello, I have exactly the same issue. On my environment we have Windows Server 2022 and PHP 8.1.29. I don't know is someone was able to find a workaround regarding this.

Best regards,

Same here! I have this issue as well.

@yvek91
Copy link

yvek91 commented Aug 17, 2024

Hello, I have exactly the same issue. On my environment we have Windows Server 2022 and PHP 8.1.29. I don't know is someone was able to find a workaround regarding this.
Best regards,

Same here! I have this issue as well.

Same.

@edd080
Copy link
Author

edd080 commented Aug 17, 2024

The only way I managed to get mine updated was through my second post. Hopefully someone can update us on a possible better solution.

@snipe
Copy link
Owner

snipe commented Aug 18, 2024

We don't have easy access to windows machines to test this, but we're still trying to figure out what the issue is here.

In the meantime, remember that the upgrade.php is just a small wrapper around these commands - you don't actually need it.

composer.phar self-update
git pull
php composer.phar install --no-dev --prefer-source
php composer.phar dump-autoload
php artisan migrate
php artisan config:clear
php artisan route:clear
php artisan cache:clear
php artisan view:clear

(Replace composer.phar with just composer if you have composer installed globally.

@snipe
Copy link
Owner

snipe commented Aug 18, 2024

The --skip-php-compatibility-checks on upgrade.php should be bypassing that curl check

@edd080
Copy link
Author

edd080 commented Aug 18, 2024

Thank you for looking into this, will try the set of commands next time and see how it goes, using the skip php compatibility checks did not work for me unless I modify upgrade.php as per my second post. After the modification the skip compatibility would then work.

@snipe
Copy link
Owner

snipe commented Aug 18, 2024

Roger that. @uberbrady spun up a Windows VM recently, so I'll have him try to reproduce this on Monday.

@edd080
Copy link
Author

edd080 commented Aug 18, 2024

Thank you so much 👍

@uberbrady
Copy link
Collaborator

If anyone else is playing around with this, one thing I saw that improved the version check was to change the call to url_get_contents() to instead use file_get_contents() - an line 68 - here:

$upgrade_requirements_raw = url_get_contents($remote_requirements_file);

When I do that, it does get past that part. I'm not sure that's going to be the permanent solution, however, because some highly-secure installations might have "fopen() wrappers" disabled. So I suspect the curl method is still the right way to go. But I'm still playing around with it and will report back.

@snipe
Copy link
Owner

snipe commented Aug 19, 2024

Yeah, the fopen issue is why we changed it, IIRC

@uberbrady
Copy link
Collaborator

I have a partial fix for this in the works that I’m hoping to have out for tomorrow.

It should fix most of the bits where upgrade.php misfires, but it won’t fix the “disappearing upgrade.php” problem, which is still a big mystery for us.

@edd080
Copy link
Author

edd080 commented Aug 21, 2024

If anyone else is playing around with this, one thing I saw that improved the version check was to change the call to url_get_contents() to instead use file_get_contents() - an line 68 - here:

$upgrade_requirements_raw = url_get_contents($remote_requirements_file);

When I do that, it does get past that part. I'm not sure that's going to be the permanent solution, however, because some highly-secure installations might have "fopen() wrappers" disabled. So I suspect the curl method is still the right way to go. But I'm still playing around with it and will report back.

If I just modify line 68 using the original upgrade.php file the same issue occurs for me as per my first post; will wait for your fix and test it out to see how it goes.
Thanks for looking into this.

Sorry my mistake, I must have done something wrong, I modified Line 68 using file_get_contents again and now it allows me to upgrade ! So yes your fix works :)

phpupgrade

@snipe
Copy link
Owner

snipe commented Aug 21, 2024

Unfortunately, that fix does not work universally across all systems. As @uberbrady said, we'll have a fix out later today.

@edd080
Copy link
Author

edd080 commented Aug 21, 2024

No problem will wait for the actual fix, and let you know.

@snipe snipe closed this as completed in 01c4fe6 Aug 21, 2024
@edd080
Copy link
Author

edd080 commented Aug 22, 2024

Hello Thank you so much for your help, I can confirm that this is working, just updated to the latest version, and everything went smoothly 👍.
Thank you once again.

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

6 participants