# Setting SCM\_Home To a network location gives an error

**URL:** https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696
**Category:** SCM-Manager Bug Reports
**Created:** [May 22, 2022, 4:54pm UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696 "2022-05-22T16:54:19Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![saragani](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/saragani/32/1455_2.png) [@saragani](https://community.cloudogu.com/u/saragani)
#### Post date: [May 22, 2022, 4:54pm UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/1 "2022-05-22T16:54:19Z")

</div>

I’m using version 2.34.0

When setting SCM\_Home in the scm-server.xml to a local path, then it works.  
However, I want the settings and repository to be located on a network location (Which has much larger storage and faster drives).

At first I tried creating a symbolic link for the repositories directory, and it didn’t work.

I then found out about the SCM\_Home settings in the scm-server.xml and set the value to “\storage\Path\SCM-Manager”  
However, I get:  
sonia.scm.plugin.PluginLoadException: failed to load clazz  
at sonia.scm.plugin.ExtensionCollector.load(ExtensionCollector.java:209)  
at sonia.scm.plugin.ExtensionCollector.collectClasses(ExtensionCollector.java:178)

Looking at the logs, I see:  
ERROR sonia.scm.lifecycle.BootstrapContextListener - failed to create stage two injector  
sonia.scm.plugin.PluginLoadException: failed to load clazz  
.  
.  
.  
Caused by: java.lang.ClassNotFoundException: sonia.scm.api.v2.resources.SvnConfigResource

So, I’ve created a network drive called Z:, which is mapped to \storage\Path\ and I have changed the SCM\_Home to “Z:\SCM-Manager”, but now I get:  
java.lang.IllegalStateException: could not create home directory at Z:\SCM-Manager

I did restart the service, and I also made sure that the service (SCM manager is running on Windows), is logged using the user that created the Z: drive, and which also have permissions to access the network location.

Error from log:  
ERROR sonia.scm.lifecycle.BootstrapContextListener - received unrecoverable error during startup  
java.lang.IllegalStateException: could not create home directory at Z:\SCM-Manager  
at sonia.scm.BasicContextProvider.error(BasicContextProvider.java:207)  
at sonia.scm.BasicContextProvider.findBaseDirectory(BasicContextProvider.java:191)  
at sonia.scm.BasicContextProvider.(BasicContextProvider.java:99)  
at sonia.scm.SCMContext.getContext(SCMContext.java:88)  
at sonia.scm.lifecycle.BootstrapContextListener.getInjector(BootstrapContextListener.java:84)  
at com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:45)  
at sonia.scm.lifecycle.BootstrapContextListener.contextInitialized(BootstrapContextListener.java:75)  
at sonia.scm.lifecycle.BootstrapContextFilter.initializeContext(BootstrapContextFilter.java:74)  
at sonia.scm.lifecycle.BootstrapContextFilter.init(BootstrapContextFilter.java:65)  
at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:140)  
at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:731)  
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)  
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Unknown Source)  
at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source)  
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:755)  
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379)  
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449)  
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414)  
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:910)  
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)  
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)  
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)  
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)  
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)  
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)  
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)  
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)  
at org.eclipse.jetty.server.Server.start(Server.java:423)  
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)  
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)  
at org.eclipse.jetty.server.Server.doStart(Server.java:387)  
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)  
at sonia.scm.server.ScmServer.init(ScmServer.java:130)  
at sonia.scm.server.ScmServer.run(ScmServer.java:91)  
at sonia.scm.server.ScmServerDaemon.main(ScmServerDaemon.java:53)

Is it even possible to have the SCM\_Home placed on a network drive?

Thanks.

---

<div class="post-metadata">

### Author: ![saragani](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/saragani/32/1455_2.png) [@saragani](https://community.cloudogu.com/u/saragani)
#### Post date: [May 23, 2022, 5:59am UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/2 "2022-05-23T05:59:57Z")

</div>

After some trail and error (lots of errors), I was able to make it work.  
At first, as I wrote, I made a symbolic link for the repositories directory only, and it didn’t work.

Now, I’ve created a folder in C: with a symbolic link to the directory in the Storage network location (entire data, not just the repositories directory), and it seem to work.  
I have no idea why using network path as \Storage\SomePath\ didn’t work, and also why creating a network drive also didn’t work.  
At least I now have a workaround. I hope it will help others.

---

<div class="post-metadata">

### Author: ![christoph.loose](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/christoph.loose/32/1400_2.png) [@christoph.loose](https://community.cloudogu.com/u/christoph.loose)
#### Post date: [May 23, 2022, 8:21am UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/3 "2022-05-23T08:21:57Z")

</div>

Thank you @saragani for sharing your solution with the community!  
Really appreciated!

---

<div class="post-metadata">

### Author: ![saragani](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/saragani/32/1455_2.png) [@saragani](https://community.cloudogu.com/u/saragani)
#### Post date: [May 23, 2022, 8:34am UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/4 "2022-05-23T08:34:31Z")

</div>

Can this issue investigated, as of why network path and network drive gave those errors?  
sonia.scm.plugin.PluginLoadException: failed to load clazz  
and  
java.lang.IllegalStateException: could not create home directory at Z:\SCM-Manager

Do you want me to open an issue?

---

<div class="post-metadata">

### Author: ![eheimbuch](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/eheimbuch/32/18_2.png) [@eheimbuch](https://community.cloudogu.com/u/eheimbuch)
#### Post date: [May 23, 2022, 10:59am UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/5 "2022-05-23T10:59:35Z")

</div>

Hey @saragani,

we will open an issue on our internal issue tracker and try to figure out what went wrong. Thanks for the report.

BR, Eduard

---

<div class="post-metadata">

### Author: ![matthias.thieroff](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/matthias.thieroff/32/1176_2.png) [@matthias.thieroff](https://community.cloudogu.com/u/matthias.thieroff)
#### Post date: [June 16, 2022, 7:30am UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/6 "2022-06-16T07:30:00Z")

</div>

Hi @saragani,

unfortunately, the Windows service cannot access mapped network drives because the SCM Manager service is started with the local system account. Also, the service wrapper that we use to provide a Windows service for the SCM Manager is not able to access a UNC path.

What else you could try is to change the service account to a local user account using the Windows Service Manager. This may work, but there is no guarantee that a mapped network drive will be accessible.

We would appreciate if you share your findings with us.

Matthias

---

<div class="post-metadata">

### Author: ![saragani](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/saragani/32/1455_2.png) [@saragani](https://community.cloudogu.com/u/saragani)
#### Post date: [June 16, 2022, 7:44am UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/7 "2022-06-16T07:44:39Z")

</div>

But I already changed the scm-server to run as local user account, where the mapped drive was mapped in and it didn’t work (the errors that I have posted are from that scenario).

---

<div class="post-metadata">

### Author: ![matthias.thieroff](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/matthias.thieroff/32/1176_2.png) [@matthias.thieroff](https://community.cloudogu.com/u/matthias.thieroff)
#### Post date: [June 20, 2022, 5:55am UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/8 "2022-06-20T05:55:07Z")

</div>

Hi @saragani,

to keep you updated: we have found many hints on how to permanently map a network share as a local system user, but none of them worked as expected. We also can’t figure out if the drive is not mapped or if there is a lack of privileges or something like that when the service starts.

We will now check if updating the underlying service wrapper to version 3.x can fix the problem. Also, at the point where the SCM Manager tries to create the home folder, we add some additional debugging information. Maybe this will give us some useful insights.

Matthias

---

<div class="post-metadata">

### Author: ![matthias.thieroff](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/matthias.thieroff/32/1176_2.png) [@matthias.thieroff](https://community.cloudogu.com/u/matthias.thieroff)
#### Post date: [July 25, 2022, 11:47am UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/9 "2022-07-25T11:47:13Z")

</div>

Hi @saragani,

sorry for the late reply. Unfortunately the underlying service is still in alpha stage. We will come back to it when a stable version gets released.

Matthias

---

<div class="post-metadata">

### Author: ![christoph.loose](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/christoph.loose/32/1400_2.png) [@christoph.loose](https://community.cloudogu.com/u/christoph.loose)
#### Post date: [January 11, 2023, 1:22pm UTC](https://community.cloudogu.com/t/setting-scm-home-to-a-network-location-gives-an-error/696/10 "2023-01-11T13:22:00Z")

</div>


