{"id":15668859,"url":"https://github.com/alancoding/bad-execution-environments","last_synced_at":"2026-02-28T01:35:23.125Z","repository":{"id":65740633,"uuid":"598147624","full_name":"AlanCoding/bad-execution-environments","owner":"AlanCoding","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-23T13:53:41.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T11:43:37.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlanCoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-06T14:00:56.000Z","updated_at":"2023-02-07T03:20:03.000Z","dependencies_parsed_at":"2024-10-23T13:10:14.980Z","dependency_job_id":null,"html_url":"https://github.com/AlanCoding/bad-execution-environments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlanCoding/bad-execution-environments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2Fbad-execution-environments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2Fbad-execution-environments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2Fbad-execution-environments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2Fbad-execution-environments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlanCoding","download_url":"https://codeload.github.com/AlanCoding/bad-execution-environments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2Fbad-execution-environments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29922166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T14:20:21.301Z","updated_at":"2026-02-28T01:35:23.102Z","avatar_url":"https://github.com/AlanCoding.png","language":"Makefile","readme":"### Build a bad Execution Environment (EE)\n\nThis repo gives Dockerfiles to build execution environments that will break AWX.\nThe intent is to use these to test that our error-handling is behaving correctly.\nTo be able to test, you need to run it as a container group job. Why?\nBecause only container group jobs use the ansible-runner install from inside\nthe image.\n\nTo list what images will be produced:\n\n```\n$ make show\nghcr.io/alancoding/bad-ee:starting_line\nghcr.io/alancoding/bad-ee:ending_line\nghcr.io/alancoding/bad-ee:traceback\nghcr.io/alancoding/bad-ee:artifacts\n```\n\nThese should be public, so you can use them in AWX execution environments.\nWhile you can do `make build`, the main intended use is to host them on\nghcr associated with pushes to this repo.\n\n#### Starting line\n\nThis should build an EE that gives non-json line from `ansible-runner worker`\nbefore the ordinary streaming starts.\n\nIf you want to run this manually, you need to do `podman login` and somehow\nfigure that out, and then build\n`podman build --tag quay.io/alancoding/bad-ee:latest .`\nafter you cd into the `starting_line/`.\nPushing looks like `podman push quay.io/alancoding/bad-ee:latest`. But it's\na lot bettet to use the Makefile targets.\n\nConfirm the bad thing it is supposed to do:\n\n```\n$ podman run --rm --tty --interactive quay.io/alancoding/bad-ee:latest /bin/bash -c \"echo foo | ansible-runner worker\"\nsurprise\n{\"status\": \"error\", \"job_explanation\": \"Failed to JSON parse a line from transmit stream.\"}\n{\"eof\": true}\n```\n\nHow does the Dockerfile do this? It has an ugly `sed` command.\nThis adds a line after\n\n```python\n        self._output = _output\n```\n\nthat writes a word to that\noutput buffer.\n\n#### Ending line\n\nIn this scenario, we wish to write a non-json line after most of the job\nhas finished, but still before the EOF event has been written.\n\nThat EOF line is written right after in this line:\n\n```python\n    def finished_callback(self, runner_obj):\n```\n\nSo _after_ this line we add the extra write.\n\n#### Traceback\n\nThis is the most credible case, and can be caused when ansible-runner\nis installed incorrectly due to some pip problem or file permissions.\n\nIn this case, running `ansible-runner worker` will give a traceback and exit\nwith a non-zero exit code before doing anything else meaningful.\n\n#### Artifacts\n\nThis job should _look_ like it transmitted successfully, but actually\nthe artifacts directory that gets streamed back is poisoned with bad data.\n\nThis is mechanically similar to the ending_line scenario, but instead of\ngetting past the artifacts callback, it should fail to extract the zip file.\nTypically, this is expected to give a BadZipFile type of exception, but\nwe don't need to be particular about that.\n\nInterestingly, the job should report a successful status via the _status_\ncallback, but the _artifacts_ will fail to be collected.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falancoding%2Fbad-execution-environments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falancoding%2Fbad-execution-environments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falancoding%2Fbad-execution-environments/lists"}