Can't start OneDev docker container (Java error) (OD-1890)
Closed
am opened 2 weeks ago

Hello, suddenly I get the following errors in docker

2024-05-09 19:31:51 Launching a JVM...
2024-05-09 19:31:52 WrapperManager: Initializing...
2024-05-09 19:31:52 default THREAD FACTORY
2024-05-09 19:31:52 16:31:52 INFO  i.onedev.commons.bootstrap.Bootstrap - Launching application from '/opt/onedev'...
2024-05-09 19:31:52 16:31:52 INFO  i.onedev.commons.bootstrap.Bootstrap - Cleaning temp directory...
2024-05-09 19:31:52 16:31:52 INFO  io.onedev.commons.loader.AppLoader - Starting application...
2024-05-09 19:32:04 16:32:04 INFO  i.o.s.e.i.DefaultBuildMetricManager - Caching build metric info...
2024-05-09 19:32:04 16:32:04 INFO  i.o.s.e.i.DefaultBuildParamManager - Caching build param info...
2024-05-09 19:32:05 16:32:05 INFO  i.o.s.e.impl.DefaultProjectManager - Checking projects...
2024-05-09 19:32:05 16:32:05 ERROR i.onedev.commons.bootstrap.Bootstrap - Error booting application
2024-05-09 19:32:05 java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
2024-05-09 19:32:05     at io.onedev.server.event.Listener.notify(Listener.java:21)
2024-05-09 19:32:05     at io.onedev.server.event.DefaultListenerRegistry.invokeListeners(DefaultListenerRegistry.java:103)
2024-05-09 19:32:05     at io.onedev.server.event.DefaultListenerRegistry.post(DefaultListenerRegistry.java:153)
2024-05-09 19:32:05     at io.onedev.server.persistence.TransactionInterceptor$1.call(TransactionInterceptor.java:23)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultTransactionManager.lambda$call$0(DefaultTransactionManager.java:66)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultTransactionManager.call(DefaultTransactionManager.java:57)
2024-05-09 19:32:05     at io.onedev.server.persistence.TransactionInterceptor.invoke(TransactionInterceptor.java:18)
2024-05-09 19:32:05     at io.onedev.server.OneDev.lambda$start$2(OneDev.java:159)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultSessionManager.lambda$run$0(DefaultSessionManager.java:108)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultSessionManager.run(DefaultSessionManager.java:107)
2024-05-09 19:32:05     at io.onedev.server.OneDev.start(OneDev.java:159)
2024-05-09 19:32:05     at io.onedev.commons.loader.DefaultPluginManager.start(DefaultPluginManager.java:44)
2024-05-09 19:32:05     at io.onedev.commons.loader.AppLoader.start(AppLoader.java:60)
2024-05-09 19:32:05     at io.onedev.commons.bootstrap.Bootstrap.main(Bootstrap.java:199)
2024-05-09 19:32:05     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2024-05-09 19:32:05     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2024-05-09 19:32:05     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2024-05-09 19:32:05     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2024-05-09 19:32:05     at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349)
2024-05-09 19:32:05     at java.base/java.lang.Thread.run(Thread.java:829)
2024-05-09 19:32:05 Caused by: java.lang.reflect.InvocationTargetException: null
2024-05-09 19:32:05     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2024-05-09 19:32:05     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2024-05-09 19:32:05     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2024-05-09 19:32:05     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2024-05-09 19:32:05     at io.onedev.server.event.Listener.notify(Listener.java:19)
2024-05-09 19:32:05     ... 21 common frames omitted
2024-05-09 19:32:05 Caused by: java.lang.NumberFormatException: For input string: ".DS_Store"
2024-05-09 19:32:05     at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
2024-05-09 19:32:05     at java.base/java.lang.Long.parseLong(Long.java:678)
2024-05-09 19:32:05     at java.base/java.lang.Long.valueOf(Long.java:1144)
2024-05-09 19:32:05     at io.onedev.server.entitymanager.impl.DefaultProjectManager.on(DefaultProjectManager.java:757)
2024-05-09 19:32:05     at io.onedev.server.persistence.TransactionInterceptor$1.call(TransactionInterceptor.java:23)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultTransactionManager.lambda$call$0(DefaultTransactionManager.java:59)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90)
2024-05-09 19:32:05     at io.onedev.server.persistence.DefaultTransactionManager.call(DefaultTransactionManager.java:57)
2024-05-09 19:32:05     at io.onedev.server.persistence.TransactionInterceptor.invoke(TransactionInterceptor.java:18)
2024-05-09 19:32:05     ... 26 common frames omitted
2024-05-09 19:32:05 16:32:05 INFO  io.onedev.commons.loader.AppLoader - Stopping application...
2024-05-09 19:32:07 <-- Wrapper Stopped
2024-05-09 19:32:07 --> Wrapper Started as Console
2024-05-09 19:32:07 Java Service Wrapper Standard Edition 64-bit 3.5.51
2024-05-09 19:32:07   Copyright (C) 1999-2022 Tanuki Software, Ltd. All Rights Reserved.
2024-05-09 19:32:07     http://wrapper.tanukisoftware.com
2024-05-09 19:32:07   Licensed to OneDev for Service Wrapping
2024-05-09 19:32:07 

I tried installing an older version but that didn't resolve the errors. I'm currently on the latest.

I'm using docker-compose with standard settings. The container keeps restarting.

onedev:
    image: 1dev/server:10.0.0
    container_name: onedev
    restart: unless-stopped
    ports:
      - 6610:6610
      - 6611:6611
    tty: true
    volumes:
      - /MyPath/Services/ONEDEV:/opt/onedev
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      services: {}
Robin Shen commented 2 weeks ago

Please check directory /MyPath/Services/ONEDEV/site/projects. All sub directories there should be numeric (respresenting project id). Seems some non-numeric directory or file is created there for some reason. Just remove them and start OneDev.

Robin Shen changed state to 'Closed' 2 weeks ago
Previous Value Current Value
Open
Closed
am commented 1 week ago

@robin thanks for the suggestion but that is not the case. All directories are numbered, and also there are no hidden files in the /site/projects. Also each numbered directory seems to have similar structure and types of files, so nothing stands out there. Anything else I can check?

Robin Shen commented 1 week ago

There is an hidden file .DS_Store

am commented 1 week ago

There is an hidden file .DS_Store

I searched for it in Finder and couldn't find such a file. I made sure that hidden files are visible. Also, I tried to list all files using terminal and couldn't find a .DS_Store file.

Then I ran the following terminal command which deleted all .DS_Store files from my mac. That didn't fix the problem.

find . -name ".DS_Store" -type f -delete

Finally I went into the container and did a search (without the -delete flag) which showed up some .DS_Store files. I ran the command with the -delete flag and now the container starts as expected.

Just wanted to leave this here for anyone who might stumble upon this issue.

@robin thanks for the support. OneDev is an awesome alternative to other git services! I really appreciate what you guys have done with it.

Robin Shen commented 1 week ago

This is odd. Will exclude all non-numeric files when loading projects in future versions.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Affected Versions
latest
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-1890
Please wait...
Page is in error, reload to recover