Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: task Find the latest runner version (RUN ONCE) fails with IncompleteRead(59604 bytes read) #149

Open
red55 opened this issue Nov 18, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@red55
Copy link

red55 commented Nov 18, 2022

Summary

Trying install latest version of Github actions runner i'm getting subj.

Workaround: change body_format to raw in tasks/install_runner.yml

- name: Find the latest runner version (RUN ONCE)
    body_format: raw

Issue Type

Bug Report

Ansible Version

ansible [core 2.14.0]
  config file = /home/lsk/.ansible.cfg
  configured module search path = ['/home/lsk/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/lsk/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/lsk/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Steps to Reproduce

  - name: Apply ansible-github-actions-runner
      ansible.builtin.import_role:
        name: "ansible-github_actions_runner"
      vars:
        hide_sensitive_logs: false
        runner_user: "githubrunner"
        runner_dir: /home/githubrunner
        runner_version: "latest"
        runner_state: "started"
        access_token: "<PAT>"
        github_account: red55
        github_owner: "Org"
        runner_org: true
        runner_labels:
          - vkcs
          - dev

Expected Results

The github runner service started

Actual Results

TASK [ansible-github_actions_runner : Find the latest runner version (RUN ONCE)] *****************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: http.client.IncompleteRead: IncompleteRead(59604 bytes read)
fatal: [bastion -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/usr/lib/python3.10/http/client.py\", line 565, in _get_chunk_left\n    chunk_left = self._read_next_chunk_size()\n  File \"/usr/lib/python3.10/http/client.py\", line 532, in _read_next_chunk_size\n    return int(line, 16)\nValueError: invalid literal for int() with base 16: b''\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/usr/lib/python3.10/http/client.py\", line 582, in _read_chunked\n    chunk_left = self._get_chunk_left()\n  File \"/usr/lib/python3.10/http/client.py\", line 567, in _get_chunk_left\n    raise IncompleteRead(b'')\nhttp.client.IncompleteRead: IncompleteRead(0 bytes read)\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"<stdin>\", line 107, in <module>\n  File \"<stdin>\", line 99, in _ansiballz_main\n  File \"<stdin>\", line 47, in invoke_module\n  File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_ansible.legacy.uri_payload_h4wf99q2/ansible_ansible.legacy.uri_payload.zip/ansible/modules/uri.py\", line 779, in <module>\n  File \"/tmp/ansible_ansible.legacy.uri_payload_h4wf99q2/ansible_ansible.legacy.uri_payload.zip/ansible/modules/uri.py\", line 709, in main\n  File \"/usr/lib/python3.10/http/client.py\", line 459, in read\n    return self._read_chunked(amt)\n  File \"/usr/lib/python3.10/http/client.py\", line 597, in _read_chunked\n    raise IncompleteRead(b''.join(value))\nhttp.client.IncompleteRead: IncompleteRead(59604 bytes read)\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
@red55 red55 added the bug Something isn't working label Nov 18, 2022
@MonolithProjects
Copy link
Owner

MonolithProjects commented Nov 22, 2022

Hi @red55 , i am unable to reproduce your issue. Tested it with bit different setup as you. So, later will test it with something more similar...

My current setup:

ansible [core 2.14.0]
  config file = None
  configured module search path = ['/home/mike/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/mike/.local/lib/python3.11/site-packages/ansible
  ansible collection location = /home/mike/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/mike/.local/bin/ansible
  python version = 3.11.0 (main, Oct 24 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-2)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = False

@bekriebel
Copy link

I'm having what seems to be a similar issue, only I'm just getting a hang on Find the latest runner version (RUN ONCE). If I set a specific runner_version, the job succeeds as expected - but something about that particular steps if just hanging indefinitely.

FWIW, I tried curling the URL from the same server I am trying to use the job on and my local system and I seem to get the proper json data back. Happy to try to debug if you have any suggestions.

@jimbo8098
Copy link

The error you're seeing I'd guess is from the http python module so your error exists there. I would perhaps suggest using an older version of Python on your recipient. 3.11 was released quite recently, October 22, so it's possible some edge case has caused it. It's doubtful but possible.

Regarding switching to raw fixing it, this negates the deserialization of the JSON body returned from GitHub. If it's returning content then a connection is being made at least. You might see some extra information in whatever response is received from the server by using -vvv or so. It's possible that the handling of the output from GH is causing the exception and that might shed light on it.

I don't recall if the register's .json call would work then but I don't think it would. Your workaround might skip parts of the process. A better workaround, albeit a more difficult one, is to just hardcode the version it's supposed to return.

Doubtless this will be something dumb though. These days an http python module must be very well documented, new or not.

Do you need to setup a proxy maybe? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants