scan fails with 2.0.2

Bug #181027 reported by Timo Aaltonen
2
Affects Status Importance Assigned to Milestone
Falcon
Fix Released
Undecided
Unassigned

Bug Description

Got past the configure failure in bug 181022, but now the scan fails:

Falcon repository manager 2.0.2 (C)2005-2008 Dennis Kaarsemaker <email address hidden>
* Scanning component 'common/main'
* Scanning component 'common/restricted'
W: No whitelist found for mailaddresses, not sending mail
W: No whitelist found for mailaddresses, not sending mail

 === ERROR! ===

An error occured in falcon. This is probably a bug in the software.
Please file a bug at https://launchpad.net/falcon/+filebug and
include the following backtrace:

Traceback (most recent call last):
  File "/usr/bin/falcon", line 235, in ?
    component.scan(clean = action=='clean')
  File "/usr/lib/python2.4/site-packages/falcon/plugin.py", line 155, in wrapped_func
    result = func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/falcon/pocket.py", line 194, in scan
    p = self.install(s)
  File "/usr/lib/python2.4/site-packages/falcon/plugin.py", line 155, in wrapped_func
    result = func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/falcon/pocket.py", line 245, in install
    oldpackage = self.sources.extra(where=["id != %s"], params = [package.id]).get(component=self, packagename=package.packagename)
  File "/var/lib/python-support/python2.4/django/db/models/query.py", line 250, in get
    obj_list = list(clone)
  File "/var/lib/python-support/python2.4/django/db/models/query.py", line 108, in __iter__
    return iter(self._get_data())
  File "/var/lib/python-support/python2.4/django/db/models/query.py", line 470, in _get_data
    self._result_cache = list(self.iterator())
  File "/var/lib/python-support/python2.4/django/db/models/query.py", line 183, in iterator
    cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params)
  File "/var/lib/python-support/python2.4/django/db/backends/sqlite3/base.py", line 93, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: database is locked
--

Note that the same repository worked just fine with 2.0~beta3...

Related branches

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

I've tried scanning with --verbose a couple of times, and it seems to crash randomly.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

A possible cause of this is that the previous falcon run crashed. (due to your other bug for instance). Remove the database log file (in .falcon) and try again.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

Actually, bug 181022 will cause this. As of 2.0.4, falcon won't die a horrible death if this ever happens again but properly warn. Remove .falcon/data-journal to get rid of this message.

Changed in falcon:
status: New → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Still happens with 2.0.3. There is no log in .falcon, only "lock" and "data". Configuring leaves the lock in place, but removing that doesn't do anything.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

actually the error is slightly different now:

Traceback (most recent call last):
  File "/usr/bin/falcon", line 235, in ?
    component.scan(clean = action=='clean')
  File "/usr/lib/python2.4/site-packages/falcon/plugin.py", line 157, in wrapped_func
    result = func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/falcon/pocket.py", line 184, in scan
    newfiles = s.rescan()
  File "/usr/lib/python2.4/site-packages/falcon/package.py", line 195, in rescan
    self.get_binaries(missing_only=True)
  File "/usr/lib/python2.4/site-packages/falcon/package.py", line 133, in get_binaries
    BinaryPackage.create_from_debfile(self, f)
  File "/usr/lib/python2.4/site-packages/falcon/package.py", line 261, in create_from_debfile
    p.save()
  File "/var/lib/python-support/python2.4/django/db/models/base.py", line 238, in save
    ','.join(placeholders)), db_values)
  File "/var/lib/python-support/python2.4/django/db/backends/sqlite3/base.py", line 93, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: database is locked

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

and another variant:

Traceback (most recent call last):
  File "/usr/bin/falcon", line 235, in ?
    component.scan(clean = action=='clean')
  File "/usr/lib/python2.4/site-packages/falcon/plugin.py", line 157, in wrapped_func
    result = func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/falcon/pocket.py", line 190, in scan
    s = falcon.package.SourcePackage.create_from_dscfile(self, s)
  File "/usr/lib/python2.4/site-packages/falcon/package.py", line 54, in create_from_dscfile
    c.get_binaries()
  File "/usr/lib/python2.4/site-packages/falcon/package.py", line 133, in get_binaries
    BinaryPackage.create_from_debfile(self, f)
  File "/usr/lib/python2.4/site-packages/falcon/package.py", line 261, in create_from_debfile
    p.save()
  File "/var/lib/python-support/python2.4/django/db/models/base.py", line 238, in save
    ','.join(placeholders)), db_values)
  File "/var/lib/python-support/python2.4/django/db/backends/sqlite3/base.py", line 93, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: database is locked

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

I really hope that the errors don't mean that every package should have a valid source package.. since there are packages like skype that don't have a source package available.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

This error means that somehow you try to access the database simultaneously from 2 programs, which should not happen since falcon has its own global lock. What does ls -la .falcon tell you?

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

deckard ubuntu-tkk 3 % ls -l .falcon
total 864
drwxr-xr-x 4 tjaalton sasl 4096 2007-11-06 16:37 build
drwxr-xr-x 2 tjaalton sasl 8192 2007-11-26 14:07 changelogs
-rw-r--r-- 1 tjaalton sasl 855040 2008-01-08 09:34 data
drwxr-xr-x 2 tjaalton sasl 4096 2007-11-06 16:37 incoming
-rw-r--r-- 1 tjaalton sasl 5 2008-01-08 09:33 lock
drwxr-xr-x 2 tjaalton sasl 8192 2007-11-26 14:07 morgue

it always leaves the lock behind, and falcon starts just fine even if it exists.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

Could you do the following to reset the package tables:

$ falcon shell
>>> SourcePackage.objects.all().delete()
>>> BinaryPackage.objects.all().delete()
$ falcon -v scan

If that breaks, send the complete output, preferably with an ls -lar pool

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

2.0.5 is out which will warn if the database is locked.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Yeah, and with 2.0.5 the scan went fine, so I'll close this as fixed, thanks!

Changed in falcon:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.