[ 
https://issues.apache.org/jira/browse/JENA-612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14258379#comment-14258379
 ] 

Bruno P. Kinoshita commented on JENA-612:
-----------------------------------------

Successfully reproduced this issue on Ubuntu 14.04, JDK 1.7. In my case I start 
Fuseki with the user fuseki, pointing to /var/lib/jena/DB. Stopped the service, 
chown'd the directory to root and chmod'd it to 0755. 

Started Fuseki, noticed the success startup message, but a {{service fuseki 
status}} right after that gives me that fuseki is not running. Nothing in the 
logs too. 

In the pull request https://github.com/apache/jena/pull/13, instead of starting 
the {{java}} executable in the init script, it utilizes {{--startas /bin/bash 
-- -c "exec $JAVA $RUN_ARGS\[*\] > $FUSEKI_LOGS_STDERROUT 2>&1"}}

After applying it in my local env, this is what I get:

{noformat}
root@chuva:/opt/fuseki# service fuseki start
Starting Fuseki: /usr/bin/java -Xmx1200M -jar /opt/fuseki/fuseki-server.jar 
--loc=/var/lib/jena/DB --port=3030 --update /ds
STARTED Fuseki Wed Dec 24 14:37:12 BRST 2014
PID=13707
{noformat}

And a {{cat /opt/fuseki/stderrout.log}}

{noformat}
com.hp.hpl.jena.tdb.base.file.FileException: Failed to open: 
/var/lib/jena/DB/node2id.idn (mode=rw)
        at 
com.hp.hpl.jena.tdb.base.file.ChannelManager.open$(ChannelManager.java:82)
        at 
com.hp.hpl.jena.tdb.base.file.ChannelManager.openref$(ChannelManager.java:56)
        at 
com.hp.hpl.jena.tdb.base.file.ChannelManager.acquire(ChannelManager.java:45)
        at com.hp.hpl.jena.tdb.base.file.FileBase.<init>(FileBase.java:61)
        at com.hp.hpl.jena.tdb.base.file.FileBase.<init>(FileBase.java:50)
        at com.hp.hpl.jena.tdb.base.file.FileBase.create(FileBase.java:45)
        at 
com.hp.hpl.jena.tdb.base.file.BlockAccessBase.<init>(BlockAccessBase.java:46)
        at 
com.hp.hpl.jena.tdb.base.file.BlockAccessMapped.<init>(BlockAccessMapped.java:63)
        at 
com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.createMMapFile(BlockMgrFactory.java:90)
        at 
com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.createFile(BlockMgrFactory.java:80)
        at 
com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.create(BlockMgrFactory.java:58)
        at 
com.hp.hpl.jena.tdb.setup.Builder$BlockMgrBuilderStd.buildBlockMgr(Builder.java:196)
        at 
com.hp.hpl.jena.tdb.setup.Builder$RangeIndexBuilderStd.createBPTree(Builder.java:165)
        at 
com.hp.hpl.jena.tdb.setup.Builder$RangeIndexBuilderStd.buildRangeIndex(Builder.java:134)
        at 
com.hp.hpl.jena.tdb.setup.Builder$IndexBuilderStd.buildIndex(Builder.java:112)
        at 
com.hp.hpl.jena.tdb.setup.Builder$NodeTableBuilderStd.buildNodeTable(Builder.java:85)
        at 
com.hp.hpl.jena.tdb.setup.DatasetBuilderStd$NodeTableBuilderRecorder.buildNodeTable(DatasetBuilderStd.java:369)
        at 
com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.makeNodeTable(DatasetBuilderStd.java:280)
        at 
com.hp.hpl.jena.tdb.setup.DatasetBuilderStd._build(DatasetBuilderStd.java:141)
        at 
com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:131)
        at 
com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:66)
        at com.hp.hpl.jena.tdb.StoreConnection.make(StoreConnection.java:216)
        at 
com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction.<init>(DatasetGraphTransaction.java:75)
        at com.hp.hpl.jena.tdb.sys.TDBMaker._create(TDBMaker.java:57)
        at 
com.hp.hpl.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:45)
        at 
com.hp.hpl.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:104)
        at com.hp.hpl.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:73)
        at com.hp.hpl.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:69)
        at 
org.apache.jena.fuseki.FusekiCmd.processModulesAndArgs(FusekiCmd.java:297)
        at arq.cmdline.CmdArgModule.process(CmdArgModule.java:51)
        at arq.cmdline.CmdMain.mainMethod(CmdMain.java:101)
        at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
        at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
        at org.apache.jena.fuseki.FusekiCmd.main(FusekiCmd.java:167)
Caused by: java.io.FileNotFoundException: /var/lib/jena/DB/node2id.idn 
(Permission denied)
        at java.io.RandomAccessFile.open(Native Method)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:122)
        at 
com.hp.hpl.jena.tdb.base.file.ChannelManager.open$(ChannelManager.java:79)
        ... 33 more
{noformat}

Fixing the issue: 

{noformat}
root@chuva:/opt/fuseki# chown fuseki: /var/lib/jena/DB -R
root@chuva:/opt/fuseki# service fuseki start
Starting Fuseki: /usr/bin/java -Xmx1200M -jar /opt/fuseki/fuseki-server.jar 
--loc=/var/lib/jena/DB --port=3030 --update /ds
STARTED Fuseki Wed Dec 24 14:41:55 BRST 2014
PID=14018
root@chuva:/opt/fuseki# service fuseki status
Fuseki is running with pid: 14018
root@chuva:/opt/fuseki#
{noformat}

Note 1: Accessing shell arrays with {{RUN_ARGS\[@\]}} with the exec command 
didn't work when calling via init script, but {{RUN_ARGS\[*\]}} did the trick. 

Note 2: In the patch we are redirecting the stdout and stderr to the 
stderrout.log, which is convenient as you can see the java init command output, 
but maybe we should keep only the *stderr* output in the *stderrout.log* file?

> Fuseki does not log an error when failing to open a TDB dataset
> ---------------------------------------------------------------
>
>                 Key: JENA-612
>                 URL: https://issues.apache.org/jira/browse/JENA-612
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: Fuseki
>    Affects Versions: Fuseki 1.0.0
>            Reporter: Ian Dickinson
>            Priority: Minor
>
> Steps to recreate:
> 1. Create a TDB dataset owned by user A, with no write permission for other 
> or group.
> 2. Start fuseki via start-stop-daemon, per the fuseki init.d script provided 
> in the distribution, with $FUSEKI_USER set to be a user other than A and 
> --loc pointing to the dataset from step 1.
> 3. Fuseki starts, but then silently dies with no diagnostic.
> Analysis
> The --background flag in the start-stop-daemon call causes all stdout and 
> stderr output to get silently swallowed. Fuseki does not log the failure to 
> open the dataset to the log file, so the effect is that the daemon process 
> terminates with no obvious explanation or diagnostic.
> What I would like to happen:
> Catch the FileException and make an entry in the Fuseki log.
> Stack trace for reference:
> com.hp.hpl.jena.tdb.base.file.FileException: Failed to open: 
> /var/data-stores/transport/tdb/node2id.idn (mode=rw)
>       at 
> com.hp.hpl.jena.tdb.base.file.ChannelManager.open$(ChannelManager.java:82)
>       at 
> com.hp.hpl.jena.tdb.base.file.ChannelManager.openref$(ChannelManager.java:56)
>       at 
> com.hp.hpl.jena.tdb.base.file.ChannelManager.acquire(ChannelManager.java:45)
>       at com.hp.hpl.jena.tdb.base.file.FileBase.<init>(FileBase.java:61)
>       at com.hp.hpl.jena.tdb.base.file.FileBase.<init>(FileBase.java:50)
>       at com.hp.hpl.jena.tdb.base.file.FileBase.create(FileBase.java:45)
>       at 
> com.hp.hpl.jena.tdb.base.file.BlockAccessBase.<init>(BlockAccessBase.java:46)
>       at 
> com.hp.hpl.jena.tdb.base.file.BlockAccessMapped.<init>(BlockAccessMapped.java:63)
>       at 
> com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.createMMapFile(BlockMgrFactory.java:90)
>       at 
> com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.createFile(BlockMgrFactory.java:80)
>       at 
> com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.create(BlockMgrFactory.java:58)
>       at 
> com.hp.hpl.jena.tdb.setup.Builder$BlockMgrBuilderStd.buildBlockMgr(Builder.java:196)
>       at 
> com.hp.hpl.jena.tdb.setup.Builder$RangeIndexBuilderStd.createBPTree(Builder.java:165)
>       at 
> com.hp.hpl.jena.tdb.setup.Builder$RangeIndexBuilderStd.buildRangeIndex(Builder.java:134)
>       at 
> com.hp.hpl.jena.tdb.setup.Builder$IndexBuilderStd.buildIndex(Builder.java:112)
>       at 
> com.hp.hpl.jena.tdb.setup.Builder$NodeTableBuilderStd.buildNodeTable(Builder.java:85)
>       at 
> com.hp.hpl.jena.tdb.setup.DatasetBuilderStd$NodeTableBuilderRecorder.buildNodeTable(DatasetBuilderStd.java:382)
>       at 
> com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.makeNodeTable(DatasetBuilderStd.java:293)
>       at 
> com.hp.hpl.jena.tdb.setup.DatasetBuilderStd._build(DatasetBuilderStd.java:159)
>       at 
> com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:149)
>       at 
> com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:64)
>       at com.hp.hpl.jena.tdb.StoreConnection.make(StoreConnection.java:217)
>       at 
> com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction.<init>(DatasetGraphTransaction.java:75)
>       at com.hp.hpl.jena.tdb.sys.TDBMaker._create(TDBMaker.java:57)
>       at 
> com.hp.hpl.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:45)
>       at 
> com.hp.hpl.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:104)
>       at com.hp.hpl.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:73)
>       at com.hp.hpl.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:69)
>       at 
> org.apache.jena.fuseki.FusekiCmd.processModulesAndArgs(FusekiCmd.java:266)
>       at arq.cmdline.CmdArgModule.process(CmdArgModule.java:51)
>       at arq.cmdline.CmdMain.mainMethod(CmdMain.java:100)
>       at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
>       at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
>       at org.apache.jena.fuseki.FusekiCmd.main(FusekiCmd.java:141)
> Caused by: java.io.FileNotFoundException: 
> /var/data-stores/transport/tdb/node2id.idn (Permission denied)
>       at java.io.RandomAccessFile.open(Native Method)
>       at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233)
>       at java.io.RandomAccessFile.<init>(RandomAccessFile.java:118)
>       at 
> com.hp.hpl.jena.tdb.base.file.ChannelManager.open$(ChannelManager.java:79)
>       ... 33 more



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to