Description

On a page with multiple attachments (PNGs, in my case), some of them (in random order on each reload) won't display.

/!\ Duplicate of MoinMoinBugs/RandomLockAlreadyReleased.

Steps to reproduce

  1. attach some image-files (PNGs in my case) to a page;
  2. call these attachments through  {{attachment:f01.png}} 

  3. after saving (and during the preview) the page some of the pictures don't display while others do, but I could never get all the figures (totaling 12) displayed simultaneously on the page.

NOTE: I couldn't figure out a rule which pictures display and which don't -- it's really random with each reload of the problematic page; a "Delete Cache" doesn't help either.

Example

{{attachment:f01.png}}

... TEXT, TEXT, TEXT

{{attachment:f0203.png}}

... TEXT, TEXT, TEXT
... TEXT, TEXT, TEXT

{{attachment:f0405.png}}

... TEXT, TEXT, TEXT

{{attachment:f0608.png}}

... TEXT, TEXT, TEXT

{{attachment:f0911.png}}

... TEXT, TEXT, TEXT

etc.

Component selection

Details

The following error messages appear in the command prompt after the "GET" request for each picture that fail to display:

2008-07-21 16:02:36,730 INFO MoinMoin.server.server_standalone:290 127.0.0.1 "GET /TestPage?action=AttachFile&do=get&target=f01.png HTTP/1.1" 304 -

2008-07-21 16:02:36,792 ERROR MoinMoin.caching:190 Can't acquire read/write lock
 in D:\Documents and Settings\me\Desktop\moin-1.7.1\wiki\data\cache\__common__\
session\__lock__

2008-07-21 16:02:36,792 INFO MoinMoin.server.server_standalone:290 127.0.0.1 "GET /TestPage?action=AttachFile&do=get&target=f0405.png HTTP/1.1" 500 -

2008-07-21 16:02:36,822 ERROR MoinMoin.failure:159 An exception occured.
Traceback (most recent call last):
  File "D:\Documents and Settings\me\Desktop\moin-1.7.1\MoinMoin\request\reques
t_standalone.py", line 60, in __init__
    RequestBase.__init__(self, properties)
  File "D:\Documents and Settings\me\Desktop\moin-1.7.1\MoinMoin\request\__init
__.py", line 212, in __init__
    user_obj = self.cfg.session_handler.start(self, self.cfg.session_id_handler)

  File "D:\Documents and Settings\me\Desktop\moin-1.7.1\MoinMoin\session.py", l
ine 390, in start
    sessiondata = self.dataclass(request, session_name)
  File "D:\Documents and Settings\me\Desktop\moin-1.7.1\MoinMoin\session.py", l
ine 108, in __init__
    self._data = self._ce.content()
  File "D:\Documents and Settings\me\Desktop\moin-1.7.1\MoinMoin\caching.py", l
ine 257, in content
    self.close()
  File "D:\Documents and Settings\me\Desktop\moin-1.7.1\MoinMoin\caching.py", l
ine 220, in close
    self._lock.release()
  File "D:\Documents and Settings\me\Desktop\moin-1.7.1\MoinMoin\util\lock.py",
 line 333, in release
    return ReadLock.release(self)
  File "D:\Documents and Settings\me\Desktop\moin-1.7.1\MoinMoin\util\lock.py",
 line 123, in release
    raise RuntimeError("lock already released")
RuntimeError: lock already released

2008-07-21 16:02:36,980 ERROR MoinMoin.caching:190 Can't acquire read/write lock
 in D:\Documents and Settings\me\Desktop\moin-1.7.1\wiki\data\cache\__common__\
session\__lock__

MoinMoin Version

Release 1.7.1 (apparently all releases > 1.5.5a, see below)

OS and Version

Windows XP SP2

Python Version

ActivePython 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit (Intel)]

Server Setup

N/A

Server Details

DesktopWiki, launched through double-clicking wikiserver.py

Language you are using the wiki in (set in the browser/UserPreferences)

N/A

Affected MoinMoin versions: 1.6.3, 1.6.8, 1.7.0, 1.7.1 (bugreport), 1.7.2, ...

Workaround

Unknown.

Discussion

It is really striking that the images fail to appear on page randomly, i.e. I was unable to see any pattern regarding this misbehavior until now. I have reproduced this bug with previous MoinMoin releases (1.6.3, 1.7.0) and different Python versions (2.5.2 and 2.4.5 from python.org).

Plan

Trying to reproduce on Windows Vista (NTFS) on a C2D 1.8GHz Laptop, FF 3.0.7, IE7 (also installed: Antivir, Adblock Plus (FF)):

-- ThomasWaldmann 2009-03-15

Thank you for your efforts. I know how difficult(impossible) it is to fix something when it is not possible to reproduce. System information

I noticed something today. I was testing from home over a VPN and I only got it to fail once in close to 30 tries. I then used Remote Desktop onto the server machine. It failed every time using both FireFox 3.0.6 and Windows Explorer 6. The laptop that is succeeding over the VPN was failing when I was in the office. This leads me to believe that using the VPN is slowing the requests for the images, allowing the server to respond successfully.

I am not sure how best to help resolve this issue but am happy to assist in whatever way I can. I will look to see if I can figure out how to generate a Traceback. So far I have only found errors in the Webserver log files which aren't detailed enough to help resolve why it is happening.

-- Clint Bennion 2009-03-16


I'm supplying additional info on this bug.

Moin is running on an XP SP3, Apache 2.0 with the wsgi plugin.

SystemInfo
----------

Python Version
    2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
MoinMoin Version
    Release 1.8.2 [Revision release]
Number of pages
    684
Number of system pages
    195
Accumulated page sizes
    2222.0 KiB
Disk usage of C:\WEB\wiki1\wiki\data/pages/
    305.8 MiB
Disk usage of C:\WEB\wiki1\wiki\data/
    325.0 MiB
Entries in edit log
    123 (12.1 KiB)
Event log
    210.0 KiB
Global extension macros
    AbandonedPages, Action, AdvancedSearch, AttachInfo, AttachList, BR, EditTemplates, EditedSystemPages, EmbedObject, FootNote, FullSearch, FullSearchCached, GetText, GetText2, Hits, Include, InterWiki, LikePages, MonthCalendar, Navigation, NewPage, OrphanedPages, PageCount, PageHits, PageList, PageSize, RandomPage, RandomQuote, RecentChanges, ShowSmileys, StatsChart, SystemAdmin, SystemInfo, TableOfContents, TeudView, Verbatim, WantedPages, WikiConfig, WikiConfigHelp
Local extension macros
    NewMonthCalendarEntry, HTML, Include, MonthCalendar2, Gallery, TodayLink
Global extension actions
    AttachFile, CopyPage, DeletePage, Despam, LikePages, Load, LocalSiteMap, MyPages, PackagePages, RenamePage, RenderAsDocbook, Save, SpellCheck, SubscribeUser, SyncPages, backup, bookmark, cache, chart, diff, dumpform, edit, fckdialog, fullsearch, info, links, login, logout, newpage, pollsistersites, quicklink, quickunlink, recoverpass, refresh, revert, rss_rc, serveopenid, showtags, sisterpages, sitemap, subscribe, supplementation, thread_monitor, titleindex, unsubscribe, userprefs, userprofile
Local extension actions
    userform, RenderAsOpenDocument
Global parsers
    text, text_cplusplus, text_creole, text_csv, text_diff, text_docbook, text_html, text_irssi, text_java, text_moin_wiki, text_pascal, text_python, text_rst, text_xslt
Local extension parsers
    html, text_html, gnuplot
Xapian search
    Enabled, Xapian 1.0.6, index available, last modified: 2009-04-14 10:24:18
Stemming for Xapian
    Disabled (danish dutch english finnish french german german2 hungarian italian kraaij_pohlmann lovins norwegian porter portuguese romanian russian spanish swedish turkish)
Active threads
    1


Logging set to DEBUG level. (Logging to stdout and Apache's piped to syslog

2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error] 2009-04-15 19:47:18,260 MoinMoin.failure ERROR An exception occurred, URI was \"/wiki/bblog/2009-02-14?action=AttachFile&do=get&target=IMG_3972.jpg\". 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error] Traceback (most recent call last): 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]   File \"C:/WEB/wiki1/moin-1.8.2\\\\MoinMoin\\\\request\\\\request_wsgi.py\", line 35, in __init__ 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]     RequestBase.__init__(self, {}) 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]   File \"C:/WEB/wiki1/moin-1.8.2\\\\MoinMoin\\\\request\\\\__init__.py\", line 212, in __init__ 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]     user_obj = self.cfg.session_handler.start(self, self.cfg.session_id_handler) 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]   File \"C:/WEB/wiki1/moin-1.8.2\\\\MoinMoin\\\\session.py\", line 394, in start 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]     sessiondata = self.dataclass(request, session_name) 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]   File \"C:/WEB/wiki1/moin-1.8.2\\\\MoinMoin\\\\session.py\", line 108, in __init__ 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]     self._data = self._ce.content() 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]   File \"C:/WEB/wiki1/moin-1.8.2\\\\MoinMoin\\\\caching.py\", line 252, in content 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]     self.close() 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]   File \"C:/WEB/wiki1/moin-1.8.2\\\\MoinMoin\\\\caching.py\", line 215, in close 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]     self._lock.release() 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]   File \"C:/WEB/wiki1/moin-1.8.2\\\\MoinMoin\\\\util\\\\lock.py\", line 340, in release 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]     return ReadLock.release(self) 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]   File \"C:/WEB/wiki1/moin-1.8.2\\\\MoinMoin\\\\util\\\\lock.py\", line 129, in release 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error]     raise RuntimeError(\'lock already released: %s\' % self.lockDir) 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error] RuntimeError: lock already released: C:\\\\WEB\\\\wiki1\\\\wiki\\\\data\\\\cache\\\\__common__\\\\session\\\\__lock__\\\\read_lock_ 
2009-04-15 19:47:19 kolja daemon.err [Wed Apr 15 19:47:18 2009] [error] 2009-04-15 19:47:18,276 MoinMoin.util.lock DEBUG acquired exclusive lock: C:\\\\WEB\\\\wiki1\\\\wiki\\\\data\\\\cache\\\\__common__\\\\session\\\\__lock__\\\\write_lock 

It doesn't matter if Moin is run as CGI or wsgi. The problem only appears on XP not Linux. It seems to be a timing problem. The faster network, the more frequent.

Jan Claréus 15/4-09

Another try to fix it

What we learn from this is that doing an "atomic rename" on Win32 is total crap:

To summarize:

Likely this set of patches will make the session file update problem happen less often, due to lower session file updating frequency (like when loading lots of attached images on a page, trail doesn't change for that case, so session file doesn't need to be updated):

I am happy to report: Since upgrading to the latest release earlier this month I have not experienced any issues. When I upgraded I also switched to using WSGI from Fast CGI. Several of my pages never showed all the images before, so this is a big improvement. Thank you for your good work! - ClintBennion


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/RandomlyFailToDisplayAttachedImages (last edited 2010-03-25 00:11:57 by ClintBennion)