Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[cocom] Analysis fail : invalid literal for int() with base 10 #57

Open
florentk opened this issue Aug 17, 2019 · 1 comment
Open

[cocom] Analysis fail : invalid literal for int() with base 10 #57

florentk opened this issue Aug 17, 2019 · 1 comment

Comments

@florentk
Copy link

florentk commented Aug 17, 2019

I got this error when analyse somes of our repositories.

Example of Traceback :

2019-08-17 08:43:51,370 Analysis failed at 5c7cf2756aed68171f7350bb8d80a0fed37162e9
2019-08-17 08:43:51,370 Error feeding ocean from cocom (https://github.com/kiwix/web): invalid literal for int() with base 10: 'File'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/elk.py", line 228, in feed_backend
    ocean_backend.feed(**params)
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/raw/elastic.py", line 228, in feed
    self.feed_items(items)
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/raw/elastic.py", line 244, in feed_items
    for item in items:
  File "/usr/local/lib/python3.5/dist-packages/perceval/backend.py", line 161, in fetch
    for item in self.fetch_items(category, **kwargs):
  File "/usr/local/lib/python3.5/dist-packages/graal/graal.py", line 183, in fetch_items
    raise e
  File "/usr/local/lib/python3.5/dist-packages/graal/graal.py", line 176, in fetch_items
    commit['analysis'] = self._analyze(commit)
  File "/usr/local/lib/python3.5/dist-packages/graal/backends/core/cocom.py", line 189, in _analyze
    file_info = self.analyzer.analyze(local_path)
  File "/usr/local/lib/python3.5/dist-packages/graal/backends/core/cocom.py", line 242, in analyze
    cloc_analysis = self.cloc.analyze(**kwargs)
  File "/usr/local/lib/python3.5/dist-packages/graal/backends/core/analyzers/cloc.py", line 128, in analyze
    results = self.__analyze_file(message)
  File "/usr/local/lib/python3.5/dist-packages/graal/backends/core/analyzers/cloc.py", line 58, in __analyze_file
    blank_lines = int(info_file[2])
ValueError: invalid literal for int() with base 10: 'File'

or :

2019-08-17 10:43:35,881 Analysis failed at c6ee59a8e1acf65b7931534c9613bf6c5c23909c
2019-08-17 10:43:35,881 Error feeding ocean from cocom (https://github.com/kiwix/kiwix-android): invalid literal for int() with base 10: 'Shell'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/elk.py", line 228, in feed_backend
    ocean_backend.feed(**params)
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/raw/elastic.py", line 228, in feed
    self.feed_items(items)
  File "/usr/local/lib/python3.5/dist-packages/grimoire_elk/raw/elastic.py", line 244, in feed_items
    for item in items:
  File "/usr/local/lib/python3.5/dist-packages/perceval/backend.py", line 161, in fetch
    for item in self.fetch_items(category, **kwargs):
  File "/usr/local/lib/python3.5/dist-packages/graal/graal.py", line 183, in fetch_items
    raise e
  File "/usr/local/lib/python3.5/dist-packages/graal/graal.py", line 176, in fetch_items
    commit['analysis'] = self._analyze(commit)
  File "/usr/local/lib/python3.5/dist-packages/graal/backends/core/cocom.py", line 189, in _analyze
    file_info = self.analyzer.analyze(local_path)
  File "/usr/local/lib/python3.5/dist-packages/graal/backends/core/cocom.py", line 242, in analyze
    cloc_analysis = self.cloc.analyze(**kwargs)
  File "/usr/local/lib/python3.5/dist-packages/graal/backends/core/analyzers/cloc.py", line 128, in analyze
    results = self.__analyze_file(message)
  File "/usr/local/lib/python3.5/dist-packages/graal/backends/core/analyzers/cloc.py", line 58, in __analyze_file
    blank_lines = int(info_file[2])
ValueError: invalid literal for int() with base 10: 'Shell'

Tested with graal integration : chaoss/grimoirelab-elk#672

@valeriocos
Copy link
Member

Thank you for reporting this @florentk . It seems that you are not using the code in the master branch, but an older release.
"/usr/local/lib/python3.5/dist-packages/graal/backends/core/analyzers/cloc.py", line 58 is currently an empty line: https://github.com/chaoss/grimoirelab-graal/blob/master/graal/backends/core/analyzers/cloc.py#L58

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants