Author Topic: Database error when updating releases  (Read 191775 times)

connorxxl

  • Guest
Database error when updating releases
« on: 2013-11-20, 05:17:44 am »
Hello,

I get the following when running update_releases.

Starting release update process (2013-11-20 13:51:04)

Stage 1 -> Try to find complete collections.
0 collections set to filecheck = 2 (complete)
42 second(s)

Stage 2 -> Get the size in bytes of the collection.
PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'filesize' cannot be null' in /var/www/nZEDb/www/lib/releases.php:1077
Stack trace:
#0 /var/www/nZEDb/www/lib/releases.php(1077): PDOStatement->execute()
#1 /var/www/nZEDb/www/lib/releases.php(1980): Releases->processReleasesStage2('', false)
#2 /var/www/nZEDb/misc/update_scripts/update_releases.php(37): Releases->processReleases(2, 1, '', true, Object(Nntp))
#3 {main}
  thrown in /var/www/nZEDb/www/lib/releases.php on line 1077

I'm on latest master and have run all database patches (with patchdb.php).

Not sure what causes this, I'd appreciate any help.

Thanks!

Cheers,

Chris
« Last Edit: 2013-11-20, 05:20:41 am by connorxxl »

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
Re: Database error when updating releases
« Reply #1 on: 2013-11-20, 11:20:36 am »
Not sure, but I will look into it. What script are you running and how?

connorxxl

  • Guest
Re: Database error when updating releases
« Reply #2 on: 2013-11-20, 01:32:36 pm »
Jonnyboy, thanks.

I run update_releases.php from misc/update_scripts, with "true 2" as parameters.

Somehow got the feeling I missed a database update. I have two VMs running with nzedb, and updated the one with this error one or two days ago. The other one only yesterday, and patchdb.php took much longer...

Thanks for your help.

connorxxl

  • Guest
Re: Database error when updating releases
« Reply #3 on: 2013-11-21, 09:24:27 am »
Now my second machine does the same. No clue where the problem is...

root@nzedbx:/var/www/nZEDb/misc/update_scripts# php update_releases.php 2 true

Starting release update process (2013-11-21 15:56:20)

Stage 1 -> Try to find complete collections.
56557 collections set to filecheck = 2 (complete)
25 minute(s)

Stage 2 -> Get the size in bytes of the collection.
PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'filesize' cannot be null' in /var/www/nZEDb/www/lib/releases.php:1077
Stack trace:
#0 /var/www/nZEDb/www/lib/releases.php(1077): PDOStatement->execute()
#1 /var/www/nZEDb/www/lib/releases.php(1980): Releases->processReleasesStage2('', false)
#2 /var/www/nZEDb/misc/update_scripts/update_releases.php(37): Releases->processReleases(2, 1, '', true, Object(Nntp))
#3 {main}
  thrown in /var/www/nZEDb/www/lib/releases.php on line 1077
root@nzedbx:/var/www/nZEDb/misc/update_scripts#


Thanks for your help.

Offline helixwuff

  • Newbie
  • *
  • Posts: 3
  • Helpful: +0/-0
Re: Database error when updating releases
« Reply #4 on: 2013-11-21, 09:33:25 pm »
have you done all the dB patches? 

connorxxl

  • Guest
Re: Database error when updating releases
« Reply #5 on: 2013-11-23, 06:00:32 am »
I have applied all patches, through patchdb.php.

No clue what went wrong.

Offline mtwitty

  • Junior Indexer
  • **
  • Posts: 28
  • Helpful: +0/-0
Re: Database error when updating releases
« Reply #6 on: 2013-11-24, 06:23:43 am »
Look at the UPDATE statement in line 1077 (line 1080 if running the latest master) of /var/www/nZEDb/www/lib/releases.php and add IGNORE after UPDATE. Remember to leave a space before and after IGNORE.

I'm not sure if this will cause anything bad to happen further along in post processing, but at least it will allow releases to be created again.

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
Re: Database error when updating releases
« Reply #7 on: 2013-11-24, 06:27:03 am »
That won't fix the problem as he's getting null for size, that should not happen.

Offline mtwitty

  • Junior Indexer
  • **
  • Posts: 28
  • Helpful: +0/-0
Re: Database error when updating releases
« Reply #8 on: 2013-11-24, 10:13:11 am »
I've been getting the same error, but I don't have any entries in the parts table with NULL sizes. Something could be going wrong with the SUM in the INSERT, but haven't had time to look into it that far.

I know it doesn't fix the underlying problem of having a NULL size, but at least it lets releases be created. The alternative is…everything stops.

Offline Bart39

  • Overlord
  • ******
  • Posts: 172
  • Helpful: +19/-0
Re: Database error when updating releases
« Reply #9 on: 2013-11-25, 04:12:04 pm »
i also get this occassionly

connorxxl

  • Guest
Re: Database error when updating releases
« Reply #10 on: 2013-11-26, 01:41:43 am »
I haven't run update_releases really, since I always have this failure. Please let me know what I can do to investigate or what information you would need.

Thanks.

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
Re: Database error when updating releases
« Reply #11 on: 2013-12-02, 03:45:20 pm »
I would start over. Drop the database and delete the nZEDb folder and then re-clone. You may be missing something or have a bad file.

connorxxl

  • Guest
Re: Database error when updating releases
« Reply #12 on: 2013-12-03, 02:28:05 am »
Thanks. Wanted to avoid that, since it's two instances with same issue.

Anyway, might just start over.

connorxxl

  • Guest
Re: Database error when updating releases
« Reply #13 on: 2013-12-05, 07:11:08 am »
Update: started from scratch with a new VM, installed according to instructions. Slowly increased number of groups, and now getting the same error again. Did not take over anything from old VMs (no import etc.).

Starting release update process (2013-12-05 16:05:22)
Stage 1 -> Try to find complete collections.
57017 collections set to filecheck = 2 (complete)
19 second(s)

Stage 2 -> Get the size in bytes of the collection.
Error: queryDirect: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'filesize' cannot be null

PHP Fatal error:  Call to a member function rowCount() on a non-object in /var/www/nZEDb/www/lib/releases.php on line 1086
12/05/13 16:05:43

I use astraweb.com.

Anything I can do?

Thanks a lot for your help.

Cheers,

Chris

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
Re: Database error when updating releases
« Reply #14 on: 2013-12-05, 07:24:17 am »
Sorry, but I don't know what is causing this.