Page MenuHomePhabricator

Some images do not display unless user is logged-in
Closed, ResolvedPublic

Description

Author: arawak

Description:
screenshots showing the same page for unlogged and logged-in user

In Polish Wikipedia (http://pl.wikipedia.org) random graphic files do not display for users not logged-in (or not registered). The same images display well for logged-in users in the same time. This error is not persistent (after a time -- hours, days perhaps -- images show up). Usually these are thumbnails of images inserted via templates, but not only. No correlation with browser type, operating system, time of day etc. has been found. Also images affected seem to be totally random, and they do not stay affected long.
Recent example: on page [http://pl.wikipedia.org/wiki/Herb_powiatu_%C5%BCni%C5%84skiego] the image [:File:POL województwo kujawsko-pomorskie COA.svg] included via template [http://pl.wikipedia.org/wiki/Szablon:Herby_kujawsko-pomorskich_powiat%C3%B3w] shows up today only for logged-in users. The same image displays well for all users when they open template page itself [http://pl.wikipedia.org/wiki/Szablon:Herby_kujawsko-pomorskich_powiat%C3%B3w], or image page [http://pl.wikipedia.org/wiki/Plik:POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg].
This error has been reported to Polish Wikipedia bug reporting system many times by diffrent users. Probably also already reported on Bugzilla, but still not corrected.


Version: unspecified
Severity: normal

Attached:

unlogged_vs_logged-in.jpg (1×1 px, 240 KB)

Details

Reference
bz27836

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:31 PM
bzimport set Reference to bz27836.
bzimport added a subscriber: Unknown Object (MLST).

Bryan.TongMinh wrote:

HTML as logged-in user:

<td style="width:0%;padding:0px 0px 0px 2px;" rowspan="3"><a href="/wiki/Plik:POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg" class="image" title="Herb województwa kujawsko-pomorskiego"><img alt="Herb województwa kujawsko-pomorskiego" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg/50px-POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg.png" width="50" height="62" /></a></td>

HTML as anonymous user:
<td style="width:0%;padding:0px 0px 0px 2px;" rowspan="3"><a href="/wiki/Plik:POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg" title="Plik:POL województwo kujawsko-pomorskie COA.svg">Herb województwa kujawsko-pomorskiego</a></td>

Does plwiki have flaggedrevs? I think it may have something to do with that.

The behavior should already improve with the changes in r82917.

Some of the old stable versions still have blue linked files:
http://pl.wikipedia.org/w/index.php?title=Herb_powiatu_%C5%BCni%C5%84skiego&stableid=14947063

This normally implies the version of that file used when that old revision of "Herb..." was reviewed no longer exists. However, I can't find any signs of deletion...

Many older reviewed (stableid=x in URL) versions of pages that use that file also have blue links. Newer ones don't. The ones that have blue links are page versions reviewed before the file was uploaded (jan 2011). That suggest two possibilities:
(i) The templates (header boxes, portal boxes) used on those pages referenced the coat of arms file before it was created and it was a redlink when the pages where reviewed. I doubt people reviewed pages with a bunch of redlinked files though.
(ii) The templates didn't reference the coat of arms file when those pages were reviewed, but the current *stable version* of the templates *now* use the file. This means that the reviewed version of the pages using the templates now use the file too, but the reviewer never specified a version. What *should* happen is that the current file is used in that case, not a blue link. I'll look at this further.

I recreated scenario (ii) on my testwiki, but the page correctly shows the current file version, so that doesn't seem to be the problem.

Looking at http://pl.wikipedia.org/w/index.php?title=Szablon:Wojew%C3%B3dztwo_kujawsko-pomorskie&action=history it looks like Plik:POL województwo kujawsko-pomorskie COA.svg was "used" before it was even created. Is this correct?

arawak wrote:

(In reply to comment #4)

I recreated scenario (ii) on my testwiki, but the page correctly shows the
current file version, so that doesn't seem to be the problem.

Looking at
http://pl.wikipedia.org/w/index.php?title=Szablon:Wojew%C3%B3dztwo_kujawsko-pomorskie&action=history
it looks like Plik:POL województwo kujawsko-pomorskie COA.svg was "used" before
it was even created. Is this correct?

  • It looks exactly like you describe: the file creation date is Jan 22 2011 but template edition which uses this filename is from Jan 27 201. I can't explain this. Whether there were once a file with this name on Commons (deleted and re-created) or there is a bug in article history or it is a consequence of a trick with nested templates, I cannot tell. I may ask someone on Commons to check it up.

I didn't see anything in the deletion/move logs though.

arawak wrote:

(In reply to comment #6)

I didn't see anything in the deletion/move logs though.

In fact, the file File:POL województwo kujawsko-pomorskie COA.svg has been
replaced on Jan 22 2011 (previous version moved to another name, new version
uploaded), so creation date is correctly _after_ its first usage. But there
_was_ a file with this name all the time, only with different content.

This is a listing I have received from Masur (http://commons.wikimedia.org/wiki/User:Masur)– sorry, in Polish:

  • (pokaż/ukryj) 16:37, 22 sty 2011 JDavid (dyskusja | edycje | zablokuj) przesłał File:POL województwo kujawsko-pomorskie COA.svg ‎ ({{Information | Description = {{pl|Herb województwa województwa kujawsko-pomorskiego}} {{en|Kuyavian-Pomeranian Voivodship Coat of Arms}} | Source = * Uchwała Nr 444/2000 Sejmiku Województw)
  • (pokaż/ukryj) 16:33, 22 sty 2011 JDavid (dyskusja | edycje | zablokuj) File:POL województwo kujawsko-pomorskie COA.svg przeniesiono do File:POL województwo kujawsko-pomorskie COA alt.svg ‎ (place for office pattern COA) (cofnij)
  • (pokaż/ukryj) 23:13, 31 lip 2006 Bastianow (dyskusja | edycje | zablokuj) przesłał File:POL województwo kujawsko-pomorskie COA.svg ‎ (correction)
  • (pokaż/ukryj) 23:10, 31 lip 2006 Bastianow (dyskusja | edycje | zablokuj) przesłał File:POL województwo kujawsko-pomorskie COA.svg ‎ (== Description == Herb województwa kujawsko-pomorskiego *Kuyavian-Pomeranian Voivodship Coat of Arms

I still don't get why http://pl.wikipedia.org/w/index.php?title=Specjalna%3ARejestr&type=&user=&page=Plik%3APOL+wojew%C3%B3dztwo+kujawsko-pomorskie+COA.svg&year=&month=-1&tagfilter=&hide_review_log=0 is empty though.

Anyway, if image is moved from title X to Y and a new one uploaded over X, stable versions of pages using X will look for the version of the file named X with the proper timestamp. This will fail, since that version is now under title Y. As long as the page using X shows up as having pending file changes (it will after r82917), this is more tolerable.

FlaggedRevs does store the sha1 of the proper version of files that it want's to use. This means that it could fetch the files it wants by (sha1,timestamp), which, in this case, would get around this problem (since it isn't using the name).

arawak wrote:

(In reply to comment #8)

I still don't get why
http://pl.wikipedia.org/w/index.php?title=Specjalna%3ARejestr&type=&user=&page=Plik%3APOL+wojew%C3%B3dztwo+kujawsko-pomorskie+COA.svg&year=&month=-1&tagfilter=&hide_review_log=0
is empty though.

Anyway, if image is moved from title X to Y and a new one uploaded over X,
stable versions of pages using X will look for the version of the file named X
with the proper timestamp. This will fail, since that version is now under
title Y. As long as the page using X shows up as having pending file changes
(it will after r82917), this is more tolerable.

FlaggedRevs does store the sha1 of the proper version of files that it want's
to use. This means that it could fetch the files it wants by (sha1,timestamp),
which, in this case, would get around this problem (since it isn't using the
name).

Could you please translate it into English? ;-) I do not understand if there is hope or not? More: do you suggest that this practice on Commons (replacing files by moving previous version under new name and uploading new one) is wrong? (Or rather potentially can cause technical problems?) This knowledge should then be transferred to Commons folks to avoid problems.

Basically, there is already one fix in the development code (/trunk) that will have pages with blue-linked images like this *actually say* that "template/file changes need review" like it should. Right now, these pages act like the stable and latest versions have no pending changes and silently give different behavior for logged-out users (which is bad). This will be fixed.

The other thing is whether the above improvement is good enough. If it's not, I can try to actually have the thumbnails show in these cases rather than blue links. It would require some potentially tricky change to the MediaWiki parser code though.

Fetch files by sha1, avoiding blue link on rename+no redirect

Here is what the code to use the hash to find files might be like. Needs sanity check and review.

attachment fetchfilesbysha1.patch ignored as obsolete

Updated patch

Attached:

Should be fixed in r84591, r84610, r84618, r84619.

arawak wrote:

New example (I hope it may help): on page http://pl.wikipedia.org/wiki/Pomnik_Bohater%C3%B3w_Warszawy the image File:Fotothek df ps 0005997 Denkmäler - Denkmale - Ehrenmäler - Ehrenmale ^ Kriegsden.jpg does not show for IP users, and shows OK for logged-in users.
This photo was created in 2009 and placed in plwiki in 2011; no templates nor inclusions involved at all. Even the way it is placed is standard (only parameters are "thumb" & "left"), so this case suggests another mechanism behind the error. I consider this error NOT FIXED yet.

The change isn't even live yet. Bugs are closed once the /trunk code is fixed.

I've tagged the Aaron's revisions for review and merging. Hopfully, we'll have it done this weekend.

(In reply to comment #16)

I've tagged the Aaron's revisions for review and merging. Hopfully, we'll have
it done this weekend.

r82917 should be merged, not the others.