TestProject Forum
Powered by leading experts in the test automation community

Bug in the entrypoint.sh

The docker image for the agent hxxps://hub.docker.com/r/testproject/agent has a bug when run within cloud environment like Azure.

In the image, file /opt/testproject/agent/entrypoint.sh, line 103 and 104

RESP_AGENT_GUID=$(echo "${RESPONSE}" | grep -E '\{.*\}$' | jq -c -r '.agentGuid')
RESP_AGENT_CONFIG=$(echo "${RESPONSE}" | grep -E '\{.*\}$' | jq -c -r '.config')

I had to add $ to the end of grep. This is because when it runs the curl command, you’ll get something like…

date: Thu, 24 Sep 2020 19:20:17 GMT
content-type: application/json; charset=utf-8
content-length: 602
set-cookie: __cfduid=xxx; expires=Sat, 24-Oct-20 19:20:17 GMT; path=/; domain=.testproject.io; HttpOnly; SameSite=Lax
cache-control: no-cache
pragma: no-cache
expires: -1
requestid: QHSm04OO
access-control-expose-headers: RequestId
x-aspnet-version: 4.0.30319
x-powered-by: ASP.NET
cf-cache-status: DYNAMIC
cf-request-id: 05632839850000caa017ba2200000001
expect-ct: max-age=604800, report-uri=“hxxps://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct”
report-to: {“endpoints”:[{“url”:“hxxps://a.nel.cloudflare.com/report?lkg-colo=29&lkg-time=1600975218”}],“group”:“cf-nel”,“max_age”:604800}
nel: {“report_to”:“cf-nel”,“max_age”:604800}
server: cloudflare
cf-ray: 5d7edca26919caa0-YYZ
{“config”:“xxx==”,“agentGuid”:“xxx”}’

The line report-to and nel has “{}” so grep also includes those lines therefore causing jq to fail.

1 Like

Hello @hieu.pham
Can you please provide the full agent startup logs from your container.