# Invalid argument error on db-out

**URL:** <https://support.prodi.gy/t/invalid-argument-error-on-db-out/840>\
**Category:** Uncategorized\
**Tags:** database\
**Created:** [September 25, 2018, 4:05pm UTC](https://support.prodi.gy/t/invalid-argument-error-on-db-out/840 "2018-09-25T16:05:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hadsed](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/hadsed/32/216_2.png) [@hadsed](https://support.prodi.gy/u/hadsed)\
**Post date:** [September 25, 2018, 4:05pm UTC](https://support.prodi.gy/t/invalid-argument-error-on-db-out/840/1 "2018-09-25T16:05:22Z")

</div>

I get the following output when I try to output some of my annotations:

```python
(env) [hadsed@hadsed-mbp-2 prodigy]$ pgy db-out goofy raw_datasets/
Traceback (most recent call last):
  File "/Users/hadsed/.pyenv/versions/3.5.6/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    " __main__", mod_spec)
  File "/Users/hadsed/.pyenv/versions/3.5.6/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/hadsed/projects/real-engine/dbb/prodigy/env/lib/python3.5/site-packages/prodigy/ __main__.py", line 246, in <module>
    plac.call(commands[command], arglist=args, eager=False)
  File "/Users/hadsed/projects/real-engine/dbb/prodigy/env/lib/python3.5/site-packages/plac_core.py", line 328, in call
    cmd, result = parser.consume(arglist)
  File "/Users/hadsed/projects/real-engine/dbb/prodigy/env/lib/python3.5/site-packages/plac_core.py", line 207, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/Users/hadsed/projects/real-engine/dbb/prodigy/env/lib/python3.5/site-packages/prodigy/ __main__.py", line 217, in db_out
    write_jsonl(out_file, examples)
  File "cython_src/prodigy/util.pyx", line 410, in prodigy.util.write_jsonl
OSError: [Errno 22] Invalid argument

```

This doesn’t happen with the other annotations.

However, the command does work correctly on the machine that originally hosted the prodigy.db sqlite file. I copied it over to my personal machine and I get the above error. Perhaps the db was corrupted somehow?

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [September 25, 2018, 6:09pm UTC](https://support.prodi.gy/t/invalid-argument-error-on-db-out/840/2 "2018-09-25T18:09:49Z")

</div>

It seems like the error occurs when the data is written to disk, so I don’t think there’s a problem with the database. (Just to be sure, you can always download the [SQLite browser](http://sqlitebrowser.org/) and have a look.)

Does the following alternative syntax work?

```bash
pgy db-out goofy > goofy.jsonl

```

Also, can you double-check that the directory path definitely exists and is writable?
