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

Error when using 'conan info .' (Conan 1.12.0) #4443

Closed
3 tasks done
climblinne opened this issue Feb 1, 2019 · 5 comments
Closed
3 tasks done

Error when using 'conan info .' (Conan 1.12.0) #4443

climblinne opened this issue Feb 1, 2019 · 5 comments
Assignees
Milestone

Comments

@climblinne
Copy link
Contributor

To help us debug your issue please explain:

  • I've read the CONTRIBUTING guide.
  • I've specified the Conan version, operating system version and any tool that can be relevant.
  • I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

I tested Conan 1.12.0 and got the following error:

conan info .
Traceback (most recent call last):
  File "c:\tools\python3\lib\site-packages\conans\client\command.py", line 1495, in run
    method(args[0][1:])
  File "c:\tools\python3\lib\site-packages\conans\client\command.py", line 555, in info
    build=args.dry_build)
  File "c:\tools\python3\lib\site-packages\conans\client\conan_api.py", line 88, in wrapper
    return f(*args, **kwargs)
  File "c:\tools\python3\lib\site-packages\conans\client\conan_api.py", line 613, in info
    settings, options, env)
  File "c:\tools\python3\lib\site-packages\conans\client\conan_api.py", line 579, in _info_args
    self._cache, self._user_io.out)
  File "c:\tools\python3\lib\site-packages\conans\client\conan_api.py", line 971, in get_graph_info
    graph_info = GraphInfo.load(install_folder)
  File "c:\tools\python3\lib\site-packages\conans\model\graph_info.py", line 27, in load
    return GraphInfo.loads(load(p))
  File "c:\tools\python3\lib\site-packages\conans\model\graph_info.py", line 41, in loads
    root = graph_json["root"]
KeyError: 'root'

ERROR: 'root'

It works under 0.11.2.

This happens on a library with the following conanfile:

from conans import python_requires

base = python_requires("base_library/0.1@demo/testing")

class mytest_Conan(base.BaseLibrary):
    name = "mytest"
    url = "something"
    description = "something"
    scm = base.BaseLibrary.get_git_scm_data()
    version = base.BaseLibrary.get_git_version()

No dependent package in the requirements.

@jgsogo
Copy link
Contributor

jgsogo commented Feb 1, 2019

Hi @climblinne,

v1.12.0 includes this PR (#4197), it is adding more information to a file called graph_info.json that is created within the install command. Now (>=1.12.0) that file contains a root node that was not present in previous versions and Conan is failing to load the file.

If you remove that file or run conan install . again the file will be regenerated and the error will be gone. Hope this fixes your issue, nevertheless we should provide better information when loading the graph_info.json file (I'll open an issue for this).

IMHO, I think that this issue doesn't require a minor.

Thanks!

@jgsogo jgsogo self-assigned this Feb 1, 2019
@climblinne
Copy link
Contributor Author

Yes, thanks with conan install . it works. Thanks

@jgsogo
Copy link
Contributor

jgsogo commented Feb 1, 2019

I've opened a PR handling this exception to add better error message, with that change it should have been something like:

ERROR: Error parsing GraphInfo from file '/Users/jgsogo/dev/conan/issues/tmp2/graph_info.json': Error related to GraphInfo text content: Required node 'root' is not present

@lasote
Copy link
Contributor

lasote commented Feb 4, 2019

Anyway, it shouldn't crash. We will try to fix it in the 1.12.1 minor.

@memsharded
Copy link
Member

Fixed, it won't crash anymore, will be released in 1.12.1

@ghost ghost removed the stage: in-progress label Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants