Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.0.0b] - OCR recipe batch creation capped at 10 recipes #2437

Closed
5 tasks done
Bibz87 opened this issue Jul 3, 2023 · 2 comments · Fixed by #2838
Closed
5 tasks done

[v1.0.0b] - OCR recipe batch creation capped at 10 recipes #2437

Bibz87 opened this issue Jul 3, 2023 · 2 comments · Fixed by #2838
Labels
bug: confirmed bug Something isn't working

Comments

@Bibz87
Copy link

Bibz87 commented Jul 3, 2023

First Check

  • This is not a feature request
  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Mealie documentation, with the integrated search.
  • I already read the docs and didn't find an answer.

What is the issue you are experiencing?

Creating more than 10 recipes using the API (POST /api/recipes/create-ocr) without renaming them will cause an internal server error.

Log:

INFO:     10.42.1.101:55522 - "POST /api/recipes/create-ocr HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context
    self.dialect.do_execute(
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 748, in do_execute
    cursor.execute(statement, parameters)
sqlite3.IntegrityError: UNIQUE constraint failed: recipes.slug, recipes.group_id

Adding a name parameter to the API (like the one POST /api/recipes has) would help fixing the issue by explicitly giving a name to the created recipe.

Also, the API could return a 409 in these situations instead of simply returning a generic server error. That would help diagnose problems when using the API.

This issue also makes Mealie's Frontend UI fail silently when creating more than 10 OCR recipes without changing their title.

Deployment

Other

Deployment Details

Both components deployed to Kubernetes (k3s):

  • API image: hkotel/mealie:api-nightly
  • Frontend image: hkotel/mealie:frontend-nightly

Build info:
Details
Version: nightly
Build: 674774d
Application Mode: Production
Demo Status: Not Demo
API Port: 9000
API Docs: Enabled
Database Type: sqlite
Recipe Scraper Version: 14.36.0

Checks
Secure Site: Yes
Server Side Base URL: Yes
LDAP Ready: No
Email Configured: No
Docker Volumes: success

@Bibz87
Copy link
Author

Bibz87 commented Jul 3, 2023

The reason why the limit is 10 seems to come from here.

@michael-genson
Copy link
Collaborator

FYI we have decided to remove OCR from Mealie. You can read more on #2838.

If you need to use OCR to import recipes, I recommend using external tools such as this online OCR tool to extract the text, which you then copy-paste into Mealie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: confirmed bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants