Jump to content

No access to the back-end after...


Christophe
 Share

Recommended Posts

I was logged in to the back-end of a live development website (protected by .htpasswd), editing a contact page, when I decided to change, in another tab, the superuser's language to English (second language) to check some labels/texts.

After doing so I was logged out with the following message:


Fatal error: Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pages.name1051' in 'order clause' (in /home/xyz/www/wire/core/PageFinder.php line 298) #0 [internal function]: PageFinder->___find(Object(Selectors), Array) #1 /home/xyz/www/wire/core/Wire.php(398): call_user_func_array(Array, Array) #2 /home/xyz/www/wire/core/Wire.php(333): Wire->runHooks('find', Array) #3 /home/xyz/www/wire/core/Pages.php(216): Wire->__call('find', Array) #4 /home/xyz/www/wire/core/Pages.php(216): PageFinder->find(Object(Selectors), Array) #5 [internal function]: Pages->___find('id>0, sort=name...', Array) #6 /home/xyz/www/wire/core/Wire.php(398): call_user_func_array(Array, Array) #7 /home/xyz/www/wire/core/Wire.php(333): Wire->runHooks('find', Array) #8 /home/xyz/www/wire/core/PagesType.php(231): Wire->__call('find', Array) #9 /home/xyz/www/wire/core/PagesType.php(231): Pages->find('id>0, sort=name...', Array) #10 /home/xyz/www/wire/core/PagesType.php(3 in /home/xyz/www/index.php on line 248

Error: Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pages.name1051' in 'order clause' (in /home/xyz/www/wire/core/PageFinder.php line 298)

#0 [internal function]: PageFinder->___find(Object(Selectors), Array)
#1 /home/xyz/www/wire/core/Wire.php(398): call_user_func_array(Array, Array)
#2 /home/xyz/www/wire/core/Wire.php(333): Wire->runHooks('find', Array)
#3 /home/xyz/www/wire/core/Pages.php(216): Wire->__call('find', Array)
#4 /home/xyz/www/wire/core/Pages.php(216): PageFinder->find(Object(Selectors), Array)
#5 [internal function]: Pages->___find('id>0, sort=name...', Array)
#6 /home/xyz/www/wire/core/Wire.php(398): call_user_func_array(Array, Array)
#7 /home/xyz/www/wire/core/Wire.php(333): Wire->runHooks('find', Array)
#8 /home/xyz/www/wire/core/PagesType.php(231): Wire->__call('find', Array)
#9 /home/xyz/www/wire/core/PagesType.php(231): Pages->find('id>0, sort=name...', Array)
#10 /home/xyz/www/wire/core/PagesType.php(3

This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged.


The website was recently upgraded (with the Upgrades module) from 2.7.1 to 2.7.2.

If I clean the browser's cache I can access the font-end again, but when I try to log in I see again this message(s) (and can't see the font-end neither).

(Recently, with debug mode on, I've seen some other messages with red backgrounds appearing sometimes. They usually go away after disconnecting, cleaning the browser's cache, connecting again... If I see some again I will copy-paste them. I don't remember if it was only "forged" types of messages.)

Link to comment
Share on other sites

Hello LostKobrakai,

I hope you're doing well.

Yes, I have language modules installed.

English is not the default language in this case. It's when I switched to the English language that all this happened.

For this website, I don't remember switching before so perhaps the problem existed from the beginning.

The basis of this website is from another one that doesn't have language modules installed.

Apparently, I can log in with a "normal" user (with "moderate" permissions) who can manage pages.

I can't log in with a very limited user (who can only view pages for the moment), but no error message(s). Before it normally worked (I'll have to check again later). Edit: I've just looked in phpmyadmin, I hadn't updated the username (instead of 1 somewhere it is now 01).

I wonder what I can do to (securely) remove this issue, and why it happened...

Link to comment
Share on other sites

field_language
pages_id 	data 	sort 	Textes complets
1134	1051	0	Effacer Effacer	Copier Copier 	Modifier Modifier

field_title
pages_id 	data 	data1193 	Textes complets
1051	English	NULL	Effacer Effacer	Copier Copier 	Modifier Modifier 	

pages
parent_id 	id 	templates_id 	name 	status 	modified 	modified_users_id 	created 	created_users_id 	published 	sort 	name1022 	status1022 	name1193 	status1193 	Textes complets
1047	1051	49	en	1025	2015-12-15 15:19:53	1134	2015-08-17 20:02:12	1046	2015-08-17 20:02:12	1	NULL	1	NULL	1	Effacer Effacer	Copier Copier 	Modifier Modifier 	

pages_access
pages_id 	templates_id 	ts 	Textes complets
1051	2	2015-11-12 19:58:36	Effacer Effacer	Copier Copier 	Modifier Modifier

Français (French language files) is 1048.

"Català" (no language files) is 1193.

Link to comment
Share on other sites

PHPMyAdmin

LanguageSupportPageNames is 3 times in Table: caches.

And:

field_language_files
pages_id     sort     description     modified     data     created     Textes complets
1048     101         2015-08-17 20:01:16     wire--modules--languagesupport--languagesupportpag...     2015-08-17 20:01:16     Effacer Effacer     Copier Copier     Modifier Modifier     

modules
id     class     flags     data     created     Textes complets
198     LanguageSupportPageNames     3     {"moduleVersion":9,"pageNumUrlPrefix1048":"page","...     2015-12-15 15:32:09     Effacer Effacer     Copier Copier     Modifier Modifier    

Does it mean that only French (1048) has access/permission(s) or whatever "connection"?

So there's no 1051 (English) or 1193 (Català)? NB: they have no language files added.

Could it come (a little) from having converted fields to their multilanguage versions?

Link to comment
Share on other sites

So what could I do to gain back access to the back-end for the superuser?

How can I change the language setting back to Français (French) in PHPMyAdmin or elsewhere, in order to create a new English language and see if it changes something?

(I've replaced the wire folder, .htaccess and index.php, in case.)

Link to comment
Share on other sites

Hello horst, and thank you for trying to help.

I've just done as you've suggested.

I've also cleared the browser's cache, in case.

It changes nothing. I have the same error message(s) when I try to log in with the superuser account (for which I changed the language to English and then had the issue).

In /site/assets/logs/exceptions.txt, I see 6 times the following line(s):

Error loading GitHub branches https://api.github.com/repos/ryancramerdesign/Processwire/branches (in /site/modules/ProcessWireUpgrade/ProcessWireUpgradeCheck.module line 266)

Upgrading via the Upgrades module didn't go smoothly that time. There was always a red-background message.

In the end, I vaguely remember not knowing if everything had gone ok and having to log out and/or perhaps to clear the browser's cache in order to have the Upgrades page loaded normally again.

I don't know if the problem was already there or if this changed something.

But normally the database doesn't change from 2.7.1 to 2.7.2.

Just because I changed the setting from French to English for the superuser I now can't log in and have this error message(s).

Link to comment
Share on other sites

I'm going to try but I'm not sure how to do this. There are perhaps several places where the changes have to be made.

Edit: I don't find where/how the "relations" between the users ("name" or id?) and the languages ("name" or id?) are stored for the moment.

Link to comment
Share on other sites

I have a "41" only in Table: field_language_files.

In Table: field_language, in fact, I only have:

pages_id     data     sort     Textes complets
1134     1051     0     Effacer Effacer     Copier Copier     Modifier Modifier 

1051 being English.

I'm clueless... (for the moment)

Edit: so 1134 would be the superuser's new id (as I changed its username and password)...

As it wasn't 41, I wasn't sure before if it was there that I had to make the modification.

I've just changed it to 1048 and now it's working again.

Perhaps I should recreate the English language to see if it changes something...

Link to comment
Share on other sites

Strange, yes...

I have 4 users currently : superuser, "moderate" permissions user, "very limited" permissions user, and guest.

superuser and "moderate" permissions user already existed (their name and password were changed).

As I've mentioned above, the only one appearing seems to be the superuser (1134) for which I've just changed the language.

The website is hosted at OVH, so I can view a backup from 1 day or 7 days before (snapshots) via PHPMyAdmin. I'm about to look.

Edit: yesterday, only the language code was different. Seven days before, there was no database...

I'm going to import another backup made yesterday before the upgrade to 2.7.2 via the Upgrades module, but chances are that it will show the same information.

Link to comment
Share on other sites

I had the English language's status "Hidden" and have unchecked it to see if it could be the cause, in case, and this is appearing at the top of the page:

  • Session: Modification : status

  •  Session: Page enregistrée : /prcsswr/setup/languages/en/ (1 changement)

  •  LanguageSupport: Refreshing other language page IDs

  •  Languages: language en is missing column pages.name1051

  •  Pages: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pages.name1051' in 'where clause'

  •  Languages: language en is missing column field_title.data1051

  •  Pages: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_title.data1051' in 'field list'

I think I'm going to delete this language and recreate it to see if it changes anything.

Edit: after hitting the Delete button (in French) I now have:

Notice: Undefined property: User::$language in /home/xyz/www/wire/modules/LanguageSupport/LanguageSupportFields.module on line 289

Notice: Undefined property: User::$language in /home/xyz/www/wire/core/PageFinder.php on line 1006

Notice: Undefined property: User::$language in /home/xyz/www/wire/modules/LanguageSupport/LanguageSupportFields.module on line 289

Notice: Undefined property: User::$language in /home/xyz/www/wire/core/PageFinder.php on line 1006

Notice: Undefined property: User::$language in /home/xyz/www/wire/modules/LanguageSupport/LanguageSupportFields.module on line 289

Notice: Undefined property: User::$language in /home/xyz/www/wire/core/PageFinder.php on line 1006

Notice: Trying to get property of non-object in /home/xyz/www/wire/modules/LanguageSupport/Languages.php on line 390

Notice: Trying to get property of non-object in /home/xyz/www/wire/modules/LanguageSupport/Languages.php on line 390

Notice: Trying to get property of non-object in /home/xyz/www/wire/modules/LanguageSupport/Languages.php on line 390

Notice: Trying to get property of non-object in /home/xyz/www/wire/modules/LanguageSupport/Languages.php on line 390

Catchable fatal error: Argument 1 passed to Pages::cache() must be an instance of Page, boolean given, called in /home/xyz/www/wire/core/Pages.php on line 448 and defined in /home/xyz/www/wire/core/Pages.php on line 1891
Recoverable Fatal Error: Argument 1 passed to Pages::cache() must be an instance of Page, boolean given, called in /home/xyz/www/wire/core/Pages.php on line 448 and defined (line 1891 of /home/xyz/www/wire/core/Pages.php)

This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged.

I'm not sure what I'm going to do/decide now...

After refreshing the page it's now:

 Session: Page supprimée : /xxx/setup/languages/en/
 Session: Updated language en (deleted)
 Session: deletePageField, Page:1051, Field:language_files_site
 Session: deletePageField, Page:1051, Field:language_files
 Session: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'name1051_parent_id'; check that column/key exists

Other refresh: no more top message(s)... (but do I have to drop 'name1051_parent_id' manually(?)...)

Edit: 'name1051_parent_id' doesn't exist, so...

Link to comment
Share on other sites

A bit offTopic, but since a few weeks I know that there is this module to Backup DBs. So, I don't want scheduled Backups for Sites that in development state, but I want to have many backups in little steps.

Therefore I added this to my ready.php after I installed kixes module:

$wire->addHookBefore("Session::logout", function(HookEvent $event) {
    if(!wire('modules')->isInstalled('CronjobDatabaseBackup')) return;
    if(!wire('user')->hasPermission('db-backup')) return;
    // execute a cronBackup
    $cdb = wire('modules')->get('CronjobDatabaseBackup');
    $e = new HookEvent();
    $cdb->cronBackup($e);
    return;
});

I setup the module CronjobDatabaseBackup with: BackupCycleInterval = never; a high number of Maximum Number of Backupfiles; and a name format with timestamp, like: #__%Y-m-d_H-i%

This way, everytime when a defined user logs out, a backup is made.

Link to comment
Share on other sites

  • 5 months later...

I've had the same error message. I had deactivated one of the languages temporarily and one user was trying to log into their account with that particular language as default. I switched the user's default language and deleted the language causing problem. 

That solved it for me. 

I think it was a very (stupid) specific issue here, don't know if anybody will ever encounter it, but I thought I'd share it anyhow :-)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...