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

Admin Panel : Add plugin error, GPM index : error #3158

Closed
Ribero opened this issue Jan 19, 2021 · 15 comments
Closed

Admin Panel : Add plugin error, GPM index : error #3158

Ribero opened this issue Jan 19, 2021 · 15 comments
Assignees

Comments

@Ribero
Copy link

Ribero commented Jan 19, 2021

I'm using Grav v1.7.0 - Admin v1.10.0

When trying to add a Plugin (by pressing the add button on top right) instead of having the list of available plugin I get this error:

image

Environment & details:
Crikey! There was an error.html.zip

when trying to list the plugins using php ./bin/gpm index

I get this error:

GPM Releases Configuration: Stable
PLUGINS [ 347 ]
Fatal error: Uncaught TypeError: Argument 1 passed to Grav\Console\Gpm\IndexCommand::sort() must be an instance of Grav\Common\GPM\Remote\Packages, instance of Grav\Common\GPM\Remote\Plugins
 given, called in /var/www/html/system/src/Grav/Console/Gpm/IndexCommand.php on line 125 and defined in /var/www/html/system/src/Grav/Console/Gpm/IndexCommand.php:255
Stack trace:
#0 /var/www/html/system/src/Grav/Console/Gpm/IndexCommand.php(125): Grav\Console\Gpm\IndexCommand->sort(Object(Grav\Common\GPM\Remote\Plugins))
#1 /var/www/html/system/src/Grav/Console/GpmCommand.php(41): Grav\Console\Gpm\IndexCommand->serve()
#2 /var/www/html/vendor/symfony/console/Command/Command.php(255): Grav\Console\GpmCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\
ConsoleOutput))
#3 /var/www/html/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Cons
ole\Output\ConsoleOutput))
 in /var/www/html/system/src/Grav/Console/Gpm/IndexCommand.php on line 255

Log file:
log.txt

@rhukster
Copy link
Member

Hmm. I can't replicate that. It almost appears like you have things out of date. Did you install Grav + Admin via GPM update? if you upgraded manually or by Git, have you run bin/grav composer install --no-dev to get the latest libraries.

@rhukster
Copy link
Member

Btw, have you also tried forcing a GPM update with bin/grav index -f ?

@Ribero
Copy link
Author

Ribero commented Jan 20, 2021

Btw, have you also tried forcing a GPM update with bin/grav index -f ?

Yes same result

@Ribero
Copy link
Author

Ribero commented Jan 20, 2021

Hmm. I can't replicate that. It almost appears like you have things out of date. Did you install Grav + Admin via GPM update? if you upgraded manually or by Git, have you run bin/grav composer install --no-dev to get the latest libraries.

I use the official docker image, then upgraded to 1.7 using the Admin Panel web GUI. I installed Learn2 Git theme and the plugin to manage pages revisions. I found the issue when I tried to install the license-manager plugin to configure the NextGen editor I just bought. I had to install it using CLI because of this issue and then found that gpm index was also failing.

Is there a way to activate more logs ?

What could be the most simple way to get back to a stable situation without loosing users accounts, pages... I can reinstall but I would prefer to identify the issue before.

@mahagr
Copy link
Member

mahagr commented Jan 20, 2021

Which version of PHP you're in? As I cannot reproduce this either in 7.3.26, 7.4.14 or 8.0.1. That said I kind of get where the issue comes from, but I wonder how to reproduce it..

use php -v to see the version.

@mahagr
Copy link
Member

mahagr commented Jan 20, 2021

Nevermind, I found a way to reproduce this issue. :) Fixing it now.

mahagr added a commit that referenced this issue Jan 20, 2021
@mahagr
Copy link
Member

mahagr commented Jan 20, 2021

@Ribero Fixed CLI first. You can see my fix from above ^.

@mahagr
Copy link
Member

mahagr commented Jan 20, 2021

The admin issue seems to come from an installed Presentation plugin, try disabling it first.

@mahagr
Copy link
Member

mahagr commented Jan 20, 2021

It looks like path user/plugins/presentation/node_modules/reveal.js/css/theme does not exist in your installation, can you check it out? Maybe try to re-install the plugin after disabling it.

@mahagr
Copy link
Member

mahagr commented Jan 20, 2021

Note: CLI issue was fixed, admin issue isn't in Grav or Admin.

@Ribero
Copy link
Author

Ribero commented Jan 20, 2021

It looks like path user/plugins/presentation/node_modules/reveal.js/css/theme does not exist in your installation, can you check it out? Maybe try to re-install the plugin after disabling it.

I uninstalled all plugins, all themes (reverting to Quark and default plugins + licence manager + NextGenEditor) but I still face the same behavior

Capture d’écran 2021-01-20 à 09 53 41

Cannot add any new plugin using Admin Pannel Gui
Cannot use gpm index -f without a crash

 php bin/gpm index -f
GPM Releases Configuration: Stable
PLUGINS [ 347 ]
Fatal error: Uncaught TypeError: Argument 1 passed to Grav\Console\Gpm\IndexCommand::sort() must be an instance of Grav\Common\GPM\Remote\Packages, inst
ance of Grav\Common\GPM\Remote\Plugins given, called in /var/www/html/system/src/Grav/Console/Gpm/IndexCommand.php on line 125 and defined in /var/www/h
tml/system/src/Grav/Console/Gpm/IndexCommand.php:255
Stack trace:
#0 /var/www/html/system/src/Grav/Console/Gpm/IndexCommand.php(125): Grav\Console\Gpm\IndexCommand->sort(Object(Grav\Common\GPM\Remote\Plugins))
#1 /var/www/html/system/src/Grav/Console/GpmCommand.php(41): Grav\Console\Gpm\IndexCommand->serve()
#2 /var/www/html/vendor/symfony/console/Command/Command.php(255): Grav\Console\GpmCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Ob
ject(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/html/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\Arg
vInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
 in /var/www/html/system/src/Grav/Console/Gpm/IndexCommand.php on line 255

@Ribero
Copy link
Author

Ribero commented Jan 20, 2021

Ok here is an update:

I manually deleted the folder user/plugins/presentation that was still present even if not listed as an installed plugin

Immediate effect is that the Admin Panel GUI is working again as expected !

but

gpm index -f still crashes.

@mahagr
Copy link
Member

mahagr commented Jan 20, 2021

GPM command has been fixed in a commit above. You can test it if you want by copying
this file into system/src/Grav/Console/Gpm/IndexCommand.php.

@Ribero
Copy link
Author

Ribero commented Jan 20, 2021

Tested it works. Thanks !

@mahagr mahagr closed this as completed Jan 20, 2021
@OleVik
Copy link
Contributor

OleVik commented Jan 20, 2021

The Presentation-plugin most definitely ships with the user/plugins/presentation/node_modules/reveal.js/css/theme-folder, and it is non-empty. Unless your system prevented the normal installation of the plugin, the blueprints should have no problem rendering the fields, and should fall back to None being the only option if it fails to list the themes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants