betterscan-ce icon indicating copy to clipboard operation
betterscan-ce copied to clipboard

Error during analysis

Open r3l1c7 opened this issue 2 years ago • 3 comments

On a private git repository, it has access, connects then gives:

dockerhub-server-1 | <blitzdb.backends.sql.queryset.QuerySet object at 0x7f58ae8c73d0> dockerhub-server-1 | local variable 'branch' referenced before assignment dockerhub-server-1 | Traceback (most recent call last): dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/api/resource.py", line 129, in handle dockerhub-server-1 | handler_response = handler(*args, **kwargs) dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/decorators.py", line 381, in decorated_function dockerhub-server-1 | return f(*args, **kwargs) dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/decorators.py", line 58, in decorated dockerhub-server-1 | return func(*args, **kwargs) dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/decorators.py", line 124, in decorated_function dockerhub-server-1 | return f(*args, **kwargs) dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/api/v1/badge.py", line 35, in get dockerhub-server-1 | snapshot = get_snapshot(project, snapshot_id, raw=False, include=('project',)) dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/helpers/snapshot.py", line 31, in get_snapshot dockerhub-server-1 | snapshot = params['provider'](project, snapshot_id, raw=raw, only=only, include=include) dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/plugins/git/backend/providers/snapshot.py", line 64, in resolve dockerhub-server-1 | snapshot['branch'] = branch dockerhub-server-1 | UnboundLocalError: local variable 'branch' referenced before assignment

r3l1c7 avatar Jan 16 '23 04:01 r3l1c7

@r3l1c7 Thanks for your message.

What git server are you using?

marcinguy avatar Jan 31 '23 20:01 marcinguy

just using github with ssh

r3l1c7 avatar Feb 01 '23 01:02 r3l1c7

@r3l1c7

Please take a look here for examples (different Git servers, including GitHub)

https://github.com/marcinguy/betterscan-ce/wiki/Repo-Cloning

If you use ssh, please use ssh format i.e

ssh://[email protected]/organization/repo.git

and make sure you have either added:

  • Public key from Settings->Git to the repo
  • Your Private key in Betterscan in Settings->Git

You should be also collaborator on the repo or owner.

This seem to be working. Cannot reproduce your issue.

What branches do you have in the project?

Also please be on a lookout on line breaking, new lines while copying/pasting keys.

marcinguy avatar Feb 01 '23 08:02 marcinguy

Closing due to inactivity

marcinguy avatar Apr 15 '24 09:04 marcinguy