Open white-gecko opened 8 years ago
We should also try if we can reproduce the empty error message reported in https://groups.google.com/forum/#!topic/ontowiki-user/ggWiE_wuEU4
It was me who reported the empty error message in https://groups.google.com/forum/#!topic/ontowiki-user/ggWiE_wuEU4. Please get in touch if you want help reproducing this. As i said in that report, the empty error message was an intermittent problem, but for me happened more than 50% of the time.
@matt-wallis could you tell if this mainly happens for certain serialization formats, e.g. RDF/XML but not Turtle?
I am presented with following erro while importing the AKSW model:
Could not import given model: Error importing statements: SQL Error: [OpenLink][Virtuoso iODBC Driver][Virtuoso Server]FA112: Can't stat file '/tmp/phpEAR6bq', error (2) : No such file or directory () in query: CALL DB.DBA.RDF_LOAD_RDFXML(FILE_TO_STRING_OUTPUT('/tmp/phpEAR6bq'), 'http://localhost/OntoWiki/index.php/AKSW/', 'http://localhost/OntoWiki/index.php/AKSW/')
I tried to do the following: '/private/var/tmp/' to the list behind 'DirsAllowed' unfortunately did not worked out in my case..
Any clue whats going wrong ?
Is the /tmp directory listed in the DirsAllowed
-line in your virtuoso.ini? Is the /tmp directory also writable for your php process and readable for your virtuoso user?
the tmp directory is not listed in my DirsAllowed line it is as following: ., usr/share/virtuoso-opensource-6.1/vad
by running the following block:
// Create a temporary file in the temporary // files directory using sys_get_temp_dir() $temp_file = tempnam(sys_get_temp_dir(), 'Tux');
echo $temp_file;
I know the tmp directories path is : /tmp
Ok, so you should add /tmp
to your DirsAllowed variable.
DirsAllowed = ., /usr/share/virtuoso-6.1/vad, /tmp
This is also described in http://docs.ontowiki.net/VirtuosoBackend.html#configuring-virtuoso
Thanks, it was skipped though but now even after adding and restarting server the error persists:
Could not import given model: Error importing statements: SQL Error: [OpenLink][Virtuoso iODBC Driver][Virtuoso Server]FA112: Can't stat file '/tmp/php3bF2TR', error (2) : No such file or directory () in query: CALL DB.DBA.RDF_LOAD_RDFXML(FILE_TO_STRING_OUTPUT('/tmp/php3bF2TR'), 'http://localhost/OntoWiki/index.php/ALGO/', 'http://localhost/OntoWiki/index.php/ALGO/')
Can you somehow verify if the file is actually created in /tmp or not?
I did a watch and I observed there isn't any file being created in temp !
can you verify, that you can write to /tmp
with some other php script?
If you add the following file to your server directory, next to the ontowiki or temporarily instead of the ontowiki you could verify, that your php process can write to tmp:
<?php
$filename = tempnam(sys_get_temp_dir(), 'Tux');
echo $filename;
// FROM http://php.net/manual/en/function.fwrite.php
// changed fopen mode from 'a' to 'w'
$somecontent = "Add this to the file\n";
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'w')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
If you add the following file to your server directory, next to the ontowiki or temporarily instead of the ontowiki you could verify, that your php process can write to tmp:
<?php
$filename = tempnam(sys_get_temp_dir(), 'Tux');
echo $filename;
// FROM http://php.net/manual/en/function.fwrite.php
// changed fopen mode from 'a' to 'w'
$somecontent = "Add this to the file\n";
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'w')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
It does write to temp: /tmp/TuxnlsOGhSuccess, wrote (Add this to the file ) to file (/tmp/TuxnlsOGh)
but the problem persists as following:
Could not import given model: Error importing statements: SQL Error: [OpenLink][Virtuoso iODBC Driver][Virtuoso Server]FA112: Can't stat file '/tmp/phpsLmioW', error (2) : No such file or directory () in query: CALL DB.DBA.RDF_LOAD_RDFXML(FILE_TO_STRING_OUTPUT('/tmp/phpsLmioW'), 'http://localhost/OntoWiki/index.php/data/', 'http://localhost/OntoWiki/index.php/data/')
+1 year. I see the same import errors when attempting to import while running the OntoWiki.compose docker images. I expected that these would come pre-configured to allow access to the storage of each image.
Now going off to RTM for docker-compose to determine if I need to provide a volume, specify some access to local drives, or run as root, etc.
I am also having this issue.... has anyone been able to solve this issue? Could not import given model: Error importing statements: SQL Error: [OpenLink][Virtuoso iODBC Driver][Virtuoso Server]FA112: Can't stat file '/tmp/phpLOQQ5c', error (2) : No such file or directory () in query: CALL DB.DBA.RDF_LOAD_RDFXML(FILE_TO_STRING_OUTPUT('/tmp/phpLOQQ5c'), .....
Is this project still alive btw, or should I move on to an alternative?
Actually I was not able to reproduce the error. Can you give me some hint on how to produce it? Last time I tried it everything was working fine.
According to https://groups.google.com/forum/#!topic/ontowiki-user/ggWiE_wuEU4 we seem to have an issue of empty or wrong error reporting to the OntoWiki front-end, if the php temporary folder was not granted access in the virtuoso configuration ini file.
Even though for running OntoWiki it is necessary that the user grants access to the PHP temporary folder in the virtuoso configuration, we should correctly report the error in the OntoWiki user interface.
e.g.
For this message we also have to make sure, that we always find the temporary folder used by OntoWiki resp. PHP.