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: 'utf-8' codec can't decode byte 0x80 in [match_resources_to_purldb] #1538

Closed
tdruez opened this issue Jan 15, 2025 · 3 comments
Closed
Assignees

Comments

@tdruez
Copy link
Contributor

tdruez commented Jan 15, 2025

To reproduce, create a project with the following inputs:

https://github.com/Warzone2100/warzone2100/archive/refs/tags/4.5.5.zip#from
https://github.com/Warzone2100/warzone2100/releases/download/4.5.5/warzone2100_win_arm64_installer.exe#to

And run a map_deploy_to_develop pipeline.

2025-01-15 11:02:41.883 Step [match_resources_to_purldb] starting
2025-01-15 11:02:41.906 Matching 328 .map, .js, .mjs, .ts, .d.ts, .jsx, .tsx, .css, .scss, .less, .sass, .soy, .class resources in PurlDB, using SHA1
2025-01-15 11:02:41.928 Progress: 10% (33/328)
2025-01-15 11:02:41.932 Progress: 20% (66/328)
2025-01-15 11:02:41.934 Pipeline failed

....

invalid regular expression: quantifier operand invalid

Traceback:
  File "/opt/scancodeio/aboutcode/pipeline/__init__.py", line 199, in execute
    step(self)
  File "/opt/scancodeio/scanpipe/pipelines/deploy_to_develop.py", line 290, in match_purldb_resources_post_process
    d2d.match_purldb_resources_post_process(self.project, logger=self.log)
  File "/opt/scancodeio/scanpipe/pipes/d2d.py", line 1623, in match_purldb_resources_post_process
    map_count += _match_purldb_resources_post_process(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/scanpipe/pipes/d2d.py", line 1640, in _match_purldb_resources_post_process
    if not interesting_codebase_resources:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 414, in __bool__
    self._fetch_all()
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1928, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 91, in __iter__
    results = compiler.execute_sql(
              ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/models/sql/compiler.py", line 1574, in execute_sql
    cursor.execute(sql, params)
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute
    with self.db.wrap_database_errors:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 105, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/.venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
    raise ex.with_traceback(None)
@tdruez
Copy link
Contributor Author

tdruez commented Jan 15, 2025

@JonoYang Could you have a look at this one?

@JonoYang
Copy link
Member

@tdruez The issue is in the step where we are handling JS map files from the to/ side. scancode.io is trying to open to/data/base.wz-extract/wrf/cam1/cam1a/game.map as a JSON file, but this is a binary file for game data.

JonoYang added a commit that referenced this issue Jan 15, 2025
tdruez pushed a commit that referenced this issue Jan 16, 2025
@tdruez
Copy link
Contributor Author

tdruez commented Jan 16, 2025

@JonoYang Fix confirmed. Thanks 👍

@tdruez tdruez closed this as completed Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants