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

aoscx_upload_firmware - RESPONSE ERROR: Invalid URL #28

Closed
seunay0 opened this issue Jul 19, 2022 · 6 comments
Closed

aoscx_upload_firmware - RESPONSE ERROR: Invalid URL #28

seunay0 opened this issue Jul 19, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@seunay0
Copy link

seunay0 commented Jul 19, 2022

Hi,
we are trying to update the firmware by uploading the file from local with the following playbook:

- name: configure switch using rest api modules
  hosts: aruba-switch
  collections:
    - arubanetworks.aoscx
  
  tasks:
    - name: upgrade switch's firmware
      aoscx_upload_firmware:
        partition_name: secondary
        firmware_file_path: "/home/ansible/cx6000-firmware/ArubaOS-CX_6100-6000_10_10_0002.swi"

but we are getting the following error:

File \"/home/.local/lib/python3.8/site-packages/pyaoscx/device.py\", line 467, in upload_firmware  
result = self.upload_firmware_local(
 File \"/home/.local/lib/python3.8/site-packages/pyaoscx/device.py\", 
line 429, in upload_firmware_local
 success = utils.file_upload(self.session, firmware_file_path, uri)
 File \"/home/.local/lib/python3.8/site-packages/pyaoscx/utils/util.py\", line 194, in file_upload
    raise ResponseError(\"POST\", e)
pyaoscx.exceptions.response_error.ResponseError: \"RESPONSE ERROR: Invalid URL 'firmware?image=secondary': No schema supplied. Perhaps you meant http://firmware?image=secondary?: Response: POST\"

Versions info:
ansible [core 2.12.6]
python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
jinja version = 2.10.1
libyaml = True

arubanetworks.aoscx_role, 4.0.0

Basically, just the example reported here https://github.com/aruba/aoscx-ansible-collection/blob/master/docs/aoscx_upload_firmware.md, but no luck.

Any help would be appreciated, thanks!

@tchiapuziowong
Copy link
Member

Thank you for bringing this to our attention! We're looking into this issue at the moment and will provide an update on this issue-

@tchiapuziowong tchiapuziowong added the bug Something isn't working label Sep 1, 2022
@tchiapuziowong tchiapuziowong self-assigned this Sep 1, 2022
@urskog84
Copy link

urskog84 commented Sep 7, 2022

Hi @tchiapuziowong and @seunay0

I am experiencing the same problem as @seunay0

ful stacktrace with -vvv flag.

Traceback (most recent call last):
  File "/home/pefo/.ansible/tmp/ansible-local-18456osw_ivxi/ansible-tmp-1662580331.7708344-18843-222355809101698/AnsiballZ_aoscx_upload_firmware.py", line 107, in <module>
    _ansiballz_main()
  File "/home/pefo/.ansible/tmp/ansible-local-18456osw_ivxi/ansible-tmp-1662580331.7708344-18843-222355809101698/AnsiballZ_aoscx_upload_firmware.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/pefo/.ansible/tmp/ansible-local-18456osw_ivxi/ansible-tmp-1662580331.7708344-18843-222355809101698/AnsiballZ_aoscx_upload_firmware.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_upload_firmware', init_globals=dict(_module_fqn='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_upload_firmware', _modlib_path=modlib_path),
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_arubanetworks.aoscx.aoscx_upload_firmware_payload_q25p1ymp/ansible_arubanetworks.aoscx.aoscx_upload_firmware_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_upload_firmware.py", line 180, in <module>
  File "/tmp/ansible_arubanetworks.aoscx.aoscx_upload_firmware_payload_q25p1ymp/ansible_arubanetworks.aoscx.aoscx_upload_firmware_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_upload_firmware.py", line 117, in main
  File "/home/pefo/.local/lib/python3.8/site-packages/pyaoscx/device.py", line 467, in upload_firmware
    result = self.upload_firmware_local(
  File "/home/pefo/.local/lib/python3.8/site-packages/pyaoscx/device.py", line 429, in upload_firmware_local
    success = utils.file_upload(self.session, firmware_file_path, uri)
  File "/home/pefo/.local/lib/python3.8/site-packages/pyaoscx/utils/util.py", line 194, in file_upload
    raise ResponseError("POST", e)
pyaoscx.exceptions.response_error.ResponseError: "RESPONSE ERROR: Invalid URL 'firmware?image=secondary': No schema supplied. Perhaps you meant http://firmware?image=secondary?: Response: POST"

@tchiapuziowong
Copy link
Member

Thank you @urskog84 we're currently looking into a solution and will update this issue once a fix has been pushed 👍

@urskog84
Copy link

urskog84 commented Oct 2, 2022

@tchiapuziowong. any progress?

@tchiapuziowong
Copy link
Member

Hi @urskog84 - Our dev team is still working on a fix - I'll update this issue when we've published the commit

kchavesr added a commit that referenced this issue Mar 10, 2023
======

Release Summary
---------------

New features (Port Security, PoE, MAC, static MAC and speed/duplex) and bugfixes

Major Changes
-------------

- Add new modules for PoE (aoscx_poe), MAC (aoscx_mac) and Static MAC (aoscx_static_mac)
- Add port security support (aoscx_l2_interface).
- Add speed and duplex support (aoscx_interface).
- Fix module aoscx_upload firmware using HTTP.
- Fix module aoscx_upload_firmware for local path (#28).
- Include fixes for issues found internally.

Minor Changes
-------------

- Fix Interface MTU support (#38).
- Fix idempotency in ACL module
@tchiapuziowong
Copy link
Member

@urskog84 We've just uploaded a new version of the collection that addresses this issue- please ensure to install the latest version of the collection, pyaoscx, and pycurl with the following commands:
pip install pycurl

pip install pyaoscx --upgrade

ansible-galaxy collection install arubanetworks.aoscx -f

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

3 participants