fuseki webinterface does not show datasets - jena

I have installed fuseki and start the server with
#!/bin/sh
cd /home/frank/localInstall/jena/apache-jena-fuseki-2.5.0
exec /home/frank/localInstall/jena/apache-jena-fuseki-2.5.0/fuseki-server -v --update --mem /testDB
The server is working and programs can store data in /testDB, but the webinterface does not show the datasets and I cannot add a dataset. When I try to query the interface says Please select a dataset.
I think I had this problem before and solved it by reinstalling the fuseki folder. I would like to understand what I did wrong and how to avoid this problem.
Thank you!
the config file is the one automatically generated. It is:
# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
## Fuseki Server configuration file.
#prefix : <#> .
#prefix fuseki: <http://jena.apache.org/fuseki#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] rdf:type fuseki:Server ;
# Example::
# Server-wide query timeout.
#
# Timeout - server-wide default: milliseconds.
# Format 1: "1000" -- 1 second timeout
# Format 2: "10000,60000" -- 10s timeout to first result,
# then 60s timeout for the rest of query.
#
# See javadoc for ARQ.queryTimeout for details.
# This can also be set on a per dataset basis in the dataset assembler.
#
# ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "30000" ] ;
# Add any custom classes you want to load.
# Must have a "public static void init()" method.
# ja:loadClass "your.code.Class" ;
# End triples.
.
How should I change it, if I want to datasets available to clients and to the webbrowser interface?

The problem was not with the config file, but with the default shiro.ini file in .../apache-jena-fuseki-2.5.0/run/shiro.ini. The default values do only allow local access and my access was a server. The instructions to change are clear enough. Here the relevant parts after the change:
[users]
# Implicitly adds "iniRealm = org.apache.shiro.realm.text.IniRealm"
admin=passXXX ## changed
[roles]
[urls]
## Control functions open to anyone
/$/status = anon
/$/ping = anon
## and the rest are restricted to localhost.
##/$/** = localhostFilter ## commented out
## If you want simple, basic authentication user/password
## on the operations,
## 1 - set a better password in [users] above.
## 2 - comment out the "/$/** = localhost" line and use:
"/$/** = authcBasic,user[admin]" ## enabled, removed ##
I assume that it is explained somewhere and I read it and forgot it when I moved from my localhost installation to a server. It would be helpful if the interface would indicate that permissions are not given in stead of inviting to select a dataset.

Related

mosquitto_pub config file format

Some MQTT-brokers accept auth-tokens as username (e.g. mqtt.flespi.io). In man mosquitto_pub I found that clients support configuration files:
FILES
$XDG_CONFIG_HOME/mosquitto_sub, $HOME/.config/mosquitto_pub
Configuration file for default options.
But there are no clarification about file format. I tried this:
username=foobar..token
# and
username foobar..token
# and
--username=foobar..token
# and
foobar..token#host.name:port
# and some other
# that I found in https://github.com/eclipse/mosquitto/blob/master/client/client_shared.c
but in all cases I have just
Error: Unknown option '--username.. and so on'.
and I'm not very good at C-lang.. Can someone please tell me how to cook it right?
A-ha, seems I found it (in the last possible combination I didn't test):
# ~/.config/mosquitto_pub
--username <username-or-token>
-h <broker.addre.ss>
# and so on
So, proper format is with leadig dashes and without equal sign
Now it allows to exec mosquitto_pub with short parameter list:
mosquitto_pub -t mydata/update -m 4

How to configure Apache Jena Fuseki with TDB and reasoner ? Error on DELETE dataset

Context
Despite the number of questions/answers on the subject, I'm stil having trouble to configure Apache Jena Fuseki...
I'm trying to configure an Apache Jena Fuseki instance with TDB and OWL reasoner activated, for testing my application. I need to create a dataset, execute my tests, and delete the dataset programatically.
Setup
I use stain/jena-fuseki docker image to run Apache Jena Fuseki.
I run Jena Fuseki in version 3.10.0.
bash-4.3# ./fuseki-server -version
Jena: VERSION: 3.10.0
Jena: BUILD_DATE: 2018-12-30T15:45:57+0000
TDB: VERSION: 3.10.0
TDB: BUILD_DATE: 2018-12-30T15:45:57+0000
Fuseki: VERSION: 3.10.0
Fuseki: BUILD_DATE: 2018-12-30T15:45:57+0000
Base Configuration
I use folowing shiro.ini file.
I allow full access for everyone this is only a test instance.
bash-4.3# cat /fuseki/shiro.ini
[main]
# Development
ssl.enabled = false
plainMatcher=org.apache.shiro.authc.credential.SimpleCredentialsMatcher
iniRealm.credentialsMatcher = $plainMatcher
[users]
admin=mysupersecurepassword
[roles]
[urls]
## Control functions open to anyone
/$/status = anon
/$/ping = anon
# Everything else
/**=anon
I use the default config.ttl file:
bash-4.3# cat /fuseki/config.ttl
# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
## Fuseki Server configuration file.
#prefix : <#> .
#prefix fuseki: <http://jena.apache.org/fuseki#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] rdf:type fuseki:Server ;
.
What I'm tring to do ?
For testing my application I'm trying to create a dataset, execute tests, and delete the dataset programatically. For this purpose I use Fuseki HTTP Administration Protocol.
I follow these steps:
POST /$/datasets to create dataset.
POST /dataset_name/data to upload data files.
(Execute my application tests)
POST /dataset_name?update=DROP+ALL to remove data.
DELETE /$/datasets/dataset_name to delete dataset.
Step 1:
Using curl :
curl -F 'files[]=#dataset.ttl' http://localhost:3030/$/datasets
I use following dataset.ttl file:
#prefix fuseki: <http://jena.apache.org/fuseki#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
#prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
#prefix : <#> .
# Custom code
tdb:GraphTDB rdfs:subClassOf ja:Model .
# Setup service
:service rdf:type fuseki:Service ;
rdfs:label "TDB dataset_name" ;
fuseki:name "dataset_name" ;
fuseki:dataset :dataset ;
fuseki:serviceQuery "query", "sparql" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:serviceReadGraphStore "get" ;
.
# Setup Assembler model with reasoner
:dataset rdf:type ja:RDFDataset;
ja:defaultGraph :modelInf ;
.
:modelInf rdf:type ja:InfModel;
ja:baseModel :tdbGraph ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
] ;
.
# TDB dataset used for RDF storage
:tdbGraph rdf:type tdb:GraphTDB;
tdb:location "/fuseki/databases/dataset_name" ;
.
Jena Fuseki logs
[2019-10-23 14:41:00] Admin INFO [6] POST http://localhost:3030/$/datasets
[2019-10-23 14:41:00] Admin INFO [6] Filename: dataset.ttl, Content-Type=application/octet-stream, Charset=null => Turtle : Count=19 Triples=19 Quads=0
[2019-10-23 14:41:00] Admin INFO [6] Create database : name = /dataset_name
[2019-10-23 14:41:02] Admin INFO [6] 200 OK (1.894 s)
Everything is OK :P
Step 2:
Using curl :
curl -F 'files[]=#data.rdf' http://localhost:3030/dataset_name/data
{
"count" : 1524 ,
"tripleCount" : 1524 ,
"quadCount" : 0
}
Jena Fuseki logs
[2019-10-23 14:44:52] Fuseki INFO [7] POST http://localhost:3030/dataset_name/data
[2019-10-23 14:44:53] Fuseki INFO [7] Filename: data.rdf, Content-Type=application/octet-stream, Charset=null => RDF/XML : Count=1524 Triples=1524 Quads=0
[2019-10-23 14:44:54] Fuseki INFO [7] 200 OK (1.858 s)
Everything is OK :P
Step 3 :
Testing my application (useless here)
Step 4:
Using curl :
curl -d "update=DROP+ALL" -X POST http://localhost:3030/dataset_name/update
...
Update succeeded
...
Jena Fuseki logs
[2019-10-23 15:04:13] Fuseki INFO [67] POST http://localhost:3030/dataset_name/update
[2019-10-23 15:04:14] Fuseki INFO [67] 200 OK (268 ms)
Everything is OK :P
Step 5:
Using curl :
curl -X DELETE http://localhost:3030/$/datasets/dataset_name
Jena Fuseki logs
[2019-10-23 15:10:17] Admin INFO [92] DELETE http://localhost:3030/$/datasets/dataset_name
[2019-10-23 15:10:17] Admin INFO [92] DELETE ds=/dataset_name
[2019-10-23 15:10:17] Server INFO Shutting down data service for [, data, upload, query, get, update, sparql]
[2019-10-23 15:10:17] Admin WARN [92] RC = 500 : Not in a transaction
org.apache.jena.tdb.transaction.TDBTransactionException: Not in a transaction
at org.apache.jena.tdb.transaction.DatasetGraphTransaction.get(DatasetGraphTransaction.java:140)
at org.apache.jena.tdb.transaction.DatasetGraphTransaction.getDatasetGraphToQuery(DatasetGraphTransaction.java:86)
at org.apache.jena.tdb.store.GraphTxnTDB.getDatasetGraphTDB(GraphTxnTDB.java:51)
at org.apache.jena.tdb.store.GraphTDB.sync(GraphTDB.java:128)
at org.apache.jena.tdb.store.GraphTDB.close(GraphTDB.java:133)
at org.apache.jena.reasoner.BaseInfGraph.close(BaseInfGraph.java:445)
at org.apache.jena.reasoner.rulesys.BasicForwardRuleInfGraph.close(BasicForwardRuleInfGraph.java:360)
at org.apache.jena.reasoner.rulesys.FBRuleInfGraph.close(FBRuleInfGraph.java:710)
at org.apache.jena.sparql.core.DatasetGraphMapLink.close(DatasetGraphMapLink.java:199)
at org.apache.jena.fuseki.server.DataService.expel(DataService.java:223)
at org.apache.jena.fuseki.server.DataService.shutdown(DataService.java:199)
at org.apache.jena.fuseki.mgt.ActionDatasets.execDeleteItem(ActionDatasets.java:360)
at org.apache.jena.fuseki.ctl.ActionContainerItem.execDelete(ActionContainerItem.java:105)
at org.apache.jena.fuseki.ctl.ActionContainerItem.perform(ActionContainerItem.java:64)
at org.apache.jena.fuseki.ctl.ActionCtl.executeLifecycle(ActionCtl.java:68)
at org.apache.jena.fuseki.ctl.ActionCtl.executeAction(ActionCtl.java:62)
at org.apache.jena.fuseki.ctl.ActionCtl.execCommonWorker(ActionCtl.java:53)
at org.apache.jena.fuseki.servlets.ActionBase.doCommon(ActionBase.java:74)
at org.apache.jena.fuseki.ctl.ActionContainerItem.doDelete(ActionContainerItem.java:52)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at org.apache.jena.fuseki.servlets.FusekiFilter.doFilter(FusekiFilter.java:101)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.apache.jena.fuseki.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:285)
at org.apache.jena.fuseki.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:248)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:690)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:745)
[2019-10-23 15:10:17] Admin INFO [92] 500 Not in a transaction (65 ms)
Here is the problem. Anyone can help solving this ?
Thoughts / Tries
I try same procedure with the default dataset configuration file and get no error. So I asume this come from the dataset configuration file.
Here what I called default dataset configuration file:
#prefix : <http://base/#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix tdb2: <http://jena.apache.org/2016/tdb#> .
#prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix fuseki: <http://jena.apache.org/fuseki#> .
:service_tdb_all a fuseki:Service ;
rdfs:label "TDB2 dataset_name" ;
fuseki:dataset :tdb_dataset_readwrite ;
fuseki:name "dataset_name" ;
fuseki:serviceQuery "query" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" .
:tdb_dataset_readwrite a tdb2:DatasetTDB2 ;
tdb2:location "/fuseki/databases/dataset_name" .
I don't find any clear enought for me documentation on how to properly configure Jena Fuseki. Lots of exemples can be found but dated from some years, don't know if they are still uptodate. And no explanation on how they really works so it is hard to addapt to a specific case.
If any docs / tutorial to explain what are "ja:RDFDataset", "ja:InfModel" and other "ja:things" and how they works would be much appreciated.
I'm still starting with ontology/triplestores/linked data and thoses docs are not the easiest to read :
https://jena.apache.org/documentation/assembler/
https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/assembler/JA.html
I tried different configuration examples and always get errors either on steps 1 or 5.
Example
Config:
#prefix : <#> .
#prefix fuseki: <http://jena.apache.org/fuseki#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
#prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] rdf:type fuseki:Server ;
fuseki:services (
<#service>
) .
## ---------------------------------------------------------------
## Service with only SPARQL query on an inference model.
## Inference model base data in TDB.
<#service> rdf:type fuseki:Service ;
fuseki:name "dataset_name" ;
fuseki:serviceQuery "query" , "sparql" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:dataset <#dataset> ;
.
<#dataset> rdf:type ja:RDFDataset ;
ja:defaultGraph <#model> ;
.
<#model> rdf:type ja:InfModel ;
ja:baseModel <#tdbGraph> ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner> ;
] ;
.
<#tdbGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#tdbDataset> ;
.
<#tdbDataset> rdf:type tdb:DatasetTDB ;
tdb:location "/fuseki/databases/dataset_name" ;
.
Error on step 1.
Fuseki log:
[2019-10-23 15:20:51] Admin INFO [93] POST http://localhost:3030/$/datasets
[2019-10-23 15:20:51] Admin INFO [93] Filename: dataset.ttl, Content-Type=text/turtle, Charset=null => Turtle : Count=23 Triples=23 Quads=0
[2019-10-23 15:20:51] Admin INFO [93] Create database : name = /dataset_name
[2019-10-23 15:20:51] Admin WARN [93] RC = 500 : cannot find a most specific type for :tdbGraph, which has as possibilities: ja:Model tdb:GraphTDB.
org.apache.jena.assembler.exceptions.AmbiguousSpecificTypeException: cannot find a most specific type for :tdbGraph, which has as possibilities: ja:Model tdb:GraphTDB.
The full server provides delete for databases created through the UI or protocol using one of the templates. Arbitrary configuration files pushed the server can't be deleted this way; even if they can be unlinked from the server, there might be stuff left around (they are arbitrary assmbler files) which isn't good for testing.
For testing, there is a simpler way. Spin up a server for each test, either scripted or from Java (JUnit etc).. The "Fuseki main" version of the server starts and stops quite quickly. So start a server with the configuration required - and you can use an in-memory TDB database (location is "--mem--") for the data if the data is reasonably small.
This will complete clearup when the server exits, making the tests cleanly isolated.

How to fix "ERROR Exception in init...model was aborted because of Read-only object file" with stain/jena-fuseki ? Docker, reasoner, TDB

"This question was solved by updating Jena Fuseki to latest version (>=v3.11.0). Thanks to #AndyS answer.".
Summary
I'm setting up a Jena Fuseki Dockerfile with a preconfigured dataset to ease Jena Fuseki configuration for my application.
I'm using the following Dockerfile:
FROM stain/jena-fuseki:3.10.0
COPY ./db_tdb.ttl /fuseki/configuration/
COPY ./ontology.rules /fuseki/configuration/
COPY ./ontology /fuseki/ontology/
Here is the file architecture used:
-- Dockerfile (Dockerfile for building the image)
-- db_tdb.ttl (Configuration file for the dataset)
-- ontology.rules (Define inference rules)
-- ontology (Folder contain ontology files description)
---- ontFile1.rdf
---- ontFile2.rdf
I build and run my image with following commands:
docker build -t myfuseki .
docker run -it -p 3030:3030 -e JVM_ARGS=-Xmx2048M myfuseki:latest
I'm getting the following error on running:
[2019-09-12 16:14:09] Server ERROR Exception in initialization: the loading of content into :model was aborted because of Read-only object file
What does this error means ? How to fix it?
Some of what I try
As the "model was aborted because of Read-only object file" I think it could be a file rights issue.
So I tried to change ontology files rights to 777 (not the best idea I know, but was for testing purpose) in the container.
But I still get the same issue.
File / Errors contents
Here is my db_tdb.ttl config file for Jena Fuseki:
#prefix : <#> .
#prefix fuseki: <http://jena.apache.org/fuseki#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
#prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] rdf:type fuseki:Server ;
fuseki:services (
<#service1>
) .
## ---------------------------------------------------------------
## Service with only SPARQL query on an inference model.
## Inference model base data in TDB.
<#service1> rdf:type fuseki:Service ;
fuseki:name "server" ;
fuseki:serviceQuery "query" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:dataset <#dataset> ;
.
<#dataset> rdf:type ja:RDFDataset ;
ja:defaultGraph <#model> ;
.
<#model> a ja:InfModel ;
ja:baseModel <#tdbGraph> ;
ja:content <#ontFile1> , <#ontFile2>;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/GenericRuleReasoner> ;
ja:rulesFrom <file:./ontology.rules>
] ;
.
<#tdbGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#tdbDataset> ;
.
<#tdbDataset> rdf:type tdb:DatasetTDB ;
tdb:location "/fuseki/databases/bemserver" ;
.
# Ontology files
<#ontFile1> ja:externalContent <file:/fuseki/ontology/ontFile1.rdf> .
<#ontFile2> ja:externalContent <file:/fuseki/ontology/ontFile2.rdf> .
Here is the full error:
[2019-09-12 16:14:09] Server ERROR Exception in initialization: the loading of content into :model was aborted because of Read-only object file
[2019-09-12 16:14:09] WebAppContext WARN Failed startup of context o.e.j.w.WebAppContext#6e4ea0bd{Apache Jena Fuseki Server,/,file:///jena-fuseki/webapp/,UNAVAILABLE}
org.apache.jena.assembler.exceptions.TransactionAbortedException: the loading of content into :model was aborted because of Read-only object file
doing:
root: file:///fuseki/configuration/db_tdb.ttl#model with type: http://jena.hpl.hp.com/2005/11/Assembler#InfModel assembler class: class org.apache.jena.assembler.assemblers.InfModelAssembler
root: file:///fuseki/configuration/db_tdb.ttl#dataset with type: http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class org.apache.jena.sparql.core.assembler.DatasetAssembler
at org.apache.jena.assembler.assemblers.ModelAssembler.addContent(ModelAssembler.java:55)
at org.apache.jena.assembler.assemblers.ModelAssembler.open(ModelAssembler.java:44)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.assembler.assemblers.AssemblerGroup.openModel(AssemblerGroup.java:47)
at org.apache.jena.sparql.core.assembler.DatasetAssembler.createDataset(DatasetAssembler.java:56)
at org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
at org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
at org.apache.jena.fuseki.build.FusekiConfig.buildDataAccessPoint(FusekiConfig.java:289)
at org.apache.jena.fuseki.build.FusekiConfig.readConfiguration(FusekiConfig.java:272)
at org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:251)
at org.apache.jena.fuseki.webapp.FusekiWebapp.initializeDataAccessPoints(FusekiWebapp.java:226)
at org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
at org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:952)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:558)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:917)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:370)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:410)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.server.Server.start(Server.java:416)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:383)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.apache.jena.fuseki.cmd.JettyFusekiWebapp.start(JettyFusekiWebapp.java:138)
at org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
Caused by: org.apache.jena.tdb.TDBException: Read-only object file
at org.apache.jena.tdb.base.objectfile.ObjectFileReadonly.write(ObjectFileReadonly.java:28)
at org.apache.jena.tdb.lib.NodeLib.encodeWrite(NodeLib.java:85)
at org.apache.jena.tdb.lib.NodeLib.encodeStore(NodeLib.java:73)
at org.apache.jena.tdb.store.nodetable.NodeTableNative.writeNodeToTable(NodeTableNative.java:172)
at org.apache.jena.tdb.store.nodetable.NodeTableNative.accessIndex(NodeTableNative.java:147)
at org.apache.jena.tdb.store.nodetable.NodeTableNative._idForNode(NodeTableNative.java:120)
at org.apache.jena.tdb.store.nodetable.NodeTableNative.getAllocateNodeId(NodeTableNative.java:76)
at org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getAllocateNodeId(NodeTableWrapper.java:40)
at org.apache.jena.tdb.store.nodetable.NodeTableInline.getAllocateNodeId(NodeTableInline.java:51)
at org.apache.jena.tdb.store.nodetupletable.NodeTupleTableConcrete.addRow(NodeTupleTableConcrete.java:85)
at org.apache.jena.tdb.store.DatasetPrefixesTDB.insertPrefix(DatasetPrefixesTDB.java:62)
at org.apache.jena.sparql.graph.GraphPrefixesProjection.setNsPrefix(GraphPrefixesProjection.java:41)
at org.apache.jena.sparql.graph.GraphPrefixesProjection.lambda$setNsPrefixes$0(GraphPrefixesProjection.java:66)
at java.util.HashMap$EntrySet.forEach(HashMap.java:1043)
at org.apache.jena.sparql.graph.GraphPrefixesProjection.setNsPrefixes(GraphPrefixesProjection.java:65)
at org.apache.jena.sparql.graph.GraphPrefixesProjection.setNsPrefixes(GraphPrefixesProjection.java:59)
at org.apache.jena.rdf.model.impl.ModelCom.setNsPrefixes(ModelCom.java:1055)
at org.apache.jena.assembler.assemblers.ContentAssembler$1.fill(ContentAssembler.java:146)
at org.apache.jena.assembler.Content.fill(Content.java:62)
at org.apache.jena.assembler.Content.fill(Content.java:62)
at org.apache.jena.assembler.assemblers.ModelAssembler.addContent(ModelAssembler.java:54)
... 51 more
Thanks for your help :P

freebsd ignores service startup

I installed 3proxy on freebsd(11.2-RELEASE-p10-HBSD FreeBSD ) which is whith opnsense from ports, but I cannot autoload it after restart
service 3proxy start - works nice
I make /usr/local/etc/rc.d/3proxy
-rwxr-xr-x 1 root wheel 653 Feb 26 20:35 3proxy
#!/bin/sh
# $FreeBSD: head/net/3proxy/files/3proxy.in 340872 2014-01-24 00:14:07Z mat $
# PROVIDE: threeproxy
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Define these threeproxy_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/threeproxy
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
threeproxy_enable=${threeproxy_enable-"NO"}
threeproxy_flags=${threeproxy_flags-"/usr/local/etc/3proxy.cfg"}
. /etc/rc.subr
name="threeproxy"
rcvar=threeproxy_enable
command="/usr/local/bin/3proxy"
load_rc_config $name
start_cmd="echo \"Starting ${name}.\"; ${command} ${threeproxy_flags} &"
run_rc_command "$1"
then added line here /etc/rc.conf
threeproxy_enable="YES"
But after restart I also see that service is down - how can I do this?
I also thought about crontab and #reboot.
Please help me

rsyslog inside docker containers => "rsyslogd is not running ... failed"

I am running rsyslog within docker containers to send UDP messages to logstash.
When I log into the docker container, and type:
service rsyslog status
shows:
rsyslogd is not running ... failed!
However, while I am in the container, if I type:
service rsyslog start
It starts up perfectly with no errors and no real sign of why it failed at the start
I CAN NOT FIGURE OUT WHY IT IS FAILING!!!!
*The rsyslog conf file has not been modified except the Modules to allow for imfile. The rsyslog.conf is as follows:
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#################
#### MODULES ####
#################
module(load="imfile" PollingInterval="10")
module(load="imuxsock" ) # provides support for local system logging
module(load="immark") #provides --MARK-- message capability
###########################
#### GLOBAL DIRECTIVES ####
###########################
#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
#
# Set the default permissions for all log files.
#
$FileOwner root
$FileGroup adm
$FileCreateMode 0644
$DirCreateMode 0755
$Umask 0022
#
# Where to place spool and state files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
###############
#### RULES ####
###############
#
# First some standard log files. Log by facility.
#
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
#cron.* /var/log/cron.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
#
# Logging for the mail system. Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info -/var/log/mail.info
mail.warn -/var/log/mail.warn
mail.err /var/log/mail.err
#
# Logging for INN news system.
#
news.crit /var/log/news/news.crit
news.err /var/log/news/news.err
news.notice -/var/log/news/news.notice
#
# Some "catch-all" log files.
#
*.=debug;\
auth,authpriv.none;\
news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
#
# Emergencies are sent to everybody logged in.
#
*.emerg :omusrmsg:*
#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
# news.=crit;news.=err;news.=notice;\
# *.=debug;*.=info;\
# *.=notice;*.=warn /dev/tty8
# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
# you must invoke `xconsole' with the `-file' option:
#
# $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
# busy site..
#
daemon.*;mail.*;\
news.err;\
*.=debug;*.=info;\
*.=notice;*.=warn |/dev/xconsole
*I have a script file that starts rsyslog
if [[ -z "$(pgrep rsyslog)" ]]; then
echo "starting rsyslog"
service rsyslog start
fi
My conf file is as follows:
##Get Nginx Error Logs
$InputFileName /var/log/nginx/error.log
$InputFileTag http-error
$InputFileStateFile stat-nginx-error
$InputFileSeverity error
$InputFileFacility local7
$InputRunFileMonitor
#GRAB PHP-FPM ACCESS LOGS
$InputFileName /var/log/php-fpm/access_log
$InputFileTag php-fpm-access
$InputFileStateFile stat-php-fpm-access
$InputFileSeverity info
$InputFileFacility local7
$InputRunFileMonitor
#GRAB PHP-FPM ERROR LOGS
$InputFileName /var/log/php-fpm/error_log
$InputFileTag php-fpm-error
$InputFileStateFile stat-php-fpm-error
$InputFileSeverity error
$InputFileFacility local7
$InputRunFileMonitor
#Json Template
template(name="json_temp" type="list")
{ constant(value="{")
constant(value="\"#timestamp\":\"") property(name="timegenerated" dateFormat="rfc3339")
constant(value="\",\"message\":\"") property(name="msg")
constant(value="\",\"severity_label\":\"") property(name="syslogseverity-text")
constant(value="\",\"severity\":\"") property(name="syslogseverity")
constant(value="\",\"facility_label\":\"") property(name="syslogfacility-text")
constant(value="\",\"facility\":\"") property(name="syslogfacility")
constant(value="\",\"program\":\"") property(name="programname")
constant(value="\",\"pid\":\"") property(name="procid")
constant(value="\",\"rawmsg\":\"") property(name="rawmsg")
constant(value="\",\"syslogtag\":\"") property(name="syslogtag")
constant(value="\"}\n")
}
if $programname == 'http-error' then #ip.address:port;json_temp
if $programname == 'http-error' then stop
if $programname == 'php-fpm-access' then #ip.address:port;json_temp
if $programname == 'php-fpm-access' then stop
if $programname == 'php-fpm-error' then #ip.address:port;json_temp
if $programname == 'php-fpm-error' then stop
*.* #ip.address:port;json_temp
Any help would be awesome because I do not understand why it is not starting up.
Cheers
We bumped upon the same issue on a Docker 17.03.2-ce image created on CentOS 7.3.1611. The solution is in verifying /etc/rsyslog.conf as per this documentation. Basically, in /etc/rsyslog.conf:
Remove $ModLoad imjournal
Set $OmitLocalLogging to off
Make sure $ModLoad imuxsock is present
Comment out: $IMJournalStateFile imjournal.state
Finally, note that running the rsyslogd or anything else, is the responsibility of the program that is being run inside the container. It is not going to get launched, automatically.
This is my rsyslog.conf in docker container(centos7):
$> cat /etc/rsyslog.conf |grep -vE '^$|^#'
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$WorkDirectory /var/lib/rsyslog
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
$OmitLocalLogging off
*.info;mail.none;authpriv.none;cron.none /var/log/messages
authpriv.* /var/log/secure
mail.* -/var/log/maillog
cron.* /var/log/cron
*.emerg :omusrmsg:*
uucp,news.crit /var/log/spooler
local7.* /var/log/boot.log
Also i changed /etc/rsyslog.d/listen.conf
#$SystemLogSocketName /run/systemd/journal/syslog
And then
$> rsyslogd -n
Thanks #elinax
More info at https://www.projectatomic.io/blog/2014/09/running-syslog-within-a-docker-container/
Add this line in file entrypoint.sh:
sudo service rsyslog start

Resources