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

Could not load platform updates: KeyError: 'versions' #3666

Closed
VIXIVIXIV opened this issue Sep 9, 2020 · 9 comments
Closed

Could not load platform updates: KeyError: 'versions' #3666

VIXIVIXIV opened this issue Sep 9, 2020 · 9 comments
Assignees
Milestone

Comments

@VIXIVIXIV
Copy link

PIO Core Call Error: "Error: Traceback (most recent call last):\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\platformio\main.py", line 109, in main\r\n cli() # pylint: disable=no-value-for-parameter\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\click\core.py", line 829, in call\r\n return self.main(*args, **kwargs)\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\click\core.py", line 782, in main\r\n rv = self.invoke(ctx)\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\platformio\commands\init.py", line 44, in invoke\r\n return super(PlatformioCLI, self).invoke(ctx)\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\click\core.py", line 1259, in invoke\r\n return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\click\core.py", line 1259, in invoke\r\n return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\click\core.py", line 1066, in invoke\r\n return ctx.invoke(self.callback, **ctx.params)\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\click\core.py", line 610, in invoke\r\n return callback(args, kwargs)\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\platformio\commands\platform.py", line 393, in platform_update\r\n and not PlatformFactory.new(pkg).are_outdated_packages()\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\platformio\platform\_packages.py", line 134, in are_outdated_packages\r\n pkg, self.get_package_spec(pkg.metadata.name)\r\n File "C:\Users\Ben\.platformio\penv\lib\site-packages\platformio\package\manager\_update.py", line 48, in outdated\r\n self.pick_best_registry_version(reg_pkg["versions"]) or {}\r\nKeyError: 'versions'\r\n\r\n============================================================\r\n\r\nAn unexpected error occurred. Further steps:\r\n\r\n Verify that you have the latest version of PlatformIO using\r\n pip install -U platformio command\r\n\r\n Try to find answer in FAQ Troubleshooting section\r\n https://docs.platformio.org/page/faq.html\r\n\r\n Report this problem to the developers\r\n https://github.com/platformio/platformio-core/issues\r\n\r\n============================================================"

@ivankravets ivankravets changed the title Could not load platform updates Could not load platform updates: KeyError: 'versions' Sep 9, 2020
@ivankravets
Copy link
Member

Could you reproduce this issue?

@Majubs
Copy link

Majubs commented Sep 10, 2020

I'm getting the same error message, started happening after last update. When I run pio run it complains about a library I have in my /lib folder. Here is the entire log:

Processing nodemcuv2 (platform: espressif8266; framework: arduino; board: nodemcuv2)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (2.6.2) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.20704.0 (2.7.4)
 - tool-esptool 1.413.0 (4.13)
Library Manager: Installing lib/NTPClient
KeyError: 'versions':
  File "C:\Users\majubs\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 169:
    env.SConscript("$BUILD_SCRIPT")
  File "C:\Users\majubs\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:

    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\majubs\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\majubs\.platformio\platforms\espressif8266\builder\main.py", line 238:
    target_elf = env.BuildProgram()
  File "C:\Users\majubs\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "C:\Users\majubs\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 62:
    env.ProcessProjectDeps()
  File "C:\Users\majubs\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "C:\Users\majubs\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 140:
    project_lib_builder = env.ConfigureProjectLibBuilder()
  File "C:\Users\majubs\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "C:\Users\majubs\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 1062:
    project.install_dependencies()
  File "C:\Users\majubs\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 898:
    lm.install(spec)
  File "c:\users\majubs\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 49:
    spec, silent=silent, skip_dependencies=skip_dependencies, force=force
  File "c:\users\majubs\.platformio\penv\lib\site-packages\platformio\package\manager\library.py", line 86:
    force=force,
  File "c:\users\majubs\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 99:
    pkg = self.install_from_registry(spec, search_filters, silent=silent)

If I run pio update, I'm able to build normally, but I get the following warning:

Warning! Could not find the package with 'lib/NTPClient' requirements for your system 'windows_amd64'

But after that, if I try to build again, it fails again with the same log as above. Everything was building normally before the last PlatformIO update to version 3.3.0.

@ivankravets
Copy link
Member

What is your platformio.ini?

@Majubs
Copy link

Majubs commented Sep 11, 2020

Here, I'm using Atom btw

[env:nodemcuv2]
platform = espressif8266
framework = arduino
board = nodemcuv2
board_build.filesystem = littlefs

monitor_speed = 115200

build_flags =
  !python print_git_rev.py
  -I src/file_system
  -I src/wireless
  -I src/protocols
  -I src/buffer
  -I src/platform
  -I src/helpers

lib_deps =
  [email protected]
  [email protected]
  NTPClient=lib/NTPClient
  ESP8266Ping=lib/ESP8266Ping

extra_scripts = upload_fw_info.py

@ivankravets ivankravets transferred this issue from platformio/platformio-home Sep 11, 2020
@ivankravets ivankravets added this to the 5.0.2 milestone Sep 11, 2020
@ivankravets ivankravets self-assigned this Sep 11, 2020
@ivankravets
Copy link
Member

Please open PlatformIO CLI and type pio upgrade --dev. Does it work now?

NTPClient=lib/NTPClient

@Majubs , this is wrong declaration. See valid formats https://docs.platformio.org/en/latest/core/userguide/lib/cmd_install.html

@Majubs
Copy link

Majubs commented Sep 11, 2020

It seems to be building fine now 😃 Thanks!

Altough I'm still getting the warning about the libs. I made some modifications to the NTPClient Arduino library, that's why I placed in /lib folder and added the NTPClient=lib/NTPClient to platform.ini. Same with ESP8266Ping. It always worked fine this way.

I'm not sure what I need to do to get rid of the warning. Do I need to install them (as explained in the linked docs) even if I'm not using the version from Arduino? Or is it something else?

@ivankravets
Copy link
Member

Just remove

  NTPClient=lib/NTPClient
  ESP8266Ping=lib/ESP8266Ping

You re-install libs twice. They are already in your lib folder.

@Majubs
Copy link

Majubs commented Sep 14, 2020

Oh, ok. Dropped the lines in platform.ini and it seems to be working fine. I thought that it would use the Arduino version of the libraries without it, but I guess platformio prioritizes the /lib folder when searching for libs 😁

Thanks for the help!

@VIXIVIXIV
Copy link
Author

@ivankravets Sorry for not getting back to you earlier, but after upgrading to the dev build of PlatformIO, the issue with updating platforms is resolved; I was able to upgrade framework-arduino-lpc176x from 0.2.4 to 0.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants