#1606  OneDev Error (while adding a Agent)
Closed
Sven opened 4 months ago

I was trying to add GitHub sync, when i restarted the container to add the right path to my instants. (defaults to /user/0/docker.sock changed to /var/run/docker.sock) but when i started the container this happens:

12:31:45 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:31:50 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:31:55 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:00 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:05 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:10 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:15 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:20 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:25 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:30 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:35 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:40 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:45 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:50 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:32:55 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:00 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:05 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:10 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:15 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:20 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:25 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:30 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:35 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:40 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:45 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:50 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:33:55 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:00 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:05 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:10 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:15 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:20 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:25 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:30 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:35 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:40 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:45 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:50 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:34:55 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:00 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:05 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:10 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:16 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:21 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:26 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:31 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:36 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:41 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:46 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:51 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:35:56 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:01 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:06 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:11 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:16 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:21 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:26 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:31 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:36 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:41 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:46 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:51 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:36:56 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:01 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:06 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:11 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:16 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:21 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:26 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:31 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:36 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:41 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:46 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:51 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:37:56 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:38:01 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:38:06 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:38:11 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:38:16 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:38:21 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:38:26 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:38:31 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:38:36 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
TERM trapped.  Shutting down.
12:38:40 INFO  io.onedev.commons.loader.AppLoader - Stopping application...
<-- Wrapper Stopped

-- CONTAINER RESTART --

--> Wrapper Started as Console
]0;OneDev Java Service Wrapper Standard Edition 64-bit 3.5.51
  Copyright (C) 1999-2022 Tanuki Software, Ltd. All Rights Reserved.
    http://wrapper.tanukisoftware.com
  Licensed to OneDev for Service Wrapping
Launching a JVM...
WrapperManager: Initializing...
INFO  - Launching application from '/app'...
INFO  - Cleaning temp directory...
INFO  - Starting application...
INFO  - Successfully checked /opt/onedev
INFO  - Stopping application...
Sven commented 4 months ago

And in the console.log file:

--> Wrapper Started as Console
Java Service Wrapper Standard Edition 64-bit 3.5.51
  Copyright (C) 1999-2022 Tanuki Software, Ltd. All Rights Reserved.
    http://wrapper.tanukisoftware.com
  Licensed to OneDev for Service Wrapping

Launching a JVM...
WrapperManager: Initializing...
12:39:11 INFO  i.onedev.commons.bootstrap.Bootstrap - Launching application from '/opt/onedev'...
12:39:11 INFO  i.onedev.commons.bootstrap.Bootstrap - Cleaning temp directory...
12:39:12 INFO  io.onedev.commons.loader.AppLoader - Starting application...
12:39:26 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:39:31 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:39:36 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:39:41 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:39:46 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:39:51 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
12:39:56 INFO  io.onedev.server.OneDev - Maintenance in progress, waiting...
Sven commented 4 months ago

and if i try to access it, i get 502 (Proxy) Bad Request

Robin Shen commented 4 months ago

Please remove file maintenance under OneDev installation directory and start it again.

Sven commented 4 months ago

I have done that, but then it just crash again;

INFO  - Stopping application...
INFO  - Successfully checked /opt/onedev
INFO  - Starting application...
INFO  - Cleaning temp directory...
INFO  - Launching application from '/app'...
WrapperManager: Initializing...
  Licensed to OneDev for Service Wrapping
Launching a JVM...
    http://wrapper.tanukisoftware.com
]0;OneDevJava Service Wrapper Standard Edition 64-bit 3.5.51
  Copyright (C) 1999-2022 Tanuki Software, Ltd. All Rights Reserved.
--> Wrapper Started as Console
<-- Wrapper Stopped
Sven commented 4 months ago

In the console.log file:

Java Service Wrapper Standard Edition 64-bit 3.5.51
  Copyright (C) 1999-2022 Tanuki Software, Ltd. All Rights Reserved.
    http://wrapper.tanukisoftware.com
  Licensed to OneDev for Service Wrapping

Launching a JVM...
WrapperManager: Initializing...
12:46:11 INFO  i.onedev.commons.bootstrap.Bootstrap - Launching application from '/opt/onedev'...
12:46:11 INFO  i.onedev.commons.bootstrap.Bootstrap - Cleaning temp directory...
12:46:12 INFO  io.onedev.commons.loader.AppLoader - Starting application...
12:46:56 INFO  i.o.s.m.impl.DefaultProjectManager - Checking projects...
12:47:03 INFO  i.o.s.m.i.DefaultAgentAttributeManager - Caching agent attribute info...
12:47:05 INFO  i.o.s.m.i.DefaultBuildMetricManager - Caching build metric info...
12:47:06 INFO  i.o.s.m.impl.DefaultIssueManager - Caching issue info...
12:47:06 INFO  i.o.s.m.impl.DefaultBuildManager - Caching build info...
12:47:06 INFO  i.o.s.m.i.DefaultBuildParamManager - Caching build param info...
Sven commented 4 months ago

at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90) at io.onedev.server.persistence.SessionInterceptor.invoke(SessionInterceptor.java:18) at io.onedev.server.manager.impl.DefaultSettingManager.getSettingValue(DefaultSettingManager.java:50) at io.onedev.server.persistence.SessionInterceptor$1.call(SessionInterceptor.java:23) at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90) at io.onedev.server.persistence.SessionInterceptor.invoke(SessionInterceptor.java:18) at io.onedev.server.manager.impl.DefaultSettingManager.getSubscriptionData(DefaultSettingManager.java:86) at io.onedev.server.ee.subscription.SubscriptionSetting.load(SubscriptionSetting.java:131) at io.onedev.server.ee.subscription.DefaultSubscriptionManager.isSubscriptionActive(DefaultSubscriptionManager.java:53) at io.onedev.server.ee.timetracking.DefaultTimeTrackingManager.on(DefaultTimeTrackingManager.java:92) at io.onedev.server.persistence.TransactionInterceptor$1.call(TransactionInterceptor.java:23) at io.onedev.server.persistence.DefaultTransactionManager.lambda$call$0(DefaultTransactionManager.java:62) at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90) at io.onedev.server.persistence.DefaultTransactionManager.call(DefaultTransactionManager.java:60) at io.onedev.server.persistence.TransactionInterceptor.invoke(TransactionInterceptor.java:18) ... 53 common frames omitted Caused by: java.sql.SQLIntegrityConstraintViolationException: integrity constraint violation: unique constraint or index violation; UK_9A711JGWL7RDB1UI> at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source) at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197) ... 94 common frames omitted Caused by: org.hsqldb.HsqlException: integrity constraint violation: unique constraint or index violation; UK_9A711JGWL7RDB1UI96C468GQR table: O_LINKSP> at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.Constraint.getException(Unknown Source) at org.hsqldb.index.IndexAVLMemory.insert(Unknown Source) at org.hsqldb.persist.RowStoreAVL.indexRow(Unknown Source) at org.hsqldb.TransactionManagerMVCC.addInsertAction(Unknown Source) at org.hsqldb.Session.addInsertAction(Unknown Source) at org.hsqldb.Table.insertSingleRow(Unknown Source) at org.hsqldb.StatementDML.insertSingleRow(Unknown Source) at org.hsqldb.StatementInsert.getResult(Unknown Source) at org.hsqldb.StatementDMQL.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) ... 99 common frames omitted 12:47:26 INFO io.onedev.commons.loader.AppLoader - Stopping application... <-- Wrapper Stopped

Robin Shen commented 4 months ago

Can you please attach the full server log?

Sven commented 4 months ago
Robin Shen commented 4 months ago

Seems that some setting in database is inconsistent. Please remove all rows from table o_LinkSpec and try again.

OneDev uses hsqldb by default, and you will need to download hsqldb tool and connect to OneDev's hsqldb file to do that.

For production use, please switch to use external database.

Robin Shen commented 4 months ago

You may check below post on how to use hsqldb tool to connect to OneDev's db:

https://code.onedev.io/onedev/server/~issues/1583#IssueComment-5734

Sven commented 4 months ago

ty!

Robin Shen changed state to 'Closed' 4 months ago
Previous Value Current Value
Open
Closed
Robin Shen commented 4 months ago

Switch to external database for performance and reliability reason.

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