YunoHost-Apps / castopod_ynh

Castopod package for YunoHost
https://podlibre.org/
GNU General Public License v3.0
23 stars 7 forks source link

After update Admin panel is not accessible #74

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the bug

After the last update can longer get to admin page. Get 404 not found. On all three of my Castopod installs.

Context

Steps to reproduce

You can check out one of my blogs.. https://noexpectations.show/@noexpectations/cp-admin

Expected behavior

I should get admin panel login

Logs

navanchauhan commented 2 years ago

https://noexpectations.show/@noexpectations/cp-admin is the incorrect URL

Try https://noexpectations.show/cp-admin

ghost commented 2 years ago

This is resolved, not sure what happened but I put in my address as https://mydomain//cp-admin and it brought me back to login page. Everything worked as normal from there.

navanchauhan commented 2 years ago

Thanks for reopening the issue. I want to investigate why this was happening.

Also, you don't need // in the end, just https://mydomain/cp-admin should work

DDRrayray2012 commented 2 years ago

my instance is at ddrpodcast.com

navanchauhan commented 2 years ago

my instance is at ddrpodcast.com

I can see the CP-Admin panel at https://ddrpodcast.com/cp-admin, but you are right the main page does show Whoops! which shouldn't happen

While I investiage this issue, you can restore the app to the previous version (before the upgrade) and use it normally. Let me know if you need help restoring to the previous version

ericgaspar commented 2 years ago

It might be interesting to know from which version you have updated Castopod. (The datbase structure gets modified sometime from one version to the next...).

DDRrayray2012 commented 2 years ago

The issue originally popped up when upgrading from 1.0.0-96-ynh1 to 1.0.0-98-ynh2. I restored back to 1.0.0-96-ynh1 and then upgraded to 1.0.0-99~ynh1 and the same issue occurred. I have now restored back to 1.0.0-96-ynh1.

DDRrayray2012 commented 2 years ago

My server info is as follows: Hardware: Raspberry Pi 3B YunoHost version: 4.3.6.3 I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen | … Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

demitasse-1 commented 2 years ago

Having the same issue, after upgrading my instance only shows the whoops hit a snag image, for admin and for the public facing site for my podcast.

I can login to the admin but only see whoops hit a snag. I also had the problem when upgrading from 1.0.0-96-ynh1 to 1.0.0-98-ynh2 and from 1.0.0-98-ynh2 to 1.0.0-99~ynh1. Using Yunohost version 4.3.6.3 (stable) on a VPS.

I can restore back to 1.0.0-96-ynh1 but my latest episode was not uploaded for that back up, and my latest episode still seems to be accessible via RSS for podcast apps and such.

navanchauhan commented 2 years ago

Looks like we need to run this for upgrading from beta.16 https://code.castopod.org/adaures/castopod/-/tags/v1.0.0-beta.17#update-instructions

SET AUTOCOMMIT = 0;
START TRANSACTION;

ALTER TABLE `cp_settings`
ADD COLUMN context VARCHAR(255) NULL AFTER `type`;

ALTER TABLE cp_podcasts ADD COLUMN published_at DATETIME DEFAULT NULL AFTER updated_by;
UPDATE cp_podcasts SET published_at = created_at;

COMMIT;

@ericgaspar do you want me to add this fix to the upgrade script? (with a version check)

ericgaspar commented 2 years ago

@ericgaspar do you want me to add this fix to the upgrade script? (with a version check)

@navanchauhan If you have the time, it will be greatly appreciated.

navanchauhan commented 2 years ago

@DDRrayray2012 @demitasse-1

I was able to reproduce your errors and fix it. Should be fixed by #75

DDRrayray2012 commented 2 years ago

Awesome. I’ll apply the update as soon as its available. Thanks to everyone who helped identify and fix this!

mattbk commented 2 years ago

I ran into this too, but didn't restore from backup. I just installed phpmyadmin and ran the SQL at https://github.com/YunoHost-Apps/castopod_ynh/blob/75952d20abc6b900809c442712a0bf39acc5d8d4/scripts/from_beta_16.sql. Seems to have fixed the problem as designed, thanks!

For anyone else searching based on log entries, this is what I had:

ERROR - 2022-08-25 15:15:03 --> Unknown column 'cp_podcasts.published_at' in 'where clause'
CRITICAL - 2022-08-25 15:15:03 --> Call to a member function getResult() on bool
in SYSTEMPATH/Model.php on line 223.
 1 SYSTEMPATH/BaseModel.php(584): CodeIgniter\Model->doFindAll()
 2 ROOTPATH/modules/WebSub/Controllers/WebSubController.php(40): CodeIgniter\BaseModel->findAll()
 3 SYSTEMPATH/CodeIgniter.php(896): Modules\WebSub\Controllers\WebSubController->publish()
 4 SYSTEMPATH/CodeIgniter.php(466): CodeIgniter\CodeIgniter->runController()
 5 SYSTEMPATH/CodeIgniter.php(349): CodeIgniter\CodeIgniter->handleRequest()
 6 FCPATH/index.php(61): CodeIgniter\CodeIgniter->run()
ERROR - 2022-08-25 15:15:03 --> Unknown column 'context' in 'where clause'
ERROR - 2022-08-25 15:15:04 --> Unknown column 'context' in 'where clause'
ERROR - 2022-08-25 15:15:07 --> Unknown column 'context' in 'where clause'
ERROR - 2022-08-25 15:15:10 --> Unknown column 'context' in 'where clause'
ERROR - 2022-08-25 15:15:13 --> Unknown column 'context' in 'where clause'
ERROR - 2022-08-25 15:15:16 --> Unknown column 'context' in 'where clause'
ERROR - 2022-08-25 15:15:18 --> Unknown column 'published_at' in 'where clause'
CRITICAL - 2022-08-25 15:15:18 --> Call to a member function getFirstRow() on bool
in SYSTEMPATH/Model.php on line 249.