Closed Bug 1456357 Opened 6 years ago Closed 6 years ago

Intermittent [taskcluster:error] Get http://schemas.taskcluster.net/generic-worker/v1/payload.json: dial tcp 52.84.128.102:80: i/o timeout

Categories

(Taskcluster :: General, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: intermittent-bug-filer, Assigned: pmoore)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

I'm curious why this particular file is being downloaded, and why it's over http..
Flags: needinfo?(pmoore)
This is indeed extremely strange.

The reference to the schema location is in the "id" property of the schema.

Here we see the lines where the task payload is validated:

https://github.com/taskcluster/generic-worker/blob/v10.7.8/main.go#L839-L841

> 	schemaLoader := gojsonschema.NewStringLoader(taskPayloadSchema())
> 	docLoader := gojsonschema.NewStringLoader(string(jsonPayload))
> 	result, err := gojsonschema.Validate(schemaLoader, docLoader)

The schema loader takes a string as input, which is the full payload schema, which is burned into the release here:

https://github.com/taskcluster/generic-worker/blob/v10.7.8/generated_windows.go#L311-L609

Looking at the spec, I see that the property should be named "$id" rather that "id". I therefore have no idea why gojsonschema, that validates the payload, would fetch content from the url. Even if it had been named correctly ("$id" instead of "id") then it is just a URI for resolving references, rather than a URL to actively fetch content from.

I think the safest thing to do will just be to delete the property entirely.

I suspect there is some magic happening in https://github.com/xeipuuv/gojsonschema that looks for strings that appear to be URLs (possibly checking for the '#' at the end) and then preemptively downloads them. This is just a hunch, because I have no other explanation for how something would find a reference to this url, and actually try to query it. Not good.
Flags: needinfo?(pmoore)
Assignee: nobody → pmoore
Status: NEW → ASSIGNED
Released in generic-worker 10.7.11.
Depends on: 1461901
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: