|Explains various common problems when running Semantic MediaWiki and how to fix them.|
|Table of Contents|
This page explains various common problems when running Semantic MediaWiki and how to fix them. Problems that are not in this list may be solved by SMW's support facilities or may be software bugs that you may wish to report.
Database errors: "unknown/nonexistent table"
- Previewing or storing articles with semantic properties causes database errors.
Most likely, your database was not initialized properly. Go to the special page "Special:SMWAdmin" on your wiki for instructions. If all fails, run the maintenance script
php rebuildData.php -vfp
php rebuildData.php -v
in case you already stored annotations.
Database errors: "illegal collation"
- When issuing semantic queries, I receive database errors that talk about some "illegal collation". Otherwise storing of annotations seems to work.
Your database tables for MediaWiki and SMW have been generated with different settings. To fix the problem, first try to run the maintenance script
php rebuildData.php -vfp
php rebuildData.php -v
If this does not help, you need to investigate the collation/character set settings of your DB. To do that, use a DB frontend tool or the SQL command
SHOW CREATE TABLE tablename;
Look up the collation/charset of, e.g., the table "categorylinks" and change the default collation/charset of your DB to these settings as described in the MySQL manual. Finally, run the aforementioned maintenance scripts again.
Database errors: "Error: 5 Out of memory"
- When trying to edit a page, I receive MediaWiki errors 'Exception encountered, of type "RuntimeException"'
This is an issue with the MySQL database backend. This issue cannot be solved by Semantic MediaWiki where the DB back-end itself is refusing (or better is incapable to answer) the request due to technical limitations. It is suggested to consult the MySQL documentation to see whether increasing the "buffer_size" can help mitigate the encounter issue or not.1
Wrong or incomplete data
- Data has been entered and shows up in the factbox, but it is not shown when using special page "Special:Browse".
- Semantic queries do not return the expected results.
It is possible that the data used by SMW is not in sync with the page contents in your wiki. To check this, edit a page that is affected and use Special:Browse to see if its data is now correct. To fix all pages automatically, read the help page on repairing SMW's data. If this was not your problem have a look at the next item on this page.
Missing data on custom namespaces
- Data entered on pages in my custom namespace (e.g. "Portal:") is ignored, and queries do not show any pages of my custom namespace.
Make sure your custom namespace is listed in configuration parameter
$smwgNamespacesWithSemanticLinksDefines for which namespaces the semantic links and annotations are to be evaluated. If this fails, check whether you have restricted queries to certain namespaces using
Non-English language fails
- In my non-English installation, properties don't work even when I follow the examples.
Although SMW normally provides English aliases, you may need to use the localised names for special properties and namespaces. The translated strings and aliases for each language are in the languages subdirectory.
Adding the following to the "LocalSettings.php" file may help:
setlocale( LC_ALL, "C.UTF-8" );
Blank or incomplete pages
- After installing SMW, some or all pages are not displayed at all, or just incompletely.
This is usually due to the restrictive memory default settings on some sites, and is not directly caused by SMW (any additional extension code might cause this). Add the line
$wgMemoryLimit = "64M";
in the "LocalSettings.php" file and possibly adjust the value to your needs. MediaWiki's standard value is 50M and values more than 100M are hardly useful.
Large queries break for no obvious reason
- In case I try to run queries with a lot of printout statements (> 7) Special:Ask abandons the entries I have made.
Most likely you are working in an environment that only supports small URL length limits using Suhosin. This means that in case a URL exceeds this limit, the request is split up and thus causes the query to break. To solve this problem you have to set the variable
"suhosin.get.max_value_length" to a value of
1024 or higher in the "php.ini" file on your server.
Parser functions are not working on a wiki using the StructuredDiscussions (Flow) extension
- When the StructuredDiscussions (Flow) extension is enabled in "LocalSettings.php" before Semantic MediaWiki, the parser functions of Semantic MediaWiki are not registered when "rebuildDate.php "is called. Inline queries are misinterpreted as an annotation with the error message: "error message a property chain is not permitted during the annotation process".2
To mitigate this issue you need to make sure that the StructuredDiscussions (Flow) extension is invoked after Semantic MediaWiki like e.g.
enableSemantics( 'example.org' ); wfLoadExtension( 'Flow' );
/tmp/smw_xxx.tmp is not readable on Apache
- When running "runJobs.php" I get something a runtime excepion error for "
2020-11-14 08:52:02 smw.changePropagationDispatch Property:DeltaComment_new dataFile=/tmp/smw_chgprop_6slrhnape3u0_0.tmp checkSum=577358595327861b70a55ed6b8d78ccc rootJobIsSelf=1 rootJobSignature=dfecb1d880ba46d7b06e352d0c0a3589cc8f1426 rootJobTimestamp=20201113073543 namespace=102 title=DeltaComment_new requestId=8a9d6046915bb17e6885716f (id=20912,timestamp=20201114085202) t=2 error=RuntimeException: /tmp/smw_chgprop_6slrhnape3u0_0.tmp is not readable.
To mitigate this issue you may need to set
PrivateTmp=false for your Apache.4
- Help page on installation issues you may encounter
- Semantic MediaWiki: GitHub issue gh:smw:2130
- Semantic MediaWiki: GitHub issue gh:smw:4954
- Semantic MediaWiki: GitHub issue gh:smw:4883
- max oberberger: How to disable debian 9 private tmp