Getting Error while creating pipeline using API

33 views
Skip to first unread message

Nayan Makwana

unread,
Nov 17, 2022, 1:48:50 AM11/17/22
to go-cd
Hello all,
I am getting this kind of error while creating pipeline using api how to resolve this please help me out for this 

Untitled.png


My script is as bellow 

#!/bin/bash
machine_ip="server_ip"
g_user="none"
g_pass="none"
 while :; do
     read -p "What is your machine IP: " machine_ip
         [[ $machine_ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "Enter a valid IP"; continue; }
         if [[ $machine_ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
              break
         else
              echo "Invalid IP Plese try again"
         fi
 done

read -p "Please Enter ENV name to Create New ENV: " gocd_env
read -p "Enter Your Username: " g_user
read -p "Enter Your Password: " g_pass

curl 'http://'$machine_ip':8153/go/api/admin/pipelines' \
      -u $g_user:$g_pass \
      -H 'Accept: application/vnd.go.cd.v11+json' \
      -H 'Content-Type: application/json' \
      -H 'X-pause-pipeline: true' \
      -H 'X-pause-cause: "to have more control over when to start the pipeline after reviewing it"' \
      -X POST -d '{ "group": '$gocd_env',
                    "pipeline": {
                    "label_template": "${COUNT}",
                    "lock_behavior": "lockOnFailure",
                    "name": '$gocd_env'_input_task,
                    "template": null,
                    "materials": [
                      {
                        "type": "git",
                        "attributes": {
                          "url": "http://192.168.1.21/nayan.makwana/blank.git",
                          "destination": "dest",
                          "filter": null,
                          "invert_filter": false,
                          "name": null,
                          "auto_update": true,
                          "branch": "main",
                          "submodule_folder": null,
                          "shallow_clone": true
                        }
                      }
                    ],
                    "stages": [
                      {
                        "name": '$gocd_env'_input_stage,
                        "fetch_materials": true,
                        "clean_working_directory": false,
                        "never_cleanup_artifacts": false,
                        "approval": {
                          "type": "success",
                          "authorization": {
                            "roles": [],
                            "users": []
                          }
                        },
                        "environment_variables": [],
                        "jobs": [
                          {
                            "name": '$gocd_env'_input_job,
                            "run_instance_count": null,
                            "timeout": 0,
                            "environment_variables": [],
                            "resources": [],
                            "tasks": [
                              {
                                "type": "exec",
                                "attributes": {
                                  "run_if": [
                                    "passed"
                                  ],
                                  "command": "echo",
                                  "arguments": [
                                    "Input_Pipeline"
                                ]
                                }
                              }
                            ]
                          }
                        ]
                      }
                    ]
                }
              }'


            
curl 'http://'$machine_ip':8153/go/api/admin/pipelines' \
      -u $g_user:$g_pass \
      -H 'Accept: application/vnd.go.cd.v11+json' \
      -H 'Content-Type: application/json' \
      -H 'X-pause-pipeline: true' \
      -H 'X-pause-cause: "to have more control over when to start the pipeline after reviewing it"' \
      -X POST -d '{ "group": '$gocd_env',
                    "pipeline": {
                    "label_template": "${COUNT}",
                    "lock_behavior": "lockOnFailure",
                    "name": '$gocd_env'_buffer_01,
                    "template": "Buffer_01_template",
                    "materials": [
                      {
                        "type": "dependency",
                        "attributes": {
                        "pipeline": '$gocd_env'_input_task,
                        "stage": '$gocd_env'_input_stage,
                        "name": null,
                        "auto_update": true,
                        "ignore_for_scheduling": false
                        }
                      }
                    ],
                    "stages": null
                }
              }'


Thank you 😁 In Advance 

Marques Lee

unread,
Nov 17, 2022, 7:06:46 AM11/17/22
to go...@googlegroups.com
The error you posted tells you the issue: your MySQL version isn’t supported.

Check your version of MySQL against this page: 

-Marques

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/42b3fdcf-b24b-4d59-a381-035c671e41a6n%40googlegroups.com.

Nayan Makwana

unread,
Nov 17, 2022, 8:51:09 AM11/17/22
to go-cd
Thank you for your attention, Sir,
But I think I am using the latest version of my SQL

If i have to use any specified version please let me know 
bb.png
Reply all
Reply to author
Forward
0 new messages