Git Product home page Git Product logo

Comments (6)

TieWay59 avatar TieWay59 commented on July 17, 2024

Since there is no feedback for a week, I'm starting to work on it now.

from grimoirelab-sirmordred.

zhquan avatar zhquan commented on July 17, 2024

Hi @TieWay59

Sorry for the late reply have a look at chaoss/grimoirelab#479 (comment)

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/worktrees/grimoirelab-toolkit-git': '/tmp/worktrees/grimoirelab-toolkit-git'

Change the worktree-path to another path and try again, in that example I used /home/bitergia/worktrees because the execution was in a Mordred container.

I hope it helps you.

from grimoirelab-sirmordred.

TieWay59 avatar TieWay59 commented on July 17, 2024

Thank you @zhquan. In my situation, I'm running it in the source code and docker way. So the directory is actually linked to the location in my local machine.

So I will still get the report:

  2022-04-21 19:35:12,321 Error feeding raw from [Errno 2] No such file or directory: '/home/bitergia/worktrees'

I tried to create the directory manually, for example, /tmp/cocom/ and I use this directory in my setup.cfg file. And then the report tells me [Errno 2] No such file or directory: 'cloc': 'cloc'. I'm really confused about what's going on.

As I investigate deeper into this, I observed that every time I run the project script <worktrees-path>/grimoirelab-toolkit-git would be removed by some process, because I even manually create this folder.

$ pwd
/tmp/worktrees/grimoirelab-toolkit-git
# here I run the script `python --raw --enrich --cfg ./setup.cfg --backends git cocom`
$ cd ..
$ ls # here nothing will be print out, grimoirelab-toolkit-git was removed.

Below is the full error log after [Errno 2] No such file or directory: 'cloc': 'cloc':

  2022-04-21 19:30:05,398 Analysis failed at 9dc821962567715e5358b1192e1b15d8868d2b6c
  2022-04-21 19:30:05,399 Error feeding raw from cocom (https://github.com/chaoss/grimoirelab-toolkit): [Errno 2] No such file or directory: 'cloc': 'cloc'
Traceback (most recent call last):
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/grimoire_elk/elk.py", line 171, in feed_backend
    ocean_backend.feed(**params)
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/grimoire_elk/raw/elastic.py", line 231, in feed
    self.feed_items(items)
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/grimoire_elk/raw/elastic.py", line 247, in feed_items
    for item in items:
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/perceval/backend.py", line 316, in fetch
    for item in self.fetch_items(category, **kwargs):
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/graal/graal.py", line 197, in fetch_items
    raise e
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/graal/graal.py", line 190, in fetch_items
    commit['analysis'] = self._analyze(commit)
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/graal/backends/core/cocom.py", line 212, in _analyze
    file_info = self.analyzer.analyze(local_path)
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/graal/backends/core/cocom.py", line 272, in analyze
    cloc_analysis = self.cloc.analyze(**kwargs)
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/site-packages/graal/backends/core/analyzers/cloc.py", line 123, in analyze
    message = subprocess.check_output(cloc_command).decode("utf-8")
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/root/miniconda3/envs/grimoirelab-sirmordred/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cloc': 'cloc'

from grimoirelab-sirmordred.

TieWay59 avatar TieWay59 commented on July 17, 2024

Latest progress: I worked around it in a strange way.

[Errno 2] No such file or directory: 'cloc': 'cloc' was caused by my system's lack of cloc install. chaoss/grimoirelab#479 (comment) inform me to install cloc.

I work around it by this operation sequence:

  1. install cloc (In my CentOS 7, run yum install cloc) which the Getting-Started.md didn't inform me to do it.
  2. create two directory mkdir /tmp/trythis and mkdir /tmp/trythis/grimoirelab-toolkit-git
  3. use mkdir /tmp/trythis as the worktree-path in setup.cfg's [cocom] section.
  4. rerun the Getting-Started.md script python --raw --enrich --cfg ./setup.cfg --backends git cocom

I have run and tested it many times, everything works out fine.

Here @zhquan, my new question is, Is there any better way to avoid these manual steps? or shall I add this into the Getting-Started.md as a note to help the newcomers in the future?

from grimoirelab-sirmordred.

vchrombie avatar vchrombie commented on July 17, 2024

Hi @TieWay59, thanks for trying out the different methods and finding the way for yourself.

Below is the full error log after [Errno 2] No such file or directory: 'cloc': 'cloc':

Yes, this is something people have faced the error and it is reported in the Troubleshooting section too in the Getting-Started.md document. https://github.com/chaoss/grimoirelab-sirmordred/blob/master/Getting-Started.md#cloc-installation-

Here @zhquan, my new question is, Is there any better way to avoid these manual steps? or shall I add this into the Getting-Started.md as a note to help the newcomers in the future?

If you find any potential error, you can add it as an entry to the Troubleshooting section. Please feel free to open a PR.

As @vchrombie suggests, I just remove the cocom backend (see the command above) and leave only git, and this workaround this error fine. And actually, this error doesn't affect the demo result.

Also, I just suggested this to show you that there is nothing wrong with the micro mordred. The setup was working fine, just a small error which is related to cocom backend. You don't have to remove the cocom backend from the documentation because of it.

If your query is done, please feel free to close the issue.

from grimoirelab-sirmordred.

TieWay59 avatar TieWay59 commented on July 17, 2024

I will add this example to the Troubleshooting section later and close this issue for now.
It'll be nice if we can find out how this error happens and what's the mechanism behind it. Because it's very annoying to create every not found directory.
Any further discovery would be appreciated, and feel free to reopen this issue again.

from grimoirelab-sirmordred.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.