# Spatial index problem crashes server without recovery option

**URL:** <https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484>\
**Category:** Bug\
**Created:** [July 26, 2017, 9:50am UTC](https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484 "2017-07-26T09:50:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![semanticfire](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/semanticfire/32/47_2.png) [@semanticfire](https://community.stardog.com/u/semanticfire)\
**Post date:** [July 26, 2017, 9:50am UTC](https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484/1 "2017-07-26T09:50:01Z")

</div>

We have run into a issue where enabling a spatial index on a database causes the server to crash, restarting the server causes a immediate crash again.

```
ERROR 2017-07-26 11:24:37,547 [Stardog.Executor-0] com.complexible.stardog.spatial.io.RDFGeospatialSource:lambda$parse$19(142): Failed to parse unknown/malformed shape: <http://www.opengis.net/def/crs/EPSG/0/28992> POINT(132569 517118)

```

I’ve tried moving the database directory outside the stardog data directory, the server complains about a missing database and stops as well.

```
WARN 2017-07-26 11:28:02,233 [main] com.complexible.stardog.db.DatabaseFactoryImpl:read(141): Database inspire is invalid and the repair failed: File (/home/stardog/data/inspire) is not a directory, could not find an index at this location
INFO 2017-07-26 11:28:02,234 [main] com.complexible.stardog.StardogKernel:initDatabases(2263): Database inspire will not be available because there was an error initializing the database: The index directory does not exist
ERROR 2017-07-26 11:28:02,986 [main] com.complexible.stardog.Stardog:initKernel(224): There was an error during kernel init
com.complexible.stardog.security.ResourceNotFoundException: Permission does not exist.
        at com.complexible.stardog.security.index.IndexAuthorizationManager.assertExists(IndexAuthorizationManager.java:203) ~[stardog-core-security-5.0.jar:?]
        at com.complexible.stardog.security.index.IndexAuthorizationManager.delete(IndexAuthorizationManager.java:312) ~[stardog-core-security-5.0.jar:?]
        at com.complexible.stardog.security.impl.SystemSecurityManagerImpl.delete(SystemSecurityManagerImpl.java:389) ~[stardog-core-security-5.0.jar:?]
        at com.complexible.stardog.security.index.IndexBackedSystemSecurityManager.delete(IndexBackedSystemSecurityManager.java:205) ~[stardog-core-security-5.0.jar:?]
        at com.complexible.stardog.security.StardogSecurityManagerImpl.delete(StardogSecurityManagerImpl.java:638) ~[stardog-5.0.jar:?]
        at com.complexible.stardog.security.StardogSecurityManagerImpl.deleteUserPerm(StardogSecurityManagerImpl.java:123) ~[stardog-5.0.jar:?]
        at com.complexible.stardog.StardogKernel.lambda$dbPermissions$20(StardogKernel.java:1992) ~[stardog-5.0.jar:?]
        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) ~[shiro-core-1.2.3.jar:1.2.3]
        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) ~[shiro-core-1.2.3.jar:1.2.3]
        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) ~[shiro-core-1.2.3.jar:1.2.3]
        at com.complexible.stardog.StardogKernel.dbPermissions(StardogKernel.java:1987) ~[stardog-5.0.jar:?]
        at com.complexible.stardog.StardogKernel.handleUnusableIndex(StardogKernel.java:2311) ~[stardog-5.0.jar:?]
        at com.complexible.stardog.StardogKernel.initDatabases(StardogKernel.java:2272) ~[stardog-5.0.jar:?]
        at com.complexible.stardog.StardogKernel.start(StardogKernel.java:2199) ~[stardog-5.0.jar:?]
        at com.complexible.stardog.StardogKernel.initialize(StardogKernel.java:739) ~[stardog-5.0.jar:?]
        at com.complexible.stardog.Stardog.initKernel(Stardog.java:219) [stardog-5.0.jar:?]
        at com.complexible.stardog.Stardog.<init>(Stardog.java:211) [stardog-5.0.jar:?]
        at com.complexible.stardog.Stardog.<init>(Stardog.java:65) [stardog-5.0.jar:?]
        at com.complexible.stardog.Stardog$StardogBuilder.create(Stardog.java:560) [stardog-5.0.jar:?]
        at com.complexible.stardog.cli.impl.ServerStart.call(ServerStart.java:145) [stardog-cli-5.0.jar:?]
        at com.complexible.stardog.cli.impl.ServerStart.call(ServerStart.java:44) [stardog-cli-5.0.jar:?]
        at com.complexible.stardog.cli.CLIBase.execute(CLIBase.java:55) [stardog-cli-5.0.jar:?]
        at com.complexible.stardog.cli.admin.CLI.main(CLI.java:182) [stardog-cli-5.0.jar:?]
Stardog could not be initialized: Permission does not exist.
Permission does not exist.
Waiting for running tasks to complete....done. Executor service has been shut down.

```

Can I disable the spatial index from command line ?

Any help greatly appreciated!

Bart

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [July 26, 2017, 1:16pm UTC](https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484/2 "2017-07-26T13:16:05Z")

</div>

You should be able to disable the spatial index from the command line but it requires that Stardog to be running so that you can take the database offline. I don’t know when it’s crashing during startup but you might be able to Start Stardog and take the db offline in a single command so hopeefully it gets taken offline before it reaches the point where it crashes.

```
stardog-admin server start && stardog-admin db offline --timeout 0 myDb

```

then disable the index

```
stardog-admin metadata set -o spatial.enabled=false -- myDb

```

I’m sure the Stardog folks would be very interested to see what’s in the logs during the parse error.

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [July 26, 2017, 1:20pm UTC](https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484/3 "2017-07-26T13:20:29Z")

</div>

> [@zachary.whitley](#):
>
> I’m sure the Stardog folks would be very interested to see what’s in the logs during the parse error.

You are very correct about that!

@semanticfire You can move the database directory outside of your STARDOG\_HOME, just create an empty directory to replace it and you can avoid the server complaints.

---

<div class="post-metadata">

**Author:** ![pedro](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pedro/32/108_2.png) [@pedro](https://community.stardog.com/u/pedro)\
**Post date:** [July 26, 2017, 11:24pm UTC](https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484/4 "2017-07-26T23:24:03Z")

</div>

Hi Bart,

Can you share with us the stack trace of how Stardog is crashing and unable to restart?  
Is it related to that `Failed to parse unknown/malformed shape` error log?

---

<div class="post-metadata">

**Author:** ![semanticfire](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/semanticfire/32/47_2.png) [@semanticfire](https://community.stardog.com/u/semanticfire)\
**Post date:** [July 27, 2017, 2:16am UTC](https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484/5 "2017-07-27T02:16:17Z")

</div>

where can I send you the logfile ?

---

<div class="post-metadata">

**Author:** ![pedro](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pedro/32/108_2.png) [@pedro](https://community.stardog.com/u/pedro)\
**Post date:** [July 27, 2017, 10:01am UTC](https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484/6 "2017-07-27T10:01:59Z")

</div>

Send it to my email: [pedro@stardog.com](mailto:pedro@stardog.com)  
Thanks!

---

<div class="post-metadata">

**Author:** ![semanticfire](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/semanticfire/32/47_2.png) [@semanticfire](https://community.stardog.com/u/semanticfire)\
**Post date:** [July 27, 2017, 10:27am UTC](https://community.stardog.com/t/spatial-index-problem-crashes-server-without-recovery-option/484/7 "2017-07-27T10:27:48Z")

</div>

done

BTW, it is still 5.0 I haven’t had the time to test 5.0.1 due to travel and holidays
