Hey, first of all thanks for all your work.
I tried to use the app for the first time, but when i manually create a recipe, it will not get created. Instead i get a 500 Internal Server Error.
Here are my logs:
`INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
Jobstore default:
webhooks (trigger: cron[hour='0', minute='0'], next run at: 2021-01-17 00:00:00 UTC)
auto_backup_job (trigger: cron[hour='3'], next run at: 2021-01-17 03:00:00 UTC)
INFO: 172.18.0.5:38854 - "GET / HTTP/1.1" 200 OK
INFO: 172.18.0.5:38854 - "GET /static/css/app.953f74d2.css HTTP/1.1" 200 OK
INFO: 172.18.0.5:38858 - "GET /static/js/chunk-vendors.c635b5be.js HTTP/1.1" 200 OK
INFO: 172.18.0.5:38856 - "GET /static/css/chunk-vendors.2af56a54.css HTTP/1.1" 200 OK
INFO: 172.18.0.5:38860 - "GET /static/js/app.61726b16.js HTTP/1.1" 200 OK
INFO: 172.18.0.5:38858 - "GET /api/site-settings/themes/default/ HTTP/1.1" 200 OK
INFO: 172.18.0.5:38856 - "GET /api/all-recipes/?keys=name&keys=slug&keys=image&keys=description&keys=dateAdded&keys=rating&num=100 HTTP/1.1" 200 OK
INFO: 172.18.0.5:38940 - "GET / HTTP/1.1" 200 OK
INFO: 172.18.0.5:38940 - "GET /static/css/app.953f74d2.css HTTP/1.1" 200 OK
INFO: 172.18.0.5:38944 - "GET /static/js/app.61726b16.js HTTP/1.1" 200 OK
INFO: 172.18.0.5:38942 - "GET /static/css/chunk-vendors.2af56a54.css HTTP/1.1" 200 OK
INFO: 172.18.0.5:38946 - "GET /static/js/chunk-vendors.c635b5be.js HTTP/1.1" 200 OK
INFO: 172.18.0.5:38946 - "GET /api/site-settings/themes/default/ HTTP/1.1" 200 OK
INFO: 172.18.0.5:38942 - "GET /api/all-recipes/?keys=name&keys=slug&keys=image&keys=description&keys=dateAdded&keys=rating&num=100 HTTP/1.1" 200 OK
INFO: 172.18.0.5:38942 - "GET /static/favicon.ico HTTP/1.1" 200 OK
INFO: 172.18.0.5:38982 - "POST /api/recipe/create-url/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 179, in call
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 111, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in call
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in call
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in call
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 566, in call
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 182, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 133, in run_endpoint_function
return await dependant.call(**values)
File "./routes/recipe_routes.py", line 75, in parse_recipe_url
slug = create_from_url(url.url)
File "./services/scrape_services.py", line 66, in create_from_url
recipe_data = process_recipe_url(url)
File "./services/scrape_services.py", line 95, in process_recipe_url
new_recipe: dict = scrape_url(url, python_objects=True)[0]
IndexError: list index out of range
INFO: 172.18.0.5:38988 - "GET /api/all-recipes/?keys=name&keys=slug&keys=image&keys=description&keys=dateAdded&keys=rating&num=100 HTTP/1.1" 200 OK
[]
INFO: 172.18.0.5:40110 - "GET /api/meal-plan/all/ HTTP/1.1" 200 OK
INFO: 172.18.0.5:40112 - "GET /static/favicon.ico HTTP/1.1" 304 Not Modified
INFO: 172.18.0.5:40112 - "GET /api/meal-plan/this-week/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 179, in call
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 111, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in call
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in call
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in call
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 566, in call
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 182, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 133, in run_endpoint_function
return await dependant.call(**values)
File "./routes/meal_routes.py", line 74, in get_this_week
return MealPlan.this_week()
File "./services/meal_services.py", line 158, in this_week
meal_plan = MealPlan._unpack_doc(meal_plan[0])
File "/usr/local/lib/python3.8/site-packages/mongoengine/queryset/base.py", line 200, in getitem
queryset._cursor[key], _auto_dereference=self._auto_dereference,
File "/usr/local/lib/python3.8/site-packages/pymongo/cursor.py", line 649, in getitem
raise IndexError("no such item for Cursor instance")
IndexError: no such item for Cursor instance
INFO: 172.18.0.5:40140 - "POST /api/recipe/create-url/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 179, in call
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 111, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in call
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in call
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in call
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 566, in call
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 182, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 133, in run_endpoint_function
return await dependant.call(**values)
File "./routes/recipe_routes.py", line 75, in parse_recipe_url
slug = create_from_url(url.url)
File "./services/scrape_services.py", line 66, in create_from_url
recipe_data = process_recipe_url(url)
File "./services/scrape_services.py", line 95, in process_recipe_url
new_recipe: dict = scrape_url(url, python_objects=True)[0]
IndexError: list index out of range
INFO: 172.18.0.5:40146 - "GET /api/all-recipes/?keys=name&keys=slug&keys=image&keys=description&keys=dateAdded&keys=rating&num=100 HTTP/1.1" 200 OK
INFO: 172.18.0.5:40186 - "POST /api/recipe/create/ HTTP/1.1" 200 OK
INFO: 172.18.0.5:40246 - "POST /api/recipe/create/ HTTP/1.1" 200 OK
INFO: 172.18.0.5:40246 - "GET /api/recipe/tuna-sandwich/ HTTP/1.1" 200 OK
INFO: 172.18.0.5:40248 - "GET /static/favicon.ico HTTP/1.1" 304 Not Modified
INFO: 172.18.0.5:40248 - "GET /api/recipe/image/tuna-sandwich/?rnd=1 HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 179, in call
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 111, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in call
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in call
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in call
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 566, in call
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 182, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 133, in run_endpoint_function
return await dependant.call(**values)
File "./routes/recipe_routes.py", line 62, in get_recipe_img
return FileResponse(recipe_image)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 257, in init
media_type = guess_type(filename or path)[0] or "text/plain"
File "/usr/local/lib/python3.8/mimetypes.py", line 292, in guess_type
return _db.guess_type(url, strict)
File "/usr/local/lib/python3.8/mimetypes.py", line 116, in guess_type
TypeError: expected str, bytes or os.PathLike object, not NoneType
INFO: 172.18.0.5:40264 - "GET /api/recipe/null/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 179, in call
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 111, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in call
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in call
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in call
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 566, in call
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 182, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 133, in run_endpoint_function
return await dependant.call(**values)
File "./routes/recipe_routes.py", line 52, in get_recipe
recipe = Recipe.get_by_slug(recipe_slug)
File "./services/recipe_services.py", line 100, in get_by_slug
document = RecipeDocument.objects.get(slug=slug)
File "/usr/local/lib/python3.8/site-packages/mongoengine/queryset/base.py", line 270, in get
raise queryset._document.DoesNotExist(msg)
db.recipe_models.DoesNotExist: RecipeDocument matching query does not exist.`