mechboxes / mech

Easy command line virtual machines for VMWare
https://mechboxes.github.io/mech/
MIT License
311 stars 49 forks source link

json.decoder.JSONDecodeError on Windows 10 with Python 3.7.0 32-bit #44

Open clc14 opened 6 years ago

clc14 commented 6 years ago

I get this error when I try to run mech:

mech init bento/ubuntu-14.04 Initializing mech Traceback (most recent call last): File "C:\Users\clc\AppData\Local\Programs\Python\Python37-32\Scripts\mech-script.py", line 11, in load_entry_point('mech==0.7.6', 'console_scripts', 'mech')() File "c:\users\clc\appdata\local\programs\python\python37-32\lib\site-packages\mech__main.py", line 39, in main return Mech(arguments)() File "c:\users\clc\appdata\local\programs\python\python37-32\lib\site-packages\mech\command.py", line 89, in call__ obj = klass(arguments) File "c:\users\clc\appdata\local\programs\python\python37-32\lib\site-packages\mech\mech.py", line 572, in init if utils.init_mechfile(instance_name, url, name=name, version=version, requests_kwargs=requests_kwargs): File "c:\users\clc\appdata\local\programs\python\python37-32\lib\site-packages\mech\utils.py", line 471, in init_mechfile path = index_active_instance(instance_name) File "c:\users\clc\appdata\local\programs\python\python37-32\lib\site-packages\mech\utils.py", line 458, in index_active_instance 'path': path, File "c:\users\clc\appdata\local\programs\python\python37-32\lib\site-packages\mech\utils.py", line 201, in settle_instance instances = json.loads(uncomment(fp.read())) File "c:\users\clc\appdata\local\programs\python\python37-32\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "c:\users\clc\appdata\local\programs\python\python37-32\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "c:\users\clc\appdata\local\programs\python\python37-32\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 3 (char 4)

clc14 commented 6 years ago

Deleted the .mech directory, and now it's working.

But now it creates four different directories with the disk files:

07/07/2018 02:32 PM

13307551143 07/07/2018 02:33 PM 13307551145 07/07/2018 02:33 PM 13307551146 07/07/2018 02:33 PM 13307551147 07/07/2018 02:32 PM boxes 07/07/2018 02:32 PM data

I can get it to work by copying the vmdk's to the 13307551147 folder, where the .vmx file is

clc14 commented 6 years ago

python -m tarfile -l vmware_desktop.box 13307551147/Vagrantfile 13307551143/disk-s001.vmdk 13307551145/disk-s002.vmdk 13307551146/disk-s007.vmdk ... 13307551147/disk.vmdk 13307551147/metadata.json 13307551147/ubuntu-14.04-amd64.nvram 13307551147/ubuntu-14.04-amd64.vmsd 13307551147/ubuntu-14.04-amd64.vmx 13307551147/ubuntu-14.04-amd64.vmxf

while running gnu tar -xvf puts them all in the same directory

clc14 commented 6 years ago

This is only happening with bento images

Kronuz commented 6 years ago

This is weird, it seems the error comes from reading the index file. Could you please share your ~/.mech/data/index When the error shows.