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

Get failed action on Github and I report this bug! #670

Open
sampad1370 opened this issue Apr 17, 2023 · 6 comments
Open

Get failed action on Github and I report this bug! #670

sampad1370 opened this issue Apr 17, 2023 · 6 comments
Labels
bug Something isn't working need more information

Comments

@sampad1370
Copy link

Describe the bug
A clear and concise description of what the bug is.
I run an action on github and get this error in it. It worked prevously but after changing parameters it's failed.

To Reproduce
Steps to reproduce the behavior:

  1. install aqt using this command
  2. run aqt with this command
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.
Must finish action on github without error but it's failed.

aqt output
Add program output to help explain your problem.

Run jurplel/install-qt-action@v3.1.0
  with:
    version: 5.15.[2](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:2)
    host: windows
    target: desktop
    arch: win64_msvc2019_64
    dir: D:\a\QtSampleCode\QtSampleCode/example/
    install-deps: true
    modules: qtcharts
    archives: d3dcompiler_47 opengl32sw qtbase qtdeclarative qtgraphicaleffects qtimageformats qtmultimedia qtquickcontrols qtquickcontrols2 qtsvg qttools qttranslations qtwinextras qtxmlpatterns
    cache: true
    cache-key-prefix: install-qt-action
    setup-python: true
    tools: tools_ifw tools_qtcreator,qt.tools.qtcreator
    set-env: true
    tools-only: false
    aqtversion: ==2.1.*
    py7zrversion: ==0.19.*
    extra: --external 7z
Run actions/setup-python@v4
  with:
    python-version: [3](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:3).6.x - 3.11.x
    check-latest: false
    token: ***
    update-environment: true
  
Installed versions
  Successfully set up CPython (3.11.3)
Run jurplel/install-qt-action/action@v3
  with:
    dir: D:\a\QtSampleCode\QtSampleCode/example/
    version: 5.15.2
    host: windows
    target: desktop
    arch: win6[4](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:4)_msvc2019_64
    install-deps: true
    modules: qtcharts
    archives: d3dcompiler_47 opengl32sw qtbase qtdeclarative qtgraphicaleffects qtimageformats qtmultimedia qtquickcontrols qtquickcontrols2 qtsvg qttools qttranslations qtwinextras qtxmlpatterns
    cache: true
    cache-key-prefix: install-qt-action
    tools: tools_ifw tools_qtcreator,qt.tools.qtcreator
    set-env: true
    tools-only: false
    aqtversion: ==2.1.*
    py7zrversion: ==0.19.*
    extra: --external 7z
  env:
    pythonLocation: C:\hostedtoolcache\windows\Python\3.11.3\x64
    PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.11.3\x64/lib/pkgconfig
    Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.3\x64
    Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.3\x64
    Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.3\x64
  
Automatic cache miss, will cache this run
C:\hostedtoolcache\windows\Python\3.11.3\x64\python.exe -m pip install setuptools wheel py7zr==0.19.* aqtinstall==2.1.*
Requirement already satisfied: setuptools in c:\hostedtoolcache\windows\python\3.11.3\x64\lib\site-packages (6[5](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:5).5.0)
Collecting wheel
  Downloading wheel-0.40.0-py3-none-any.whl ([6](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:6)4 kB)
     ---------------------------------------- 64.5/64.5 kB 1.8 MB/s eta 0:00:00
Collecting py[7](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:7)zr==0.19.*
  Downloading py7zr-0.19.2-py3-none-any.whl (65 kB)
     ---------------------------------------- 65.[8](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:8)/65.8 kB 1.8 MB/s eta 0:00:00
Collecting aqtinstall==2.1.*
  Downloading aqtinstall-2.1.0-py2.py3-none-any.whl (53 kB)
     ---------------------------------------- 54.0/54.0 kB 2.7 MB/s eta 0:00:00
Collecting texttable
  Downloading texttable-1.6.7-py2.py3-none-any.whl (10 kB)
Collecting pycryptodomex>=3.6.6
  Downloading pycryptodomex-3.17-cp35-abi3-win_amd64.whl (1.7 MB)
     ---------------------------------------- 1.7/1.7 MB 27.4 MB/s eta 0:00:00
Collecting psutil
  Downloading psutil-5.[9](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:9).4-cp36-abi3-win_amd64.whl (252 kB)
     ------------------------------------- 252.5/252.5 kB 16.1 MB/s eta 0:00:00
Collecting pyzstd>=0.14.4
  Downloading pyzstd-0.15.6-cp311-cp311-win_amd64.whl (231 kB)
     ------------------------------------- 231.6/231.6 kB 13.8 MB/s eta 0:00:00
Collecting pyppmd<0.19.0,>=0.18.1
  Downloading pyppmd-0.18.3-cp311-cp311-win_amd64.whl (46 kB)
     ---------------------------------------- 46.1/46.1 kB 2.4 MB/s eta 0:00:00
Collecting pybcj>=0.6.0
  Downloading pybcj-1.0.1-cp311-cp311-win_amd64.whl (24 kB)
Collecting multivolumefile>=0.2.3
  Downloading multivolumefile-0.2.3-py3-none-any.whl (17 kB)
Collecting brotli>=1.0.9
  Downloading Brotli-1.0.9-cp311-cp311-win_amd64.whl (333 kB)
     ------------------------------------- 333.1/333.1 kB [10](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:10).1 MB/s eta 0:00:00
Collecting inflate64>=0.1.2
  Downloading inflate64-0.3.1-cp3[11](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:11)-cp311-win_amd64.whl (35 kB)
Collecting requests
  Downloading requests-2.28.2-py3-none-any.whl (62 kB)
     ---------------------------------------- 62.8/62.8 kB 3.5 MB/s eta 0:00:00
Collecting semantic-version
  Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Collecting patch>=1.16
  Downloading patch-1.16.zip ([12](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:12) kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting bs4
  Downloading bs4-0.0.1.tar.gz (1.1 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting defusedxml
  Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting beautifulsoup4
  Downloading beautifulsoup4-4.12.2-py3-none-any.whl ([14](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:14)2 kB)
     -------------------------------------- 143.0/143.0 kB 8.8 MB/s eta 0:00:00
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl (96 kB)
     ---------------------------------------- 96.7/96.7 kB 5.4 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ---------------------------------------- 61.5/61.5 kB 3.2 MB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.[15](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:15)-py2.py3-none-any.whl (140 kB)
     -------------------------------------- 140.9/140.9 kB 8.2 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     -------------------------------------- 155.3/155.3 kB 4.7 MB/s eta 0:00:00
Collecting soupsieve>1.2
  Downloading soupsieve-2.4.1-py3-none-any.whl (36 kB)
Installing collected packages: texttable, patch, brotli, wheel, urllib3, soupsieve, semantic-version, pyzstd, pyppmd, pycryptodomex, pybcj, psutil, multivolumefile, inflate64, idna, defusedxml, charset-normalizer, certifi, requests, py7zr, beautifulsoup4, bs4, aqtinstall
  DEPRECATION: patch is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for patch: started
  Running setup.py install for patch: finished with status 'done'
  DEPRECATION: bs4 is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for bs4: started
  Running setup.py install for bs4: finished with status 'done'
Successfully installed aqtinstall-2.1.0 beautifulsoup4-4.12.2 brotli-1.0.9 bs4-0.0.1 certifi-2022.12.7 charset-normalizer-3.1.0 defusedxml-0.7.1 idna-3.4 inflate64-0.3.1 multivolumefile-0.2.3 patch-1.[16](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:16) psutil-5.9.4 py7zr-0.19.2 pybcj-1.0.1 pycryptodomex-3.[17](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:17) pyppmd-0.[18](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:18).3 pyzstd-0.15.6 requests-2.28.2 semantic-version-2.10.0 soupsieve-2.4.1 texttable-1.6.7 urllib3-1.26.15 wheel-0.40.0
Notice:  A new release of pip is available: 23.0.1 -> 23.1
Notice:  To update, run: python.exe -m pip install --upgrade pip
C:\hostedtoolcache\windows\Python\3.11.3\x64\python.exe -m aqt install-qt windows desktop 5.15.2 win64_msvc20[19](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:19)_64 --outputdir D:\a\QtSampleCode\QtSampleCode/example//Qt --modules qtcharts --archives d3dcompiler_47 opengl32sw qtbase qtdeclarative qtgraphicaleffects qtimageformats qtmultimedia qtquickcontrols qtquickcontrols2 qtsvg qttools qttranslations qtwinextras qtxmlpatterns --external 7z
aqtinstall(aqt) v2.1.0 on Python 3.11.3 [CPython MSC v.1934 64 bit (AMD64)]
Downloading qtbase...
Downloading qtcharts...
Downloading qtmultimedia...
Downloading qttranslations...
Redirected: qt.mirror.constant.com
Redirected: qt.mirror.constant.com
Redirected: qt.mirror.constant.com
Redirected: qt.mirror.constant.com
ERROR:
Cannot create output directory : Cannot create a file when that file already exists. : D:\a\QtSampleCode\QtSampleCode\example\\Qt\
System ERROR:
Cannot create a file when that file already exists.
Finished installation of qtmultimedia-Windows-Windows_10-MSVC[20](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:21)19-Windows-Windows_10-X86_64.7z in 3.4[21](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:22)01500
Finished installation of qttranslations-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 3.36692410
Downloading qtgraphicaleffects...
Downloading qtsvg...
Downloading qtdeclarative...
Redirected: qt.mirror.constant.com
Finished installation of qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 5.05868500
Finished installation of qtgraphicaleffects-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 1.73000000
Redirected: qt.mirror.constant.com
Redirected: qt.mirror.constant.com
Finished installation of qtsvg-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 1.97650270
Downloading qtwinextras...
Downloading qtimageformats...
Downloading qttools...
Redirected: qt.mirror.constant.com
Redirected: qt.mirror.constant.com
Finished installation of qtwinextras-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 1.50316630
Redirected: qt.mirror.constant.com
Finished installation of qtimageformats-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 1.57577550
Finished installation of qtdeclarative-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 3.15464760
Downloading qtxmlpatterns...
Downloading qtquickcontrols2...
Downloading qtquickcontrols...
Redirected: qt.mirror.constant.com
Redirected: qt.mirror.constant.com
Redirected: qt.mirror.constant.com
Finished installation of qtxmlpatterns-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 2.06034590
Finished installation of qtquickcontrols-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 2.10462510
Finished installation of qttools-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 3.42065350
Finished installation of qtquickcontrols2-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 2.303[23](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:24)830
Downloading d3dcompiler_47...
Downloading opengl32sw...
Redirected: qt.mirror.constant.com
Redirected: qt.mirror.constant.com
Finished installation of d3dcompiler_47-x64.7z in 1.66053490
Finished installation of opengl32sw-64-mesa_12_0_rc2.7z in 1.98333230
Caught TypeError, terminating installer workers
sequence item 1: expected str instance, bytes found
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.11.3\x64\Lib\site-packages\aqt\installer.py", line 108, in run
    args.func(args)
  File "C:\hostedtoolcache\windows\Python\3.11.3\x64\Lib\site-packages\aqt\installer.py", line 328, in run_install_qt
    run_installer(qt_archives.get_packages(), base_dir, sevenzip, keep, _archive_dest)
  File "C:\hostedtoolcache\windows\Python\3.11.3\x64\Lib\site-packages\aqt\installer.py", line 977, in run_installer
    raise e from e
  File "C:\hostedtoolcache\windows\Python\3.11.3\x64\Lib\site-packages\aqt\installer.py", line 953, in run_installer
    pool.starmap(installer, tasks)
  File "C:\hostedtoolcache\windows\Python\3.11.3\x64\Lib\multiprocessing\pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.11.3\x64\Lib\multiprocessing\pool.py", line 774, in get
    raise self._value
TypeError: sequence item 1: expected str instance, bytes found
aqtinstall(aqt) v2.1.0 on Python 3.11.3 [CPython MSC v.1934 64 bit (AMD64)]
Working dir: `D:\a\QtSampleCode\QtSampleCode`
Arguments: `['C:\\hostedtoolcache\\windows\\Python\\3.11.3\\x64\\Lib\\site-packages\\aqt\\__main__.py', 'install-qt', 'windows', 'desktop', '5.15.2', 'win64_msvc2019_64', '--outputdir', 'D:\\a\\QtSampleCode\\QtSampleCode/example//Qt', '--modules', 'qtcharts', '--archives', 'd3dcompiler_47', 'opengl32sw', 'qtbase', 'qtdeclarative', 'qtgraphicaleffects', 'qtimageformats', 'qtmultimedia', 'qtquickcontrols', 'qtquickcontrols2', 'qtsvg', 'qttools', 'qttranslations', 'qtwinextras', 'qtxmlpatterns', '--external', '7z']` Host: `uname_result(system='Windows', node='fv-az[25](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:26)2-497', release='10', version='10.0.20[34](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:37)8', machine='AMD64')`
===========================PLEASE FILE A BUG REPORT===========================
You have discovered a bug in aqt.
Please file a bug report at https://github.com/miurahr/aqtinstall/issues.
Please remember to include a copy of this program's output in your report.
Error: Error: The process 'C:\hostedtoolcache\windows\Python\3.11.3\x64\python.exe' failed with exit code 2[54](https://github.com/sampad1370/QtSampleCode/actions/runs/4717907681/jobs/8366941659#step:2:58)

Desktop (please complete the following information):

  • OS:windows
  • aqt version [2.1.0]

Additional context
Add any other context about the problem here.

@sampad1370 sampad1370 added the bug Something isn't working label Apr 17, 2023
@sampad1370
Copy link
Author

sampad1370 commented Apr 17, 2023

I know that After enabling cache, get an error that said 'the path existed' and after that it was failed:

ERROR:
Cannot create output directory : Cannot create a file when that file already exists. : D:\a\QtSampleCode\QtSampleCode\example\\Qt\
System ERROR:
Cannot create a file when that file already exists.

@miurahr
Copy link
Owner

miurahr commented Apr 17, 2023

Thank for the feedback.
Please check your CI settings whether trying to write onto existent directory/files.
There is no guarantee to work Qt on duplicated installation, or on instlation on another version already installed into output directory.

aqtinstall can be catch "System ERROR" and tell user to wan things correctly.

@miurahr
Copy link
Owner

miurahr commented Apr 17, 2023

I run an action on github and get this error in it. It worked prevously but after changing parameters it's failed.

You can ask to install-qt-action for its issue.

Please tell us what condition changes for aqtinstall command and folder configurations, not about install-qt-actions.

@miurahr
Copy link
Owner

miurahr commented May 5, 2023

It is a bug when aqt found the "System ERROR", it failed with wrong "Type" Error.

root cause

ERROR:
Cannot create output directory : Cannot create a file when that file already exists. : D:\a\QtSampleCode\QtSampleCode\example\\Qt\
System ERROR:
Cannot create a file when that file already exists.

end with

TypeError: sequence item 1: expected str instance, bytes found

@ddalcino
Copy link
Contributor

ddalcino commented May 5, 2023

It looks like the following code ran the external 7z tool, and did not raise a subprocess.CalledProcessError exception when it should have:

aqtinstall/aqt/installer.py

Lines 1050 to 1055 in 90f8a27

try:
proc = subprocess.run(command_args, stdout=subprocess.PIPE, check=True)
logger.debug(proc.stdout)
except subprocess.CalledProcessError as cpe:
msg = "\n".join(filter(None, [f"Extraction error: {cpe.returncode}", cpe.stdout, cpe.stderr]))
raise ArchiveExtractionError(msg) from cpe

It looks like it did not raise any exception at all. Do we have any idea why that might have happened?

If we cannot trust subprocess.run to raise exceptions on error, then maybe we should be reading the output of the external 7z tool to check whether it failed or not. I doubt that there is a robust way of doing this for all situations, but maybe a 'best effort' solution is all we need.

We could check for the presence of the text "ERROR" or "System ERROR" in the 7z tool's output, and raise ArchiveExtractionError if it's present. I don't really like this idea, and I think we could see false positives using this approach, but so far it's the only idea I have.

@sampad1370
Copy link
Author

@miurahr Sorry for too late answering, really I don't remember the changes, but I think it's a strange error that is occurred after set 'cache' into true!

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

No branches or pull requests

3 participants