tap-github icon indicating copy to clipboard operation
tap-github copied to clipboard

json.decoder.JSONDecodeError when running tap-github

Open devarshigoswami opened this issue 4 years ago • 3 comments

I am getting an error json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) when I run tap-github\

Steps to reproduce:

  1. Create virtual environment virtualenv -p python3 venv
  2. .\Scripts\activate to activate virtual env
  3. pip install tap-github
  4. edited config.json to add github access token
  5. edited properties.json to add "selected": true, for required streams
  6. ran tap-github --config config.json --properties properties.json

Errors:

CRITICAL Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "C:\Users\dgoswami\AppData\Local\Programs\Python\Python39\Lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\dgoswami\AppData\Local\Programs\Python\Python39\Lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "X:\CODE\tap\venv\Scripts\tap-github.exe\__main__.py", line 7, in <module>
  File "x:\code\tap\venv\lib\site-packages\singer\utils.py", line 225, in wrapped
    return fnc(*args, **kwargs)
  File "x:\code\tap\venv\lib\site-packages\tap_github\__init__.py", line 977, in main
    args = singer.utils.parse_args(REQUIRED_CONFIG_KEYS)
  File "x:\code\tap\venv\lib\site-packages\singer\utils.py", line 174, in parse_args
    args.properties = load_json(args.properties)
  File "x:\code\tap\venv\lib\site-packages\singer\utils.py", line 109, in load_json
    return json.load(fil)
  File "C:\Users\dgoswami\AppData\Local\Programs\Python\Python39\Lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\dgoswami\AppData\Local\Programs\Python\Python39\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\dgoswami\AppData\Local\Programs\Python\Python39\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\dgoswami\AppData\Local\Programs\Python\Python39\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

devarshigoswami avatar Nov 16 '20 05:11 devarshigoswami

args.properties = load_json(args.properties) seems like your properties.json is invalid

luandy64 avatar Feb 04 '21 22:02 luandy64

I get the same error. Note that the properties file is newly created with the --discover command. Running it without changing the properties.json file at all, still fails.

martinnormark avatar Apr 28 '21 06:04 martinnormark

This is an encoding problem. Saving the file as UTF-8 solves the problem.

martinnormark avatar Apr 28 '21 07:04 martinnormark