Hi,
I'm trying to use the Heartbeat Browser monitor with the Zip URL source, but am running into a weird issue.
Has anyone gotten Zip URL to work with GitLab zip urls?
I get the following error when Heartbeat tries to use the file:
{
"level":"debug",
"timestamp":"2021-12-16T20:30:00.233Z",
"logger":"processors",
"caller":"processing/processors.go:203",
"message":"<see below>"
}
Publish event: {
"@timestamp": "0001-01-01T00:00:00.000Z",
"@metadata": {
"beat": "heartbeat",
"type": "_doc",
"version": "7.16.1"
},
"monitor": {
"type": "browser",
"timespan": {
"lt": "2021-12-16T20:35:00.000Z",
"gte": "2021-12-16T20:30:00.230Z"
},
"status": "down",
"id": "app-zipurl-test",
"name": "ZIPURL Test"
},
"error": {
"message": "could not fetch for suite job: could not read file /tmp/elastic-synthetics-zip-2506258212 as zip: zip: not a valid zip file",
"type": "io"
},
"event": {
"dataset": "browser"
},
"observer": {
"hostname": "heartbeat-synthetics-test-beat-heartbeat-5c8966c5f4-9qj62",
"ip": ["10.42.2.176", "fe80::3469:8cff:fe1d:43d4"],
"mac": ["36:69:8c:1d:43:d4"]
},
"ecs": {
"version": "1.12.0"
},
"agent": {
"name": "heartbeat-synthetics-test-beat-heartbeat-5c8966c5f4-9qj62",
"type": "heartbeat",
"version": "7.16.1",
"hostname": "heartbeat-synthetics-test-beat-heartbeat-5c8966c5f4-9qj62",
"ephemeral_id": "b5fae110-3650-4047-a911-5d21a313ce3e",
"id": "79fb9dfd-1058-4cf1-8ae0-86853da70cca"
}
}
The error:
could not fetch for suite job: could not read file /tmp/elastic-synthetics-zip-2506258212 as zip: zip: not a valid zip file
I am using GitLab to host the repo, and have confirmed that at least GitLab is returning a 200 for the request:
192.168.247.5 - app [16/Dec/2021:15:35:00 -0500] "HEAD /synthetics/app/-/archive/main/app-main.zip HTTP/1.1" 302 0 "" "Go-http-client/1.1" -
192.168.247.5 - app [16/Dec/2021:15:35:00 -0500] "HEAD /users/sign_in HTTP/1.1" 200 0 "https://internal.domain.com/synthetics/app/-/archive/main/app-main.zip" "Go-http-client/1.1" -
192.168.247.5 - app [16/Dec/2021:15:35:00 -0500] "GET /synthetics/app/-/archive/main/app-main.zip HTTP/1.1" 302 111 "" "Go-http-client/1.1" -
192.168.247.5 - app [16/Dec/2021:15:35:00 -0500] "GET /users/sign_in HTTP/1.1" 200 9654 "https://internal.domain.com/synthetics/app/-/archive/main/app-main.zip" "Go-http-client/1.1" 3.22
Here is the Heartbeat config:
heartbeat:
monitors:
- id: app-zipurl-test
name: ZIPURL Test
params:
password: ${MONITOR_PASSWORD}
url: https://internal.domain.com/
username: ${MONITOR_USERNAME}
schedule: 0 */5 * * * ? *
source:
zip_url:
folder: synthetic-tests
password: ${APP_GIT_PASSWORD}
ssl:
verification_mode: none
url: https://internal.domain.com/synthetics/app/-/archive/main/app-main.zip
username: ${APP_GIT_USERNAME}
type: browser
Project Structure:
GitLab/ (GitLab base)
synthetics/ (GitLab Group)
app/ (git project)
main/ (git branch)
synthetics-tests/ (folder in which .ts files exist)
Effectively the same structure as https://github.com/elastic/synthetics-demo/tree/main/todos
, but replace elastic
with synthetics