Page 1 of 2

no login after updated to 1.5.1

Posted: Wed Dec 09, 2009 11:47 am
by bleeb
Hi!

After I updated s9y to the latest version yesterday I (or any other author) cannot login anymore.

s9y just keeps returning to the login screen with the message "You appear to have entered an invalid username or password"

does the database have to be updated too or something? what am I missing here?

yours
ben

Re: no login after updated to 1.5.1

Posted: Wed Dec 09, 2009 12:12 pm
by bleeb
yeah, obviously it missing the database-field "hashtype".

so what have I done wrong updating?

Re: no login after updated to 1.5.1

Posted: Wed Dec 09, 2009 2:26 pm
by garvinhicking
Hi!

That depends on how you upgraded. Did you follow the instructions on www.s9y.org -> Installation -> Upgrading?

Check the FAQ, it tells you ways on how to re-preform upgrades so that the db/*.sql files are executed.

Regards,
Garvin

Re: no login after updated to 1.5.1

Posted: Tue Dec 22, 2009 2:21 pm
by wiz
The problem is the upgrade script for SQLite. This happens trying to upgrade from 1.4 to 1.5.1:

Warning: sqlite_query() [function.sqlite-query]: near "ALTER": syntax error in [...]/include/db/sqlite.inc.php on line 233

Warning: sqlite_query() [function.sqlite-query]: 9 values for 10 columns in [...]/include/db/sqlite.inc.php on line 233

(SQLite 2)

Solution:

edit sql/db_update_1.5-alpha1_1.5-alpha2_sqlite.sql

remove the ALTER TABLE command

remove hashtype from the "INSERT INTO {PREFIX}tempauthors" columns list, since it's missing in the following SELECT clause

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 1:45 pm
by 3nd3r
garvinhicking wrote:Check the FAQ, it tells you ways on how to re-preform upgrades so that the db/*.sql files are executed.
I have same problem, cannot login, I uploaded s9y 1.5.1. I can't find this "how-to"...

Could you point me to it? Where is it?

All seems to be ok, since in login screens appears at the bottom

Code: Select all

Basado en Serendipity 1.5.1 y PHP 5.2.11
Thanks in advance.

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 1:50 pm
by wiz
first you need to fix the sql script, as described above. Then you can force s9y to re-apply it following the instructions for "My upgrade failed" (http://www.s9y.org/11.html#A20)

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 2:38 pm
by 3nd3r
Completed, but same problem. On the final screen, it shows:

Code: Select all

- 
Mac OS X        	2��ATTR;
/ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
�����Y�Ycom.apple.quarantine0000;
/ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '���' at line 1
4b31e5ab;
/ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4b31e5ab' at line 1
Google\x20Chrome.app;
/ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Google\x20Chrome.app' at line 1
And the problem (can't logging) is still there...

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 2:42 pm
by wiz
it seems like the .sql file was not a simple text file anymore after you edited it... try with the attached one

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 3:02 pm
by garvinhicking
Hi wiz!

Thanks a lot for this info. I'll patch it up in an upcoming release - do you know if the sqlite upgrade did not even attempt to create the tempauthors table, because it failed in ALTER TABLE already?

Because if it did create tempauthors, it might even drop the real authors table.

I'm not sure how to proceed, because if people have fixed it in their installation, and I patch it for 1.5.2 to create yet another tempauthors table, it might drop the hashtype. And if the hash was already converted to sha1 (hashtype=1) then setting hashtype=0 on the new insertion would actually never match the password anymore.

BTW; instead of removing the 'hashtype' in the INSERT INTO...SELECT statement, I set it to 0.

Thanks,
Garvin

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 3:17 pm
by wiz
oops, sorry, I forgot to mention it: you need to replace your db with a backup before trying to upgrade it again.

Yes, tempauthors did get created and authors was dropped. So if you don't have a backup, users need to be manually reinserted in the db...

Maybe 1.5.2 could check whether the authors table is empty (result of the failed update) and insert a default user, just to allow users to login again... Or even better, insert a series of authors, using the IDs from the entries table. Of course, only as a last resort for those who didn't make a backup before attempting the update :-)

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 3:32 pm
by wiz
Also, you might want to perform all the upgrade steps in a transaction. At least in this case it would have preserved the db, eg.:

sqlite> create table foo ( a int );
sqlite> create table bar ( a int );
sqlite> begin transaction;
sqlite> drop table foo;
sqlite> alter table bar add column b int;
SQL error: near "alter": syntax error
sqlite> rollback;
sqlite> .schema foo
create table foo ( a int );

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 3:41 pm
by garvinhicking
Hi!

Yes, sadly transactions is one thing I never yet checked out in SQLite.

Anyway - for the time being, I just blogged http://blog.s9y.org/archives/215-Serend ... QLite.html to notify users about this.

Regards,
Garvin

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 3:42 pm
by 3nd3r
I'm beggining to get a little mad on this...

That .sql isn't working. I have same result as before

Code: Select all

- 
Mac OS X        	2��ATTR;
/ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
�����Y�Ycom.apple.quarantine0000;
/ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '���' at line 1
4b31e5ab;
/ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4b31e5ab' at line 1
Google\x20Chrome.app;
/ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Google\x20Chrome.app' at line 1
and of course, still can't log in.

In a screen before, I've noticed that the script points to use ._db_update_1.5-alpha1_1.5-alpha2_sqlite.sql, because db_update_1.5-alpha1_1.5-alpha2_sqlite.sql was in orange colour (modified)...

Please, could you point me on the right way to correct this?

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 3:45 pm
by garvinhicking
Hi 3nd3r!

You have binary characters there, those are definitely not part of the .sql file we are discussing here. Maybe your FTP client does not properly upload them?! Where does the "Mac OS X" string come from?! It seems your Google Chrome is not properly downloading the file for you, because that string is also contained.


Regards,
Garvin

Re: no login after updated to 1.5.1

Posted: Wed Dec 23, 2009 4:01 pm
by 3nd3r
I've tried with Opera and Firefox, from the beggining and I get same error...

I don't know where those characters come from... I've started to upgrade with Chrome (downloaded 1.5.1 tar.gz) uploaded with Transmit... I'm using MacOS 10.5.8

I've downloaded the sql you posted and there isn't any wrong character... Uploaded and downloaded and is the same file!

I'm lost...