Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy #5836

Closed
billiford opened this issue Jun 12, 2020 · 6 comments
Labels
sig/none Issues that do not fall under scope of any SIG

Comments

@billiford
Copy link

billiford commented Jun 12, 2020

Issue Summary:

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy

Cloud Provider(s):

App Engine

Environment:

GCP

Feature Area:

Orca

Description:

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy

Steps to Reproduce:

Create a pipeline with the following JSON

{
  "appConfig": {},
  "expectedArtifacts": [],
  "keepWaitingPipelines": false,
  "limitConcurrent": true,
  "spelEvaluator": "v4",
  "stages": [
    {
      "clusters": [
        {
          "account": "your-account",
          "application": "yourapplication",
          "branch": "develop",
          "cloudProvider": "appengine",
          "configArtifacts": [
            {
              "artifact": {
                "artifactAccount": "github.com",
                "id": "41dfba03-0c2f-406b-870a-4ab386591504",
                "name": "app.yaml",
                "reference": "https://github.com/api/v3/repos/<ORG>/<REPO>/contents/app.yaml",
                "type": "github/file",
                "version": "master"
              }
            }
          ],
          "configFilepaths": [
            "app.yaml"
          ],
          "configFiles": [],
          "containerImageUrl": "us.gcr.io/<IMAGE>:<TAG>",
          "freeFormDetails": "",
          "fromArtifact": false,
          "gitCredentialType": "HTTPS_USERNAME_PASSWORD",
          "interestingHealthProviderNames": [
            "App Engine Service"
          ],
          "promote": true,
          "provider": "appengine",
          "region": "us-east1",
          "repositoryUrl": "<REPOSITORY_URL>",
          "sourceType": "containerImage",
          "stack": "default",
          "stopPreviousVersion": true,
          "strategy": "highlander"
        }
      ],
      "name": "Deploy",
      "refId": "1",
      "requisiteStageRefIds": [],
      "type": "deploy"
    }
  ]
}

Attempt to run the pipeline. The following error is shown in Deck.

Exception ( Create Server Group )
No signature of method: com.netflix.spinnaker.orca.pipeline.util.ArtifactUtils.getBoundArtifactForStage() is applicable for argument types: (com.netflix.spinnaker.orca.pipeline.model.Stage, null, HashMap) values: [Stage {id='01EAN5XXHW1Y46G3R6TFA9R9T4', executionId='01EAN5XXATZZVTMFBTD85RZGNK'}, ...] Possible solutions: getBoundArtifactForStage(com.netflix.spinnaker.orca.pipeline.model.Stage, java.lang.String, com.netflix.spinnaker.kork.artifacts.model.Artifact)

Why is the artifact being bound to a HashMap?

@ajordens ajordens added the sig/none Issues that do not fall under scope of any SIG label Jun 13, 2020
@ajordens
Copy link
Contributor

@ezimanyi may be able to shed some light on the artifact behavior here.

@guido9j
Copy link

guido9j commented Jun 13, 2020

Here is the stack trace:

Possible solutions: getBoundArtifactForStage(com.netflix.spinnaker.orca.pipeline.model.Stage, java.lang.String, com.netflix.spinnaker.kork.artifacts.model.Artifact)
groovy.lang.MissingMethodException: No signature of method: com.netflix.spinnaker.orca.pipeline.util.ArtifactUtils.getBoundArtifactForStage() is applicable for argument types: (com.netflix.spinnaker.orca.pipeline.model.Stage, null, HashMap) values: [Stage {id='01EAN5XXHW1Y46G3R6TFA9R9T4', executionId='01EAN5XXATZZVTMFBTD85RZGNK'}, ...]
2020-06-12 21:10:50.079 ERROR 1 --- [ handlers-16] c.n.s.orca.q.handler.RunTaskHandler : [] Error running CreateServerGroupTask for pipeline[01EAN5XXATZZVTMFBTD85RZGNK]
java.base/java.lang.Thread.run(Thread.java:834)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
com.netflix.spinnaker.q.QueueProcessor$callback$1$1.run(QueueProcessor.kt:89)
com.netflix.spinnaker.orca.q.audit.ExecutionTrackingMessageHandlerPostProcessor$ExecutionTrackingMessageHandlerProxy.invoke(ExecutionTrackingMessageHandlerPostProcessor.kt:69)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.invoke(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.invoke(OrcaMessageHandler.kt)
com.netflix.spinnaker.q.MessageHandler$DefaultImpls.invoke(MessageHandler.kt:36)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.handle(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.handle(RunTaskHandler.kt:87)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withTask(RunTaskHandler.kt:201)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withTask(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withTask(OrcaMessageHandler.kt:59)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withStage(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withStage(OrcaMessageHandler.kt:73)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withExecution(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withExecution(OrcaMessageHandler.kt:93)
com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withStage$1.invoke(OrcaMessageHandler.kt:45)
com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withStage$1.invoke(OrcaMessageHandler.kt:84)
com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withTask$1.invoke(OrcaMessageHandler.kt:45)
com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withTask$1.invoke(OrcaMessageHandler.kt:67)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler$withTask$1.invoke(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler$withTask$1.invoke(RunTaskHandler.kt:208)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1.invoke(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1.invoke(RunTaskHandler.kt:126)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withAuth(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.AuthenticationAware$DefaultImpls.withAuth(AuthenticationAware.kt:51)
com.netflix.spinnaker.security.AuthenticatedRequest.lambda$propagate$0(AuthenticatedRequest.java:92)
com.netflix.spinnaker.orca.q.handler.AuthenticationAware$sam$java_util_concurrent_Callable$0.call(AuthenticationAware.kt)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$2.invoke(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$2.invoke(RunTaskHandler.kt:127)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.access$withLoggingContext(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withLoggingContext(RunTaskHandler.kt:378)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$2$1.invoke(RunTaskHandler.kt:72)
com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$2$1.invoke(RunTaskHandler.kt:129)
com.netflix.spinnaker.orca.clouddriver.tasks.servergroup.CreateServerGroupTask.execute(CreateServerGroupTask.groovy:52)
com.netflix.spinnaker.orca.clouddriver.tasks.servergroup.ServerGroupCreator$getOperations.call(Unknown Source)
com.netflix.spinnaker.orca.clouddriver.tasks.providers.appengine.AppEngineServerGroupCreator.getOperations(AppEngineServerGroupCreator.groovy:51)
com.netflix.spinnaker.orca.clouddriver.tasks.providers.appengine.AppEngineServerGroupCreator$appendArtifactData.callCurrent(Unknown Source)
com.netflix.spinnaker.orca.clouddriver.tasks.providers.appengine.AppEngineServerGroupCreator.appendArtifactData(AppEngineServerGroupCreator.groovy:77)
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244)
org.codehaus.groovy.runtime.dgm$87.invoke(Unknown Source)
org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3659)
org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3559)
org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3574)
groovy.lang.Closure.call(Closure.java:421)
groovy.lang.Closure.call(Closure.java:405)
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
java.base/java.lang.reflect.Method.invoke(Method.java:566)
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
com.netflix.spinnaker.orca.clouddriver.tasks.providers.appengine.AppEngineServerGroupCreator$_appendArtifactData_closure1.doCall(AppEngineServerGroupCreator.groovy:78)
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:143)
org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70)
Possible solutions: getBoundArtifactForStage(com.netflix.spinnaker.orca.pipeline.model.Stage, java.lang.String, com.netflix.spinnaker.kork.artifacts.model.Artifact)
groovy.lang.MissingMethodException: No signature of method: com.netflix.spinnaker.orca.pipeline.util.ArtifactUtils.getBoundArtifactForStage() is applicable for argument types: (com.netflix.spinnaker.orca.pipeline.model.Stage, null, HashMap) values: [Stage {id='01EAN5XXHW1Y46G3R6TFA9R9T4', executionId='01EAN5XXATZZVTMFBTD85RZGNK'}, ...]
2020-06-12 21:10:50.077 WARN 1 --- [ handlers-16] c.n.s.o.e.DefaultExceptionHandler : [] Error occurred during task createServerGroup

@guido9j
Copy link

guido9j commented Jun 14, 2020

@ezimanyi I got past the error above. The config artifacts were returning a HashMap (not sure if that's a groovy behavior vs java). Anyhow, I converted the HashMap to Artifact object (from kork project) and orca is not failing anymore.

P.S. It's working now with my fix, I successfully deployed. I'll submit my code change later.

@ezimanyi
Copy link
Contributor

@guido9j : Thanks for the update, and figuring this out! It does indeed look like the change in #spinnaker/orca#3008 did not correctly account for whether the expectedArtifact was a map or an actual Artifact.

Please do submit your fix for this, and feel free to tag me on the PR!

mergify bot pushed a commit to spinnaker/orca that referenced this issue Jun 22, 2020
groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.
mergify bot pushed a commit to spinnaker/orca that referenced this issue Jun 22, 2020
…rencing github config artifact for GAE deploy - spinnaker/spinnaker#5836 (#3739)

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.'
fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836

* Change to objectMapper

* Removed left over Slf4j lines
mergify bot pushed a commit to spinnaker/orca that referenced this issue Jun 22, 2020
…rencing github config artifact for GAE deploy - spinnaker/spinnaker#5836 (#3739)

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.'
fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836

* Change to objectMapper

* Removed left over Slf4j lines

(cherry picked from commit ebb04d2)
mergify bot added a commit to spinnaker/orca that referenced this issue Jun 22, 2020
…rencing github config artifact for GAE deploy - spinnaker/spinnaker#5836 (#3739) (#3757)

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.'
fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836

* Change to objectMapper

* Removed left over Slf4j lines

(cherry picked from commit ebb04d2)

Co-authored-by: guido9j <james_guido@homedepot.com>
mergify bot pushed a commit to spinnaker/orca that referenced this issue Jun 24, 2020
* fix(provider/appengine): Temporarily revert fix

This reverts commit 711c21a. After
adding tests to demonstrate the bug and fix, we'll re-apply.

* test(appengine): Add tests demonstrating AppEngine artifact bug

This commit adds tests to demonstrate the regression in the
AppEngine artifact handling. The next commit will fix the bug
and update the tests.

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836 (#3755)

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.

Co-Authored-By: Eric Zimanyi <ezimanyi@google.com>

Co-authored-by: guido9j <james_guido@homedepot.com>
mergify bot pushed a commit to spinnaker/orca that referenced this issue Jun 24, 2020
* fix(provider/appengine): Temporarily revert fix

This reverts commit 711c21a. After
adding tests to demonstrate the bug and fix, we'll re-apply.

* test(appengine): Add tests demonstrating AppEngine artifact bug

This commit adds tests to demonstrate the regression in the
AppEngine artifact handling. The next commit will fix the bug
and update the tests.

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836 (#3755)

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.

Co-Authored-By: Eric Zimanyi <ezimanyi@google.com>

Co-authored-by: guido9j <james_guido@homedepot.com>
(cherry picked from commit 4a26d90)
mergify bot pushed a commit to spinnaker/orca that referenced this issue Jun 24, 2020
* fix(provider/appengine): Temporarily revert fix

This reverts commit 711c21a. After
adding tests to demonstrate the bug and fix, we'll re-apply.

* test(appengine): Add tests demonstrating AppEngine artifact bug

This commit adds tests to demonstrate the regression in the
AppEngine artifact handling. The next commit will fix the bug
and update the tests.

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836 (#3755)

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.

Co-Authored-By: Eric Zimanyi <ezimanyi@google.com>

Co-authored-by: guido9j <james_guido@homedepot.com>
(cherry picked from commit 4a26d90)
mergify bot added a commit to spinnaker/orca that referenced this issue Jun 24, 2020
… (#3774)

* fix(provider/appengine): Temporarily revert fix

This reverts commit 711c21a. After
adding tests to demonstrate the bug and fix, we'll re-apply.

* test(appengine): Add tests demonstrating AppEngine artifact bug

This commit adds tests to demonstrate the regression in the
AppEngine artifact handling. The next commit will fix the bug
and update the tests.

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836 (#3755)

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.

Co-Authored-By: Eric Zimanyi <ezimanyi@google.com>

Co-authored-by: guido9j <james_guido@homedepot.com>
(cherry picked from commit 4a26d90)

Co-authored-by: Eric Zimanyi <ezimanyi@google.com>
mergify bot added a commit to spinnaker/orca that referenced this issue Jun 24, 2020
…3772) (#3775)

* test(appengine): Add tests demonstrating AppEngine artifact bug (#3772)

* fix(provider/appengine): Temporarily revert fix

This reverts commit 711c21a. After
adding tests to demonstrate the bug and fix, we'll re-apply.

* test(appengine): Add tests demonstrating AppEngine artifact bug

This commit adds tests to demonstrate the regression in the
AppEngine artifact handling. The next commit will fix the bug
and update the tests.

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836 (#3755)

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.

Co-Authored-By: Eric Zimanyi <ezimanyi@google.com>

Co-authored-by: guido9j <james_guido@homedepot.com>
(cherry picked from commit 4a26d90)

* test(appengine): Fix incorrect class names and imports

A refactor between 1.19 and 1.20 changed a lot of class names and
import paths, so the backport didn't apply cleanly. This commit
updates the (non-compiling) backport so that it refers to the
classes as they exist on the 1.19 branch.

Co-authored-by: Eric Zimanyi <ezimanyi@google.com>
@guido9j
Copy link

guido9j commented Jul 9, 2020

@ezimanyi : Now that this issue been resolved. Am I supposed to close this issue? (actually, I don't think I can close it)

Never mind! I see you are working on test cases. Thanks

@ezimanyi
Copy link
Contributor

@guido9j : I ended up merging the test cases, so I think this can be closed. Thanks for following up!

KathrynLewis pushed a commit to KathrynLewis/orca that referenced this issue Jan 31, 2021
…naker#3755)

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.
KathrynLewis pushed a commit to KathrynLewis/orca that referenced this issue Jan 31, 2021
…naker#3772)

* fix(provider/appengine): Temporarily revert fix

This reverts commit 711c21a. After
adding tests to demonstrate the bug and fix, we'll re-apply.

* test(appengine): Add tests demonstrating AppEngine artifact bug

This commit adds tests to demonstrate the regression in the
AppEngine artifact handling. The next commit will fix the bug
and update the tests.

* fix(provider/appengine): Fix for issue spinnaker/spinnaker#5836 (spinnaker#3755)

groovy.lang.MissingMethodException when referencing github config artifact for GAE deploy. The config artifacts  were of instance of HashMap not an Artifact object. Added logic to translate HashMap to Artifact.

Co-Authored-By: Eric Zimanyi <ezimanyi@google.com>

Co-authored-by: guido9j <james_guido@homedepot.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/none Issues that do not fall under scope of any SIG
Projects
None yet
Development

No branches or pull requests

4 participants