I’m trying to run jsonnet as a sidecar. I can exec into the server and curl 127.0.0.1:3000
In my repo I have a .drone.jsonnet file and my config in drone i’ve tried to set that or keep it blank. When I set that it seems to try to parse it as yaml
yaml: line 2: mapping values are not allowed in this context
Brad , I have the some problem exactly and yes I change on the drone setting to jsonnet.
when I run drone jsonnet to test the value its valid.
This is from drone server container
/ # curl -I http://localhost:3000
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Sun, 26 May 2019 19:54:40 GMT
Content-Length: 29
@ihakimi this is expected, you cannot curl the endpoint like this. The endpoint requires a signed request, per the http-signatures spec. So this error is expected.
this is what I see on the agent logs
2019/05/26 20:41:17 [DEBUG] POST opsys-drone-grpc://localhost:8080/rpc/v1/request: retrying in 10s (22 left)
2019/05/26 20:41:17 [ERR] POST opsys-drone-grpc://localhost:8080/rpc/v1/request request failed: Post opsys-drone-grpc:/
this is not a valid http endpoint. the scheme should be http or https, not opsys-drone-grpc. Also are you sure this is an issue with drone-jsonnet? Nothing about this error demonstrates a problem with drone-jsonnet. Is there additional information that leads you to believe this is a problem with drone-jsonnet that you are not providing?
maybe the issue is the connection between client-server, when I might misunderstand the grpc on the server port 9000
what should be the value for DRONE_RPC_SERVER?
also drone does long polling and after 30 seconds will cancel and then re-try the request. Those error messages can be completely normal. But if there is an issue there is extensive documentation to help you troubleshoot agent communication issues. See Builds are Stuck in Pending Status
either way, I do not see any evidence of issues with drone-jsonnet. If you still have issues with agent-to-server communication after reading the troubleshooting guide, please either search for an existing topic related to the errors you are seeing or start a new topic if none exists.
Ok, server-clinet working ablo to run pipeline using .drone.yml
I put on server DRONE_JSONNET_ENABLED: “true”
and when I change the file on setting to .drone.jsonnet nothing happened
this is the error for JSON
{“commit”:“55f7a8eb4cd42b578bee97a9810c9b731cbb762f”,“event”:“push”,“level”:“debug”,“msg”:“trigger: received”,“ref”:“refs/heads/11.11”,“repo”:“tlv-opsys/ops-deployer”,“time”:“2019-05-26T21:00:32Z”}
{“commit”:“55f7a8eb4cd42b578bee97a9810c9b731cbb762f”,“error”:“RUNTIME ERROR: stream mode: top-level object was a object, should be an array whose elements hold the JSON for each document in the stream.\n\tDuring manifestation\t\n”,“event”:“push”,“level”:“warning”,“msg”:“trigger: cannot find yaml”,“ref”:“refs/heads/11.11”,“repo”:“tlv-opsys/ops-deployer”,“time”:“2019-05-26T21:00:33Z”}
{“fields.time”:“2019-05-26T21:00:33Z”,“latency”:387489203,“level”:“debug”,“method”:“POST”,“msg”:"",“remote”:“10.207.4.133:48206”,“request”:"/hook",“request-id”:“832b7208105389c4818361f2a95e8e00”,“time”:“2019-05-26T21:00:33Z”}
{“fields.time”:“2019-05-26T21:00:39Z”,“latency”:1073729,“level”:“debug”,“method”:“GET”,“msg”:"",“remote”:“10.207.4.116:43140”,“request”:"/",“request-id”:“1Lms7Y4BUxe0LC5ePJXHkKM5yWx”,“time”:“2019-05-26T21:00:39Z”}
{“arch”:“amd64”,“kernel”:"",“level”:“debug”,“msg”:“manager: context canceled”,“os”:“linux”,“time”:“2019-05-26T21:00:41Z”,“variant”:""}
can you format the code snippet for better readability?
It looks like you are not returning an array. The jsonnet file should end with an array. Since the final character in the jsonnet appears to be a } this would tell me you are returning an object and not an array.
thanks works!!! regarding jsonnet I first configure it using the plugin but then I saw it already pluggeable on 1.0.0 so worth to mention it on the docs people will know
just be aware when drone cli I am getting the following error
2019/05/27 00:25:57 yaml: unmarshal errors:
line 1: cannot unmarshal !!seq into yaml.RawResource