After upgrade from 7.7.2: io.onedev.commons.utils.ExplicitException: Error validating build spec (OD-1087)
Released
jbauer opened 1 year ago

I have upgraded OneDev from 7.7.2 to 7.9.3 and upon server start the following exception is logged

io.onedev.commons.utils.ExplicitException: Error validating build spec (project: **HIDDEN***, commit: **HIDDEN***, location: jobs[0].postBuildActions[0].receivers, message: Malformed notification receiver)
	at io.onedev.server.job.DefaultJobManager.validateBuildSpec(DefaultJobManager.java:214)
	at io.onedev.server.job.DefaultJobManager.schedule(DefaultJobManager.java:1024)
	at io.onedev.server.job.DefaultJobManager$$EnhancerByGuice$$135201057.GUICE$TRAMPOLINE(<generated>)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:74)
	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 com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
	at com.google.inject.internal.InterceptorStackCallback.invoke(InterceptorStackCallback.java:55)
	at io.onedev.server.job.DefaultJobManager$$EnhancerByGuice$$135201057.schedule(<generated>)
	at io.onedev.server.entitymanager.impl.DefaultProjectManager$StorageEntryListener$4$1.run(DefaultProjectManager.java:1168)
	at io.onedev.server.persistence.DefaultSessionManager$2.call(DefaultSessionManager.java:111)
	at io.onedev.server.persistence.DefaultSessionManager$2.call(DefaultSessionManager.java:107)
	at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:90)
	at io.onedev.server.persistence.DefaultSessionManager.run(DefaultSessionManager.java:107)
	at jdk.internal.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:50)
	at com.sun.proxy.$Proxy26.run(Unknown Source)
	at io.onedev.server.entitymanager.impl.DefaultProjectManager$StorageEntryListener$4.call(DefaultProjectManager.java:1164)
	at io.onedev.server.entitymanager.impl.DefaultProjectManager$StorageEntryListener$4.call(DefaultProjectManager.java:1158)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.hazelcast.executor.impl.DistributedExecutorService$Processor.run(DistributedExecutorService.java:276)
	at com.hazelcast.internal.util.executor.CachedExecutorServiceDelegate$Worker.run(CachedExecutorServiceDelegate.java:217)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at com.hazelcast.internal.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)
	at com.hazelcast.internal.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:102)

After the upgrade I opened the OneDev build spec file, removed the receivers and added them back in. After saving the build spec the commit did not reveal any changes with regard to the notification section. Only the spec version has been upgraded, the interpreter has been changed from BashInterpreter to ShellInterpreter + shell: bash property and cpu/memory requirements properties have been deleted because these settings to not exist anymore in the UI. So I guess something else is wrong.

The build spec looks like the following (which private data being marked as **HIDDEN**)

version: 19
jobs:
- name: Release
  jobExecutor: Docker
  steps:
  - !CheckoutStep
    name: Checkout
    cloneCredential: !SshCredential
      keySecret: **HIDDEN***
    withLfs: false
    withSubmodules: false
    checkoutPath: **HIDDEN***
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  - !CommandStep
    name: Build
    runInContainer: true
    image: **HIDDEN***
    interpreter: !ShellInterpreter
      shell: bash
      commands:
      - **HIDDEN***
      - **HIDDEN***
      - **HIDDEN***
    useTTY: false
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  retryCondition: never
  maxRetries: 3
  retryDelay: 30
  caches:
  - key:**HIDDEN***
    path: **HIDDEN***
  - key: **HIDDEN***
    path: **HIDDEN***
  timeout: 3600
  postBuildActions:
  - !SendNotificationAction
    condition: always
    receivers: group(Developers)
Robin Shen commented 1 year ago

Can you please share postBuildActions section of the original build spec from 7.7.2?

jbauer commented 1 year ago

It looked exactly the same in 7.7.2. There was no git commit diff in that section after editing and re-saving it.

Above the postBuildActions section were properties for cpu/ram requirements which have been deleted in OneDev 7.9.2 after editing the file.

Robin Shen changed confidential 1 year ago
Previous Value Current Value
false
true
Robin Shen commented 1 year ago

This is odd. Can you please attach the original build spec file here? I've made the issue confidential, and will delete the file afterwards.

jbauer commented 1 year ago

Actually because of the upgrade issue I had I upgraded 7.7.2 -> 7.9.2 -> 7.9.3. I had seen the issue after the 7.7.2 -> 7.9.2 upgrade and have edited the file using 7.9.2. After that I did an interactive rebase and amended the commit because the build script calculates a version using git history and skips a fixed number of commits. Anyways after you had released 7.9.3 I upgraded to it and 7.9.3 still reported the same exception on startup (using the already new file produced by 7.9.2). After that I created this issue.

I have attached the current file (produced with 7.9.2) which produces this exception in 7.9.3.

Robin Shen commented 1 year ago

Thanks for the detailed info. Found the issue and now removed the attachment.

Robin Shen changed confidential 1 year ago
Previous Value Current Value
true
false
OneDev changed state to 'Closed' 1 year ago
Previous Value Current Value
Open
Closed
OneDev commented 1 year ago

State changed as code fixing the issue is committed

OneDev changed state to 'Released' 1 year ago
Previous Value Current Value
Closed
Released
OneDev commented 1 year ago

State changed as build #3271 is successful

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Affected Versions
Not Found
Issue Votes (0)
Watchers (4)
Reference
OD-1087
Please wait...
Page is in error, reload to recover