Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

How exactly do state files work? #229

Open
ergo70 opened this issue Jan 22, 2024 · 0 comments
Open

How exactly do state files work? #229

ergo70 opened this issue Jan 22, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@ergo70
Copy link

ergo70 commented Jan 22, 2024

If I generate a INCREMENTAL state.json by simply > state.json, the resulting file cannot be re-read by --state state.json.

time=2024-01-22 17:49:08 name=tap_postgres level=CRITICAL message=Extra data: line 2 column 1 (char 1117)
Traceback (most recent call last):
File "/home/ergo/Devel/singer.io/venv-tap-postgres/bin/tap-postgres", line 8, in
sys.exit(main())
File "/home/ergo/Devel/singer.io/venv-tap-postgres/lib/python3.10/site-packages/tap_postgres/init.py", line 448, in main
raise exc
File "/home/ergo/Devel/singer.io/venv-tap-postgres/lib/python3.10/site-packages/tap_postgres/init.py", line 445, in main
main_impl()
File "/home/ergo/Devel/singer.io/venv-tap-postgres/lib/python3.10/site-packages/tap_postgres/init.py", line 393, in main_impl
args = parse_args(REQUIRED_CONFIG_KEYS)
File "/home/ergo/Devel/singer.io/venv-tap-postgres/lib/python3.10/site-packages/tap_postgres/init.py", line 373, in parse_args
args.state = utils.load_json(args.state)
File "/home/ergo/Devel/singer.io/venv-tap-postgres/lib/python3.10/site-packages/singer/utils.py", line 109, in load_json
return json.load(fil)
File "/usr/lib/python3.10/json/init.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 1117)

However, if I manually remove everything up to the final STATE line, it works. What am I doing wrong?

best regards,

Ernst-Georg

@ergo70 ergo70 added the help wanted Extra attention is needed label Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant