1

My end goal is to run this command in .gitlab-ci.yml.

I'm testing it in both bash shell and in a gitlab-ci.yml process at the moment.

The process started by the api PUT call is started and runs successfully but because the curl returns with an error code the gitlab-ci process exits with an error immediately.

The error message: curl: (3) URL using bad/illegal format or missing URL

curl -X PUT "http://AAA.BBB.CC.DDD:8443/api/v4/schedules/84ce2778-3496-4933-a3c2-f07f64637c92/runNow?api_key=0WhA6P1j70Kta2fW" -d --header 'Accept:application/json' --header 'AccessKey:0WhA6P1j70Kta2fW'

I tried with single quotes around the URL and received the same error message.

Suggestions?

2
  • Why are you sending an api key and an access key? Commented Nov 23, 2020 at 20:56
  • From the website of the api provider that was how the example api call was specified. Commented Nov 25, 2020 at 14:21

2 Answers 2

1

You probably wanted to provide some data to send to the -d option.

-d takes the next argument as data and that happens to be --header, which makes the argument following --header get treated as as a URL since it doesn't start with a dash.

Also note that it looks like you've exposed your access key here. Make sure that is not so anymore.

Sign up to request clarification or add additional context in comments.

2 Comments

I'll give that a try when I get back to the office next week. The api provider recommended that flag to eliminate a 411 "Length Required" error. The access key is a fake one.
Did they perhaps them mean -d "" ?
1

With an additional suggestion from the company, this turns out to be the solution:

curl -X PUT "http://AAA.BBB.CC.DDD:8443/api/v4/schedules/84ce2778-3496-4933-a3c2-f07f64637c92/runNow?api_key=0WhA6P1j70Kta2fW" --header 'Content-Length:0' --header 'Accept:application/json' --header 'AccessKey:0WhA6P1j70Kta2fW'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.