Format error: extra keys not allowed @ data[u'outs'][0][u'size']

I’m trying to integrate dvc with my project for easy pull/push of AI/ML models, while the dvc works fine on my Windows, When I placed the code on an ubuntu machine and after setting up the cloud credentials and adding the remote storage. I tried dvc status command it started giving the following error. I’m not able to interact with dvc at all.

format error: extra keys not allowed @ data[u’outs’][0][u’size’]

Does anybody knows the solution for the same?

1 Like

Looks like the issue is using Python 2.7 which we don’t support. We had a similar discussion in Discord (perhaps from the OP themself):

I got that with

dvc remote modify storage --local .dvc/tmp/lrg-omics-f94be8f80556.json
ERROR: configuration error - config file error: extra keys not allowed @ data[‘remote’][‘storage’][‘.dvc/tmp/lrg-omics-f94be8f80556.json’]
(pqc) ubuntu@dev:~/workspace/ProteomicsQC/lib/lrg-omics>python --version
Python 3.10.2

@rmbzmb what exactly are you trying to achieve with this command? What is your dvc version?

I had the same problem. My files were versioned with DVC version 2.36.0. When upgraded to DVC 2.45.1 the problem started.

To fix, i downgrade back to 2.36.0 but I notice that if I edit the .dvc’s files to remove the key “size”, the problem gets fixed too… Never tried to do with all .dvcs to see if it causes any problem, but i think i will have to do it at some point to be able to upgrade dvc

I ran into this, but I had to delete this line: hash: md5

@tleerai this means you are using DVC 2.x when someone else has been using DVC 3.0 or later in that DVC repo. DVC 3.0 is not backwards compatible with older releases, so in a project with multiple collaborators you will all need to update to 3.0 (or you all need to stay on DVC 2.x)

I’m also getting this error.

I’m working on a macBook which is running dvc v3.25
I’m also using a Docker container with a Linux distribution and it’s running dvc v2.9.2. I installed dvc with mamba.

I don’t know how to revert back to an older version of DVC on my macBook. how do I do this?
I also don’t know how to update to the newest version of DVC in the linux container. how do I do this?

I used brew to install dvc on the mac.

I used mamba to install dvc in the linux container.
I tried to install the latest, with this command,
mamba install -c conda-forge dvc
but I’m stuck at v2.9.3

On macos, you can install an older DVC release by using the pip installation method (and specifying pip install dvc==some.version.number). Homebrew/brew will always try to install the latest version of any package, so there is not a convenient way to downgrade DVC installed with homebrew. (So to downgrade your mac installation, you would need to do brew uninstall dvc and then pip install dvc==... the specific version you want)

On Linux, if you are unable to upgrade past 2.9.3 it means you are likely using an old Python version that is not supported in later DVC releases. DVC currently only supports Python 3.8 and above. You will need to ensure that your container is running Python 3.8 or later in order to install the latest DVC release.

I’m running Python 3.8.12

The mamba command does not allow me to get to a higher version number.
What do I do about the existing dvc files that are not compatible with dvc v2? Is there some kind of workaround?

Thanks!

Make sure you are not mixing up python versions in different environments. Newer dvc is compatible with 3.8, so there is something else that’s not quite right in your environment.

What do I do about the existing dvc files that are not compatible with dvc v2? Is there some kind of workaround?

Are you also getting that size error? It means you are using an older dvc version than the one that was used to create that file. The only way forward is to upgrade.