Unable to delete obsolete project directories on Windows with Java 25 (OD-2574)
David Cearini opened 3 months ago

Deleting an entire Project from OneDev, the project is marked for the file system deletetion on the next reboot.

When I reboot the service after this event, the Service Hang and stop the bootstrap process reporting an error deleting each one of the files in the project folder, trying to manually delete the file the error is solved but occurs on the next file in the folder. The only way to prevent the error and restore the normal boot is to delete the entire project foder.

I have found the error in OneDev Version 13.0.6 on Windows 11 and Windows Server in various configurations, and I'm sure that it's not a problem of access rights on files or folders!

This is an example of the errore extracted from the log:

2025-10-01 13:45:28,409 INFO [WrapperSimpleAppMain] i.o.s.e.impl.DefaultProjectManager Deleting directory marked for deletion: D:\OneDev\site\projects\1 2025-10-01 13:45:29,774 ERROR [WrapperSimpleAppMain] i.onedev.commons.bootstrap.Bootstrap Error booting application java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at io.onedev.server.event.Listener.notify(Listener.java:21) at io.onedev.server.event.DefaultListenerRegistry.invokeListeners(DefaultListenerRegistry.java:104) at io.onedev.server.event.DefaultListenerRegistry.post(DefaultListenerRegistry.java:155) at io.onedev.server.persistence.TransactionInterceptor$1.call(TransactionInterceptor.java:23) at io.onedev.server.persistence.DefaultTransactionManager.lambda$call$0(DefaultTransactionManager.java:66) at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90) at io.onedev.server.persistence.DefaultTransactionManager.call(DefaultTransactionManager.java:57) at io.onedev.server.persistence.TransactionInterceptor.invoke(TransactionInterceptor.java:18) at io.onedev.server.OneDev.lambda$start$2(OneDev.java:168) at io.onedev.server.persistence.DefaultSessionManager.lambda$run$0(DefaultSessionManager.java:108) at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90) at io.onedev.server.persistence.DefaultSessionManager.run(DefaultSessionManager.java:107) at io.onedev.server.OneDev.start(OneDev.java:168) at io.onedev.commons.loader.DefaultPluginManager.start(DefaultPluginManager.java:44) at io.onedev.commons.loader.AppLoader.start(AppLoader.java:75) at io.onedev.commons.bootstrap.Bootstrap.main(Bootstrap.java:200) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:565) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349) at java.base/java.lang.Thread.run(Thread.java:1474) Caused by: java.lang.reflect.InvocationTargetException: null at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119) at java.base/java.lang.reflect.Method.invoke(Method.java:565) at io.onedev.server.event.Listener.notify(Listener.java:19) ... 19 common frames omitted Caused by: java.lang.RuntimeException: Failed to delete file D:\OneDev\site\projects\1\git\objects\06\e8e2fafb854a46a4581f27c5815f5ff8d3b613 at io.onedev.commons.utils.FileUtils.deleteFile(FileUtils.java:209) at io.onedev.commons.utils.FileUtils.cleanDir(FileUtils.java:258) at io.onedev.commons.utils.FileUtils.deleteDir(FileUtils.java:174) at io.onedev.commons.utils.FileUtils.cleanDir(FileUtils.java:256) at io.onedev.commons.utils.FileUtils.deleteDir(FileUtils.java:174) at io.onedev.commons.utils.FileUtils.cleanDir(FileUtils.java:256) at io.onedev.commons.utils.FileUtils.deleteDir(FileUtils.java:174) at io.onedev.commons.utils.FileUtils.cleanDir(FileUtils.java:256) at io.onedev.commons.utils.FileUtils.deleteDir(FileUtils.java:174) at io.onedev.server.entitymanager.impl.DefaultProjectManager.on(DefaultProjectManager.java:830) at io.onedev.server.persistence.TransactionInterceptor$1.call(TransactionInterceptor.java:23) at io.onedev.server.persistence.DefaultTransactionManager.lambda$call$0(DefaultTransactionManager.java:59) at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90) at io.onedev.server.persistence.DefaultTransactionManager.call(DefaultTransactionManager.java:57) at io.onedev.server.persistence.TransactionInterceptor.invoke(TransactionInterceptor.java:18) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ... 21 common frames omitted 2025-10-01 13:45:29,776 INFO [Thread-0] io.onedev.commons.loader.AppLoader Stopping application...

  • Robin Shen commented 3 months ago

    Are you able to reproduce this issue reliably? If yes, please share the steps.

  • David Cearini commented 3 months ago

    Sure! I have reproduced this issue 3 times in 3 different computers. What do you prefer ? A detaild document or a video?

  • Robin Shen commented 3 months ago

    A detailed doc or just post steps here. Please test with a brand new OneDev installation and attach example git repo here.

  • David Cearini commented 3 months ago

    Hello Robin.

    Here you can find the dedailed procedure I use to reproduce the problem: Onedev Died.pdf

    And Here the complete Server.log: server.log

    I have reproduced the error with the latest version: 13.0.7 downloaded 5 minutes ago.

    David.

  • Robin Shen commented 3 months ago

    Thanks for the detailed doc. I followed the instructions to test on Windows 10/11 and Windows server and everything works fine. I guess something different at your side either for the created user or the folder permission. Here is what I have done on a newly launched EC2 Windows 2025 base instance (use the default EBS storage):

    1. Connect to instance as default Administrator account, install JDK 11, and extract onedev as C:\onedev
    2. Create a user "onedev" and add it to "Administrators" group.
    3. Follow all other steps as in your doc
  • David Cearini commented 3 months ago

    Your answer contains the solution!

    In each of the 3 computer used for the installation I had java pre-installed and I haven't check for the installed version (JDK 25).

    The problem is in the JDK version! Removed JDK 25 and installed JDK 11, and all perfectly run now! So, I apologize for wasting your time and thanks for the rapid support!

    You are doing a great work!

  • Robin Shen changed title 3 months ago
    Previous Value Current Value
    Service Bootstrap problem on Windows
    Unable to delete obsolete project directories on Windows with Java 25
  • Robin Shen commented 3 months ago

    Got this reproduced in Windows with Java 25. Will be fixed in next patch release. Thanks!

  • OneDev commented 3 months ago

    State changed as code fixing the issue is committed (25e3991b)

  • OneDev changed state to 'Closed' 3 months ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 3 months ago

    State changed as build OD-6714 is successful

  • OneDev changed state to 'Released' 3 months ago
    Previous Value Current Value
    Closed
    Released
issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
13.0.6
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2574
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover