Skip to content

Couple improvements and fixes#3

Open
protodeniz wants to merge 3 commits intodyne:mainfrom
protodeniz:srfsh/fix
Open

Couple improvements and fixes#3
protodeniz wants to merge 3 commits intodyne:mainfrom
protodeniz:srfsh/fix

Conversation

@protodeniz
Copy link
Copy Markdown
Member

  • Properly (I think) handle the conversion of scancode_report to JSON through a custom type
  • Allow force scanning of repos (scancode)

Tested changes on my local instance at http://65.109.11.42:8004/repositories with the same dataset that I got from the Dyne instance, and only the things related to blockchain fail. Example log:

[2022-07-06 07:08:09,714: WARNING/MainProcess] --- Logging error ---
[2022-07-06 07:08:09,715: WARNING/MainProcess] Traceback (most recent call last):
[2022-07-06 07:08:09,716: WARNING/MainProcess]   File "/usr/src/app/softwarepassport/models.py", line 143, in blockchain
    setattr(self, tag, r.json()[param])
[2022-07-06 07:08:09,716: WARNING/MainProcess] KeyError: 'txId'
[2022-07-06 07:08:09,716: WARNING/MainProcess]
During handling of the above exception, another exception occurred:
[2022-07-06 07:08:09,716: WARNING/MainProcess] Traceback (most recent call last):
[2022-07-06 07:08:09,716: WARNING/MainProcess]   File "/usr/local/lib/python3.10/logging/__init__.py", line 1100, in emit
    msg = self.format(record)
[2022-07-06 07:08:09,716: WARNING/MainProcess]   File "/usr/local/lib/python3.10/logging/__init__.py", line 943, in format
    return fmt.format(record)
[2022-07-06 07:08:09,717: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/utils/log.py", line 146, in format
    msg = super().format(record)
[2022-07-06 07:08:09,717: WARNING/MainProcess]   File "/usr/local/lib/python3.10/logging/__init__.py", line 678, in format
    record.message = record.getMessage()
[2022-07-06 07:08:09,717: WARNING/MainProcess]   File "/usr/local/lib/python3.10/logging/__init__.py", line 368, in getMessage
    msg = msg % self.args
[2022-07-06 07:08:09,717: WARNING/MainProcess] TypeError: not all arguments converted during string formatting
[2022-07-06 07:08:09,717: WARNING/MainProcess] Call stack:
[2022-07-06 07:08:09,718: WARNING/MainProcess]   File "/usr/local/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
[2022-07-06 07:08:09,718: WARNING/MainProcess]   File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
[2022-07-06 07:08:09,718: WARNING/MainProcess]   File "/usr/local/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 83, in _worker
    work_item.run()
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/concurrency/base.py", line 29, in apply_target
    ret = target(*args, **kwargs)
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 649, in fast_trace_task
    R, I, T, Rstr = tasks[task].__trace__(
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/src/app/softwarepassport/app.py", line 105, in scan_task
    repo.scan(db, force)
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/src/app/softwarepassport/models.py", line 160, in scan
    self.blockchain(db)
[2022-07-06 07:08:09,719: WARNING/MainProcess]   File "/usr/src/app/softwarepassport/models.py", line 146, in blockchain
    L.exception("Failed to post to blockchain", e)
[2022-07-06 07:08:09,719: WARNING/MainProcess] Message: 'Failed to post to blockchain'
Arguments: (KeyError('txId'),)

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

Successfully merging this pull request may close these issues.

1 participant