no login after updated to 1.5.1

Having trouble installing serendipity?
bleeb
Regular
Posts: 7
Joined: Fri Oct 23, 2009 11:57 am

no login after updated to 1.5.1

Post 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
bleeb
Regular
Posts: 7
Joined: Fri Oct 23, 2009 11:57 am

Re: no login after updated to 1.5.1

Post by bleeb »

yeah, obviously it missing the database-field "hashtype".

so what have I done wrong updating?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: no login after updated to 1.5.1

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
wiz
Regular
Posts: 5
Joined: Tue Dec 22, 2009 2:18 pm
Contact:

Re: no login after updated to 1.5.1

Post 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
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Re: no login after updated to 1.5.1

Post 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.
Try not. Do, or do not. There is no try.
wiz
Regular
Posts: 5
Joined: Tue Dec 22, 2009 2:18 pm
Contact:

Re: no login after updated to 1.5.1

Post 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)
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Re: no login after updated to 1.5.1

Post 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...
wiz
Regular
Posts: 5
Joined: Tue Dec 22, 2009 2:18 pm
Contact:

Re: no login after updated to 1.5.1

Post by wiz »

it seems like the .sql file was not a simple text file anymore after you edited it... try with the attached one
Attachments
db_update_1.5-alpha1_1.5-alpha2_sqlite.sql.zip
(1.01 KiB) Downloaded 708 times
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: no login after updated to 1.5.1

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
wiz
Regular
Posts: 5
Joined: Tue Dec 22, 2009 2:18 pm
Contact:

Re: no login after updated to 1.5.1

Post 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 :-)
wiz
Regular
Posts: 5
Joined: Tue Dec 22, 2009 2:18 pm
Contact:

Re: no login after updated to 1.5.1

Post 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 );
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: no login after updated to 1.5.1

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Re: no login after updated to 1.5.1

Post 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?
Try not. Do, or do not. There is no try.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: no login after updated to 1.5.1

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Re: no login after updated to 1.5.1

Post 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...
Try not. Do, or do not. There is no try.
Post Reply