Hi,
I am trying to use MySQL to store prodigy annotations, but I am facing issue on saving the annotations. I include the error printed in the terminal on the bottom.
The steps that I did:
- Install prodigy
- Install pymysql
- Fill in username, password in prodigy.json
- Create dataset
- Run prodigy ner.manual
- Open prodigy web ui, start annotate texts and accept them
- Click save button
Then the error occur, I checked in mysql database, I can see the dataset is created, but the annotations are not saved.
I have tried to run the test_database.py in the documentation. There is no issue on that.
The full error log:
/home/username/anaconda3/lib/python3.7/site-packages/pymysql/cursors.py:170: Warning: (3090, "Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.")
result = self._query(query)
Starting the web server at http://: ...
Open the app in your browser and start annotating!
Task exception was never retrieved
future: <Task finished coro=<RequestResponseCycle.run_asgi() done, defined at /home/username/anaconda3/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py:383> exception=Error('Already closed')>
Traceback (most recent call last):
File "/home/username/anaconda3/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 388, in run_asgi
self.logger.error(msg, exc_info=exc)
File "/home/username/anaconda3/lib/python3.7/logging/init.py", line 1407, in error
self._log(ERROR, msg, args, **kwargs)
File "/home/username/anaconda3/lib/python3.7/logging/init.py", line 1514, in _log
self.handle(record)
File "/home/username/anaconda3/lib/python3.7/logging/init.py", line 1523, in handle
if (not self.disabled) and self.filter(record):
File "/home/username/anaconda3/lib/python3.7/logging/init.py", line 751, in filter
result = f.filter(record)
File "cython_src/prodigy/util.pyx", line 120, in prodigy.util.ServerErrorFilter.filter
File "/home/username/anaconda3/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/home/username/anaconda3/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/home/username/anaconda3/lib/python3.7/site-packages/fastapi/applications.py", line 140, in call
await super().call(scope, receive, send)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/applications.py", line 134, in call
await self.error_middleware(scope, receive, send)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/middleware/errors.py", line 178, in call
raise exc from None
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/middleware/errors.py", line 156, in call
await self.app(scope, receive, _send)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/middleware/cors.py", line 84, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/middleware/cors.py", line 140, in simple_response
await self.app(scope, receive, send)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/exceptions.py", line 73, in call
raise exc from None
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/exceptions.py", line 62, in call
await self.app(scope, receive, sender)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/routing.py", line 590, in call
await route(scope, receive, send)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/routing.py", line 208, in call
await self.app(scope, receive, send)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/home/username/anaconda3/lib/python3.7/site-packages/fastapi/routing.py", line 129, in app
raw_response = await run_in_threadpool(dependant.call, **values)
File "/home/username/anaconda3/lib/python3.7/site-packages/starlette/concurrency.py", line 25, in run_in_threadpool
return await loop.run_in_executor(None, func, *args)
File "/home/username/anaconda3/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/username/anaconda3/lib/python3.7/site-packages/prodigy/app.py", line 417, in give_answers
controller.db.reconnect()
File "/home/username/anaconda3/lib/python3.7/site-packages/prodigy/components/db.py", line 245, in reconnect
self.db.close()
File "/home/username/anaconda3/lib/python3.7/site-packages/peewee.py", line 3017, in close
self._close(self._state.conn)
File "/home/username/anaconda3/lib/python3.7/site-packages/peewee.py", line 3023, in _close
conn.close()
File "/home/username/anaconda3/lib/python3.7/site-packages/pymysql/connections.py", line 354, in close
raise err.Error("Already closed")
pymysql.err.Error: Already closed