Last modified: 2012-11-01 18:08:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30334, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28334 - Wrong properties of page with semantic mediawiki
Wrong properties of page with semantic mediawiki
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Markus Krötzsch
http://www.wikirio.com.br/Sandbox:Ipa...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-30 18:02 UTC by edgard
Modified: 2012-11-01 18:08 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Dump of pt_smw_ids (54.72 KB, application/x-zip-compressed)
2011-03-31 12:54 UTC, edgard
Details

Description edgard 2011-03-30 18:02:10 UTC
My SemanticMediaWiki is behaving in a strange way.

If I edit an page, SemanticMediaWiki gets the properties of that page normally.

But if I run maintenance or any other automatictly update from SemanticMediaWiki, pages are saved with properties of other pages.

For example:

http://www.wikirio.com.br/Sandbox:Ipanema

You'll notice that there's a restaurante called "Plataforma". On my ASK query I have for the Property "Bairros" the value "Ipanema". If you go to the page "Plataforma" you'll also noticed that "Bairro" property is actually "Leblon", not "Ipanema". But, if you edit the page and save without changing any information, this page will no longer be available at "Sandbox:Ipanema".

The "Plataforma" that you see in the "Sandbox:Ipanema" is using information from a page called "Porcão". http://www.wikirio.com.br/Porc%C3%A3o_(Ipanema)

I already tried to fix all the pages, editing and saving, but wrong pages always come back when I run the Maintenance(http://www.wikirio.com.br/Especial:SMWAdmin)

Sometimes I see images, CSS, etc on this page (Sandbox), with Properties from other pages. Pages that we don't have properties. This happens a lot.

Thanks!
Comment 1 Markus Krötzsch 2011-03-31 07:17:42 UTC
Interesting. There is a general discrepancy between the data stored in the DB and the data displayed on the wiki pages (as you rightly notice, many pages are affected). I am not sure how this can be caused.

A direct way to view the data stored in the DB for one page is Special:Browse. For example, you can easily see the problem by comparing the factbox of

http://www.wikirio.com.br/Plataforma

with

http://www.wikirio.com.br/Especial:Navegar/Plataforma

This special page also allows you to search for other entries with similar properties. In the above case, we find the same data again on

http://www.wikirio.com.br/Especial:Navegar/Bardot

but (curiously) not on

http://www.wikirio.com.br/Especial:Navegar/Porc%C3%A3o-20%28Ipanema%29


This is all very strange. I will need more information for debugging this. Could you give me access to a dump of the database table "smw_ids"? You can generate this data by running

mysqldump <yourdbname> smw_ids -u <yourusername> -p

If you used a table prefix when installing MediaWiki, you will have to add it in front of smw_ids. The table contains a list of all pages names that SMW knows about. It does not contain confidential or user information.
Comment 2 edgard 2011-03-31 12:54:29 UTC
Created attachment 8354 [details]
Dump of pt_smw_ids
Comment 3 edgard 2011-03-31 13:00:35 UTC
Hi Markus!

Yes, you understood the issue well! :) I just edited Plataforma and saved again with no changes, and it started working with the right properties. But I'm sure it wont work again when I run maintenance.

I have sent you the dump. Let me know if you need access to my database. I don't mind (just send me your email privatly).

Another thing is that I once created a namespace and gave up on it. I don't know if this could have changed anything. I not sure when this problem started. :(

Regards
Comment 4 Markus Krötzsch 2011-03-31 13:39:55 UTC
Ok, the dump does not seem to have any problems. The namespace issue might potentially cause problems, but I have no idea right now how this could lead to the issues you observe.

There is a chance that spurious errors occur if something was messed up in the update jobs that the update at http://www.wikirio.com.br/Especial:SMWAdmin triggers. These jobs are also used elsewhere, so if they are broken then problems will always re-occur even if the update is not run.

Could you do the following check please?

* Find a page with wrong data; verify that the data is wrong by looking at it in http://www.wikirio.com.br/Especial:Navegar
* Login to your server and go to the directory ./extensions/SemanticMediaWiki/maintenance beneath your installation path.
* Run 

php SMW_refreshData.php --page "Nameofyourpage"

(to make sure that this works as expected, it is good to pick a page without difficult characters or special symbols).
* Look at Especial:Navegar again to see if the data of the page has changed (at least the modification date should change, the question is if the errors go away, too).

If the errors do not go away, try the same experiment with a page that has correct data in the wiki and see if it gets wrong data.

Another question: when a page has wrong data, does this data always come from the same other page?
Comment 5 Markus Krötzsch 2011-03-31 13:43:32 UTC
P.S. I think the change of namespace mainly means that pages in the "Sandbox" namespace (when it existed) will now appear in the Main namespace when retrieved from the database. This effect can be seen at

http://www.wikirio.com.br/Especial:Navegar/Modelo

which claims to have a redirect from itself, when in reality it has a redirect to "Sandbox: Modelo". Storing the page again should fix this problem.

Again, I cannot see how this causes the other problems you describe.
Comment 6 edgard 2011-03-31 14:09:45 UTC
Markus,

Does not update anything. Nothing has changed. I just noticed that the working ones has really old properties that are not used anymore. Im going to reset all Semantics so we can be sure that we're debbuging the right Issue. I have done this before and didnt fix, but I had to restore the database.

About he data, yes, always comes from other pages. The are images and css showing at semantics with properties of restaurants, for example.

I'll follow the instructions on the page
http://semantic-mediawiki.org/wiki/Help:Repairing_SMW's_data

1. php SMW_setup.php --delete
2. php SMW_refreshData.php -ftpv -s 0 -e 500
3. php SMW_refreshData.php -ftpv -s 501 -e 1000
4. php SMW_refreshData.php -ftpv -s 1001 -e 1500
5. php SMW_refreshData.php -ftpv -s 1501 -e 2000
...
10. php SMW_refreshData.php -v

Can you tell me if this is the right way to go?
Comment 7 Markus Krötzsch 2011-03-31 14:42:04 UTC
(In reply to comment #6)
> Markus,
> 
> Does not update anything. Nothing has changed.

That is very strange. Does the script say "Refreshing specified pages!" and "1 pages refreshed." or what exactly is the output? If the output is correct, then maybe some HTTP or browser caching prevents you from seeing the change? I have to correct myself: the modification date would not be changed. But it would still be surprising if both the wrong and the correct pages are refreshed to exactly the same data with this script.

... 
> I'll follow the instructions on the page
> http://semantic-mediawiki.org/wiki/Help:Repairing_SMW's_data
> 
> 1. php SMW_setup.php --delete
> 2. php SMW_refreshData.php -ftpv -s 0 -e 500
> 3. php SMW_refreshData.php -ftpv -s 501 -e 1000
> 4. php SMW_refreshData.php -ftpv -s 1001 -e 1500
> 5. php SMW_refreshData.php -ftpv -s 1501 -e 2000
> ...
> 10. php SMW_refreshData.php -v
> 
> Can you tell me if this is the right way to go?

That's not quite right: the parameter "-f" of SMW_refreshData.php will delete the database (you should also see a warning). So you should not use it many times in a row. If you manually call "SMW_setup.php --delete" then you do not need to use -f at all (in this case, you must call SMW_setup.php without parameters first to re-create the SMW tables).

I am curious if this complete reset fixes your problem.

If this does not help, then the next step will be to uncomment all extensions in LocalSettings.php and load Semantic MediaWiki only. Then repeat the complete refresh (with delete) and see if this helps. If not, then we have at least clarified that this is an SMW problem and not caused by another extension.
Comment 8 edgard 2011-03-31 15:02:17 UTC
Markus,

Great! I was following the instructions of the website 
http://semantic-mediawiki.org/wiki/Help:Repairing_SMW's_data

So I guess I should execute something like

1. php SMW_setup.php --delete
2. php SMW_setup.php
3. php SMW_refreshData.php -tpv -s 0 -e 500
4. php SMW_refreshData.php -tpv -s 501 -e 1000
5. php SMW_refreshData.php -tpv -s 1001 -e 1500
6. php SMW_refreshData.php -tpv -s 1501 -e 2000
...
10. php SMW_refreshData.php -v

I'll have to do this later, to make a backup of the database first.

Thanks for your help,
Edgard.
Comment 9 edgard 2011-04-01 03:37:00 UTC
Markus,

I have fixed the issue.

I made a backup from the database and ran:
php SMW_setup.php --delete
php SMW_setup.php
php SMW_refreshData.php -v -s 1 -e 500
php SMW_refreshData.php -v -s 501 -e 1000
php SMW_refreshData.php -v -s 1001 -e 1500
php SMW_refreshData.php -v -s 1501 -e 1700
php SMW_refreshData.php -v -s 1701 -e 2000
php SMW_refreshData.php -v -s 2001 -e 2500
php SMW_refreshData.php -v -s 2501 -e 2800
php SMW_refreshData.php -v -s 2801 -e 3100
php SMW_refreshData.php -v -s 3101 -e 3400

Next I noticed that the Semantics was ignoring [[Category:Restaurantes]] when I decided to remove a form that I had on all pages using Template. When I did all of that, 7 hours of testing, all worked fine again.

Thank you for all your help. I dont know what caused the problem, but I think it's fine now. I'll return with news asap.


Thank you again,

Regards,
Edgard.
Comment 10 badon 2011-08-29 03:32:17 UTC
It appears this bug is invalid, and should be marked as resolved?
Comment 11 Markus Krötzsch 2012-11-01 18:08:55 UTC
Indeed, this problem seems to have vanished now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links