tomzo/gocd-yaml-config-plugin

Error exporting pipeline created using the UI.

Pakoke opened this issue · 5 comments

For some reason GoCD and gocd-yaml-config-plugin is not exporting some pipelines created through the wizard of GoCD.
We created some pipelines using the UI and for some reason we have the next error everytime that we try to export it.

There was an unknown error downloading the pipeline configuration. Please refresh the page and try again.

image

We tried to delete multiples steps to find out what it was causing but at the end we didn't found anything. We did this because we are using multiples steps as a custom commands and we blame to GoCD UI to write some characteres not supported by the plugin.

GOCD Version: 21.2.0
Server running on CentOS host

Are you able to check what is in the GoCd server logs corresponding with this error?

Also would be interesting to understand what you find is not supported by the plugin that you need the UI for.

Hello @Pakoke.
Related to this problem, is your pipeline fetching artifact from the same pipeline on any stage?
If there are Fetch Artifact Task, the parameter Pipeline Name must be set, can't be empty.
image
image

Possible solutions

  1. Always set the pipeline name on Fetch Artifact Task.
  2. Modify plugin to detect when the property Pipeline Name is null and replace by the main name.

Trace error

You can trace this error using browser developers tools.

  1. Open web browser dev tools
  2. Export Pipeline to YAML/JSON
    image
  3. Now, in the console should be a message like this
    image
  4. Click on it. On the Network tab a row will be highlighted, click it and choose Preview tab
    image
    image

I hope this helps you.

I'm experience the same problem when clicking on either the JSON or YAML Configuration plugin.

Having chased the error through the browser dev tools I've discovered the following:

  • A 422 unprocessable entity is being returned from http://:8153/go/api/admin/export/pipelines/KMCloudMonitorServer?plugin_id=yaml.config.plugin
  • the response message is : message | 'Cannot invoke "com.thoughtworks.go.config.CaseInsensitiveString.toString()" because the return value of "com.thoughtworks.go.config.FetchTask.getPipelineName()" is null'

So the dialog knows the name of the pipeline - but this isn't (it would appear) being fed to the event..

@vernonr3 Which GoCD Server version is this? And can you find the corresponding full stack trace in the server logs?

Ahh, no worries, I think I see the issue. The problem is that this is an issue within GoCD Server, not the plugin, so this issue was raised in the wrong place, which is probably why it hasn't been fixed.

The export logic is treating the pipeline name as mandatory when it should be optional. Will move this to the GoCD server.