The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Installation no login after updated to 1.5.1

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

Postby bleeb » Wed Dec 09, 2009 12:47 pm

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

Postby bleeb » Wed Dec 09, 2009 1:12 pm

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

so what have I done wrong updating?

User avatar
garvinhicking
Core Developer
 
Posts: 29477
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Dec 09, 2009 3:26 pm

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 3:18 pm

Postby wiz » Tue Dec 22, 2009 3:21 pm

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

User avatar
3nd3r
Regular
 
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain

Postby 3nd3r » Wed Dec 23, 2009 2:45 pm

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 3:18 pm

Postby wiz » Wed Dec 23, 2009 2:50 pm

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)

User avatar
3nd3r
Regular
 
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain

Postby 3nd3r » Wed Dec 23, 2009 3:38 pm

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 3:18 pm

Postby wiz » Wed Dec 23, 2009 3:42 pm

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 318 times

User avatar
garvinhicking
Core Developer
 
Posts: 29477
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Dec 23, 2009 4:02 pm

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 3:18 pm

Postby wiz » Wed Dec 23, 2009 4:17 pm

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 3:18 pm

Postby wiz » Wed Dec 23, 2009 4:32 pm

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 );

User avatar
garvinhicking
Core Developer
 
Posts: 29477
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Dec 23, 2009 4:41 pm

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/

User avatar
3nd3r
Regular
 
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain

Postby 3nd3r » Wed Dec 23, 2009 4:42 pm

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.

User avatar
garvinhicking
Core Developer
 
Posts: 29477
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Dec 23, 2009 4:45 pm

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/

User avatar
3nd3r
Regular
 
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain

Postby 3nd3r » Wed Dec 23, 2009 5:01 pm

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.

Next


Return to Installation

Who is online

Users browsing this forum: No registered users and 1 guest