getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 223 forks source link

Recent update causing errors in admin panel #2357

Closed sarahbeverton closed 11 months ago

sarahbeverton commented 1 year ago

After updating to the most recent version of Grav and updating 5 plugins (including Admin Panel and Login), the Login plugin stopped being listed as a plugin in the Admin Panel. The website still works and we can log in to the Admin Panel (the Login plugin is still in the file system), but when we click 'Add' on the plugins page, we get an error. We updated the Admin Panel today to version 1.10.41.2 and still get the error. Here is a screenshot of the error when trying to add a plugin:

Screenshot 2023-05-12 at 3 41 02 PM

rhukster commented 1 year ago

That all sounds pretty strange. It might be that there was some error during the update procedure and the login plugin was corrupted? Maybe backup/copy that login folder somewhere else and try a bin/gpm install login from the CLI to force install it again?

sarahbeverton commented 1 year ago

I tried the bin/gpm installation for the login plugin and still have the same result (login is missing and I get the same error message when trying to add a plugin). I have a local version of the website on my machine that updated successfully, but we tried the updates with another grav website on the same server as this website and got the same error. The server is using PHP 8.0.

rhukster commented 1 year ago

can you zip up your site and send it to me so i can inspect it and see what's going on? Share the file on some cloud storage (dropbox/icloud/googledrive/onedrive/ etc) and share a link (will probalby be too big to email the zip), and email me the link to andy at trilbymedia dot com. thanks.

rhukster commented 1 year ago

I'm not realy seeing any issues. I just unziped the file you sent me, as the accounts folder was removed (correct move btw), I created a new accounts folder, was prompted to create my admin user, which I did, and logged in. Login i used during this process so that's a good sign.

I can list the plugins, login is clearly listed there. The one that is not seems to be a somewhat malformed custom plugin called zenodo-data. I'm suprised this works at all as there's no data in the 'required' blueprints.yaml file.

Other than that, admin seems to work without issues, and i can even browse the site on the frontened.

During what actions exactly did you get that error above? I can't seem to replicate it on your site running locally.

rhukster commented 1 year ago
CleanShot 2023-05-15 at 09 46 29@2x
sarahbeverton commented 1 year ago

Thanks for taking a look! That is interesting that you can see the login plugin. I still can't see it, and we also can't get it to appear when updating the login plugin on another website on our server. I get the error when I try to add a plugin (using the button on this screenshot). I assume you would not get the error since the error seems to have to do with the login plugin not appearing in the list.

Screenshot 2023-05-15 at 11 54 01 AM

rhukster commented 1 year ago

All I can think is that it might be related to permissions being messed up in the filesystem. Do you have SSH access? can you login and look at the files directly?

sarahbeverton commented 1 year ago

Yes I can access the files - do you know what the permissions need to be?

rhukster commented 1 year ago

I would suggest checking the files ownership + permissions in the filesystem. You will probably needs SSH access to do this, or at worst SFTP.

I didn't alter the files you sent me, so it the zip contained a fully working copy of Login plugin that works for me.. However, by unzipping I set all the files to my local account and permissions, so I can't tell what you have on your end.

Should just match all the surrounding folders and files.

sarahbeverton commented 1 year ago

I finally figured out what was causing the problems (we were also having another problem with not being able to see or access accounts from the admin panel). There is a directory with the same name as our website under user/. It has a few .yaml files in it (email.yaml, flex-objects.yaml and security.yaml). When I changed the name of that directory to something other than our website, everything was fixed. Do you happen to know if that directory or those .yaml files are necessary, and if so, are they possibly configured incorrectly? Update - it looks like the flex-objects.yaml file was the one causing the problems.

PeopleInside commented 11 months ago

@sarahbeverton I think I have your same issue. The Login plugin is not visible and I cannot access to my admin profile.

How can I resolve? https://github.com/getgrav/grav-plugin-admin/issues/2365

Can you provide the steps or the change you do?

PeopleInside commented 11 months ago

Oh I see, under user folder I found a folder with my domain name. Found two folder with my domain name, one has www and one without. Renaming the folder without my domain adding off_ before the name fix the issue.

Many thanks but why Grav has this issue?

rhukster commented 11 months ago

it's not an issue, i think you are referring to the 'environments'. Where as soon as you define an environment, and you are in it when using the admin, it will automatically save configuration there. https://learn.getgrav.org/17/advanced/environment-config

Typically you should only use an environment for overrides, where you don't plan on using the admin... for example, on your live site to enable analytic scripts.

Then in a staging setup where you use admin, don't have an environment folder, so the configuration is stored into the default user/config folder. Production will use any overrides it finds it the yoursite.com environment files, and fall back to the user/config based configuration for everything else.. that in turn falls back to the system/config folder as needed.

PeopleInside commented 11 months ago

Sorry but I cannot understood you. I never touched server files, I only use the grav interface so.. today discovered I was unable to login to my profile. The post of sarahbeverton https://github.com/getgrav/grav-plugin-admin/issues/2357#issuecomment-1552118847 is what really help to resolve the issue.

The Login plugin was not visible and the admin profile inaccessible. I had to go on server files and rename the folder with the domain in the user folder, this resolve the issue.

Anyway thanks to Sara I resolved. I need maybe remember for the future how to do if Grav will let this happen again.