Problem when launching SITL

Hi,
So I was working with SITL and Gazebo, and suddenly I got this error

File "/usr/lib/python2.7/json/__init__.py", line 291, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 367, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 33715 column 2 - line 33719 column 2 (char 977890 - 977980)
SIM_VEHICLE: Build failed
SIM_VEHICLE: Killing tasks

I’m not sure how to solve this and the problem exists for the rover as well. It has also occured recently in one of my colleagues laptop as well. Is there any method to remove this?

Thanks

hello,

could you provide the whole error ?

sim_vehicle.py -v ArduCopter -f gazebo-iris -m --mav10 --console -I0

SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: Starting up at -35.363261,149.165230,584,353 (CMAC)
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: "/home/rishab/ardupilot/modules/waf/waf-light" "configure" "--board" "sitl"
Setting top to                           : /home/rishab/ardupilot 
Setting out to                           : /home/rishab/ardupilot/build 
Autoconfiguration                        : enabled 
GCOV code coverage analysis              : no 
Setting board to                         : sitl 
Using toolchain                          : native 
Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking for c flags '-MMD'              : yes 
Checking for cxx flags '-MMD'            : yes 
Checking for need to link with librt     : not necessary 
Checking for HAVE_CMATH_ISFINITE         : yes 
Checking for HAVE_CMATH_ISINF            : yes 
Checking for HAVE_CMATH_ISNAN            : yes 
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : yes 
Checking for NEED_CMATH_ISINF_STD_NAMESPACE    : yes 
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE    : yes 
Checking for header endian.h                   : yes 
Checking for header byteswap.h                 : yes 
Checking for HAVE_MEMRCHR                      : yes 
Checking for program 'python'                  : /usr/bin/python 
Checking for python version >= 2.7.0           : 2.7.12 
Checking for program 'python'                  : /usr/bin/python 
Checking for python version >= 2.7.0           : 2.7.12 
Source is git repository                       : yes 
Update submodules                              : yes 
Checking for program 'git'                     : /usr/bin/git 
Checking for program 'size'                    : /usr/bin/size 
Benchmarks                                     : disabled 
Unit tests                                     : enabled 
Scripting                                      : disabled 
Scripting runtime checks                       : enabled 
Checking for program 'rsync'                   : /usr/bin/rsync 
'configure' finished successfully (19.348s)
SIM_VEHICLE: Building
SIM_VEHICLE: "/home/rishab/ardupilot/modules/waf/waf-light" "build" "--target" "bin/arducopter"
Waf: Entering directory `/home/rishab/ardupilot/build/sitl'
Waf: Leaving directory `/home/rishab/ardupilot/build/sitl'

BUILD SUMMARY
Build directory: /home/rishab/ardupilot/build/sitl
Target          Text     Data  BSS    Total  
---------------------------------------------
bin/arducopter  1873165  2446  66016  1941627

Build commands will be stored in build/sitl/compile_commands.json
Traceback (most recent call last):
  File "/home/rishab/ardupilot/modules/waf/waflib/Scripting.py", line 158, in waf_entry_point
    run_commands()
  File "/home/rishab/ardupilot/modules/waf/waflib/Scripting.py", line 251, in run_commands
    ctx = run_command(cmd_name)
  File "/home/rishab/ardupilot/modules/waf/waflib/Scripting.py", line 235, in run_command
    ctx.execute()
  File "Tools/ardupilotwaf/ardupilotwaf.py", line 165, in execute
    return execute_method(self)
  File "/home/rishab/ardupilot/modules/waf/waflib/Scripting.py", line 573, in execute
    return execute_method(self)
  File "/home/rishab/ardupilot/modules/waf/waflib/Build.py", line 231, in execute
    self.execute_build()
  File "/home/rishab/ardupilot/modules/waf/waflib/Build.py", line 263, in execute_build
    self.post_build()
  File "/home/rishab/ardupilot/modules/waf/waflib/Build.py", line 547, in post_build
    m(self)
  File "/home/rishab/ardupilot/modules/waf/waflib/extras/clang_compilation_database.py", line 42, in write_compilation_database
    root = json.load(database_file)
  File "/usr/lib/python2.7/json/__init__.py", line 291, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 367, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 33715 column 2 - line 33719 column 2 (char 977890 - 977980)
SIM_VEHICLE: Build failed
SIM_VEHICLE: Killing tasks

I was not able to find a solution, so I reinstalled ardupilot. And this makes it work again. Could it be something related to prolonged use of the software maybe?

I don’t think so. Do you recall updating python to python3, downgrading from 3 to 2 or maybe re-downloading the dependencies?