stilio
stilio copied to clipboard
SQL error
frontend_1 | [2021-04-20 20:05:41 +0000] [9] [ERROR] Exception in ASGI application frontend_1 | Traceback (most recent call last): frontend_1 | File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi frontend_1 | result = await app(self.scope, self.receive, self.send) frontend_1 | File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call frontend_1 | return await self.app(scope, receive, send) frontend_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 149, in call frontend_1 | await super().call(scope, receive, send) frontend_1 | File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in call frontend_1 | await self.middleware_stack(scope, receive, send) frontend_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in call frontend_1 | raise exc from None frontend_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in call frontend_1 | await self.app(scope, receive, _send) frontend_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in call frontend_1 | raise exc from None frontend_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in call frontend_1 | await self.app(scope, receive, sender) frontend_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in call frontend_1 | await route.handle(scope, receive, send) frontend_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle frontend_1 | await self.app(scope, receive, send) frontend_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app frontend_1 | response = await func(request) frontend_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 147, in app frontend_1 | raw_response = await run_endpoint_function( frontend_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 101, in run_endpoint_function frontend_1 | return await dependant.call(**values) frontend_1 | File "/usr/src/app/stilio/frontend/main.py", line 46, in index frontend_1 | count = Torrent.total_torrent_count() frontend_1 | File "/usr/src/app/stilio/persistence/torrents/models.py", line 42, in total_torrent_count frontend_1 | count = cls.select().count() frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1845, in inner frontend_1 | return method(self, database, *args, **kwargs) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2121, in count frontend_1 | return Select([clone], [fn.COUNT(SQL('1'))]).scalar(database) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1845, in inner frontend_1 | return method(self, database, *args, **kwargs) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2106, in scalar frontend_1 | row = self.tuples().peek(database) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1845, in inner frontend_1 | return method(self, database, *args, **kwargs) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2093, in peek frontend_1 | rows = self.execute(database)[:n] frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1845, in inner frontend_1 | return method(self, database, *args, **kwargs) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 1916, in execute frontend_1 | return self._execute(database) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2087, in execute frontend_1 | cursor = database.execute(self) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3070, in execute frontend_1 | return self.execute_sql(sql, params, commit=commit) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3064, in execute_sql frontend_1 | self.commit() frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 2831, in exit frontend_1 | reraise(new_type, new_type(exc_value, *exc_args), traceback) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 183, in reraise frontend_1 | raise value.with_traceback(tb) frontend_1 | File "/usr/local/lib/python3.8/site-packages/peewee.py", line 3057, in execute_sql frontend_1 | cursor.execute(sql, params or ()) frontend_1 | peewee.ProgrammingError: relation "torrent" does not exist frontend_1 | LINE 1: SELECT COUNT(1) FROM (SELECT 1 FROM "torrent" AS "t1") AS "... frontend_1 | ^ frontend_1 |
Fixed this by doing docker-compose exec crawler python
and running these commands:
from stilio.persistence.database import init
init()
Check this out, fix SQL error: #11
Fixed in #11.