froger-me / wp-packages-update-server

WP Packages Update Server - Run Your Own Update Server for Plugins and Themes
GNU General Public License v3.0
141 stars 39 forks source link

Updating from gitlab.com stopped working #5

Closed khartahk closed 5 years ago

khartahk commented 5 years ago

A few days ago when I tested fetching themes from gitlab.com everything worked.

Now I get: Error - could not get remote package. Check if a repository with this slug exists and has a valid file structure. on both github.com and gitlab.com

WPPUS: 1.4.9 Wordpress: 4.9.8

And this is happening on two separate installs. One on WP Engine and the other on DigitalOcean droplet. Error in error log says:

Sun Dec 02 07:38:22.066775 2018] [php7:notice] [pid 19140] [client xxx.xxx.xxx.xxx:xxxxx] WPPUS_Zip_Package_Manager::clean_package: Not Found, referer: https://domain.tld/wp-admin/admin.php?page=wppus-page

Also this is what I get in the debug log.

[02-Dec-2018 17:48:28 UTC] PHP Notice:  Undefined property: WPPUS_Zip_Package_Manager::$debug in /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-zip-package-manager.php on line 88
[02-Dec-2018 17:48:28 UTC] PHP Stack trace:
[02-Dec-2018 17:48:28 UTC] PHP   1. {main}() /shared/httpd/wppus/wp-admin/admin-ajax.php:0
[02-Dec-2018 17:48:28 UTC] PHP   2. do_action($tag = *uninitialized*, $arg = *uninitialized*) /shared/httpd/wppus/wp-admin/admin-ajax.php:100
[02-Dec-2018 17:48:28 UTC] PHP   3. WP_Hook->do_action($args = *uninitialized*) /shared/httpd/wppus/wp-includes/plugin.php:453
[02-Dec-2018 17:48:28 UTC] PHP   4. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /shared/httpd/wppus/wp-includes/class-wp-hook.php:310
[02-Dec-2018 17:48:28 UTC] PHP   5. WPPUS_Update_Manager->prime_package_from_remote() /shared/httpd/wppus/wp-includes/class-wp-hook.php:284
[02-Dec-2018 17:48:28 UTC] PHP   6. WPPUS_Update_API::download_remote_update($slug = *uninitialized*, $type = *uninitialized*, $update_server = *uninitialized*) /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-manager.php:301
[02-Dec-2018 17:48:28 UTC] PHP   7. WPPUS_Update_Server->save_remote_package_to_local($safe_slug = *uninitialized*) /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-api.php:95
[02-Dec-2018 17:48:28 UTC] PHP   8. WPPUS_Zip_Package_Manager->clean_package() /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-server.php:104
[02-Dec-2018 17:48:28 UTC] WPPUS_Zip_Package_Manager::clean_package: Not Found
[02-Dec-2018 17:48:28 UTC] PHP Notice:  Undefined variable: package in /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-zip-package-manager.php on line 94
[02-Dec-2018 17:48:28 UTC] PHP Stack trace:
[02-Dec-2018 17:48:28 UTC] PHP   1. {main}() /shared/httpd/wppus/wp-admin/admin-ajax.php:0
[02-Dec-2018 17:48:28 UTC] PHP   2. do_action($tag = *uninitialized*, $arg = *uninitialized*) /shared/httpd/wppus/wp-admin/admin-ajax.php:100
[02-Dec-2018 17:48:28 UTC] PHP   3. WP_Hook->do_action($args = *uninitialized*) /shared/httpd/wppus/wp-includes/plugin.php:453
[02-Dec-2018 17:48:28 UTC] PHP   4. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /shared/httpd/wppus/wp-includes/class-wp-hook.php:310
[02-Dec-2018 17:48:28 UTC] PHP   5. WPPUS_Update_Manager->prime_package_from_remote() /shared/httpd/wppus/wp-includes/class-wp-hook.php:284
[02-Dec-2018 17:48:28 UTC] PHP   6. WPPUS_Update_API::download_remote_update($slug = *uninitialized*, $type = *uninitialized*, $update_server = *uninitialized*) /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-manager.php:301
[02-Dec-2018 17:48:28 UTC] PHP   7. WPPUS_Update_Server->save_remote_package_to_local($safe_slug = *uninitialized*) /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-api.php:95
[02-Dec-2018 17:48:28 UTC] PHP   8. WPPUS_Zip_Package_Manager->clean_package() /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-server.php:104
froger-me commented 5 years ago

Hello @khartahk , and thank you for bringing the issue to my attention!

The warnings you logged in the OP (thanks BTW, they will be fixed!) are not the root cause of the issue. After debugging, it appears Gitlab changed the way access tokens are used to get the content of repositories: https://gitlab.com/your-group/your-slug/repository/master/archive.zip?private_token=your-token returns a 404 error if the user is not logged in.

After some digging, it's an updated in gitlab that causes the issue: https://gitlab.com/gitlab-com/support-forum/issues/4154 https://about.gitlab.com/2018/11/28/security-release-gitlab-11-dot-5-dot-1-released/ https://docs.gitlab.com/ee/api/repositories.html#get-file-archive

I'll be fixing that ASAP. Again, thank you for bringing it to my attention!

froger-me commented 5 years ago

Update: https://github.com/YahnisElsts/plugin-update-checker/issues/240

froger-me commented 5 years ago

Sticky topic on wordpress to warn other users: https://wordpress.org/support/topic/gitlab-issue-since-nov-28-2018/

froger-me commented 5 years ago

Fix has been found, will be deployed this evening (Beijing time)

froger-me commented 5 years ago

Fixed deployed! Closing the issue. Please feel free to leave a review!

froger-me commented 5 years ago

@khartahk I was delighted to see you left a review on the plugin, and then noticed it was withdrawn. Please feel free to let me know if there are any improvements you'd like to see, or the reason for the withdrawal: feedback is what helps improving the solution ;).

khartahk commented 5 years ago

I didn't withdraw it. I'll check what happened

Dne, 04. december 2018 16:42:35 GMT+01:00, Alexandre Froger notifications@github.com sporoča:

@khartahk I was delighted to see you left a review on the plugin, and then noticed it was withdrawn. Please feel free to let me know if there are any improvements you'd like to see, or the reason for the withdrawal: feedback is what helps improving the solution ;).

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/froger-me/wp-plugin-update-server/issues/5#issuecomment-444146051

froger-me commented 5 years ago

Thanks for the fast reply 😮, and taking the time to look into it!

khartahk commented 5 years ago

I guess they didn't like me linking to the gitlab issue. I've created a new review and this time omitted that. It's being held for moderation so it will probably take some time. This is probably because my first post was removed ...

I hope it gets approved soon.

I did how ever ran into another issue. One of my themes is not always downloaded in full to the wppus site and I get the following error in error log and a blank screen on Overview tab:

PHP Fatal error: Uncaught Wpup_InvalidPackageException: The specified file /nas/content/live/wpkupisi/wp-content/wppus/packages/bohinj-si.zip does not contain a valid WordPress plugin or theme. in /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/ZipMetadataParser.php:128\nStack trace:\n#0 /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/ZipMetadataParser.php(102): Wpup_ZipMetadataParser->extractMetadata()\n#1 /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/ZipMetadataParser.php(74): Wpup_ZipMetadataParser->setMetadata()\n#2 /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/Package.php(67): Wpup_ZipMetadataParser->__construct(NULL, '/nas/content/li...', Object(Wpup_FileCache))\n#3 /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-manager.php(786): Wpup_Package::fromArch in /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/ZipMetadataParser.php on line 128

I can create an issue tomorrow if you need more info.

Regards

V V tor., 4. dec. 2018 ob 17:25 je oseba Alexandre Froger notifications@github.com<mailto:notifications@github.com> napisala:

Thanks for the fast reply 😮, and taking the time to look into it!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/froger-me/wp-plugin-update-server/issues/5#issuecomment-444162159, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACiEZOxMenZ6KWchnG8AKRnJ6xQde9f_ks5u1qHbgaJpZM4Y9Tp_.

-- Good men don't need rules. Today is not the day to find out why I have so many.

froger-me commented 5 years ago

@khartahk thank you for the effort. Regarding the other issue you mentioned, let's indeed take care of it in a separate github issue.

khartahk commented 4 years ago

@froger-me This issue has happened again. The same response from the plugin when trying to use gitlab, check if the repository with this slug exists.