TomBursch / kitchenowl

KitchenOwl is a self-hosted grocery list and recipe manager. The backend is made with Flask and the frontend with Flutter. Easily add items to your shopping list before you go shopping. You can also create recipes and add items based on what you want to cook.
https://kitchenowl.org/
GNU Affero General Public License v3.0
1.25k stars 72 forks source link

Bug: Connection loss on search #211

Open chpgyr opened 1 year ago

chpgyr commented 1 year ago

Is this urgent?

None

What parts are affected

Both

What are the Server/Client versions of KitchenOwl

latest

What's the problem 🤔

When searching for a shopping item the front end loses the connection to the back end.

Share your logs

Docker log
2023/07/31 18:40:40 stderr  [pid: 17|app: 0|req: 18/18] 127.0.0.1 () {28 vars in 373 bytes} [Mon Jul 31 16:40:40 2023] GET /api/health/8M4F88S8ooi4sMbLBfkkV7ctWwgibW6V => generated 52 bytes in 0 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 0)
2023/07/31 18:40:30 stderr  [pid: 17|app: 0|req: 17/17] 192.168.97.174 () {56 vars in 1149 bytes} [Mon Jul 31 16:40:30 2023] GET /api/health/8M4F88S8ooi4sMbLBfkkV7ctWwgibW6V => generated 52 bytes in 0 msecs (HTTP/1.1 200) 9 headers in 413 bytes (1 switches on core 0)
2023/07/31 18:40:30 stderr  [pid: 17|app: 0|req: 16/16] 192.168.97.174 () {56 vars in 1140 bytes} [Mon Jul 31 16:40:30 2023] GET /api/shoppinglist/1/recent-items?limit=9 => generated 361 bytes in 542 msecs (HTTP/1.1 200) 9 headers in 414 bytes (1 switches on core 0)
2023/07/31 18:40:30 stderr  [pid: 17|app: 0|req: 15/15] 192.168.97.174 () {56 vars in 1111 bytes} [Mon Jul 31 16:40:29 2023] GET /api/household/1/category => generated 1419 bytes in 1034 msecs (HTTP/1.1 200) 9 headers in 415 bytes (1 switches on core 0)
2023/07/31 18:40:29 stderr  [pid: 17|app: 0|req: 14/14] 192.168.97.174 () {56 vars in 1130 bytes} [Mon Jul 31 16:40:28 2023] GET /api/shoppinglist/1/items?orderby=2 => generated 792 bytes in 917 msecs (HTTP/1.1 200) 9 headers in 414 bytes (1 switches on core 0)
2023/07/31 18:40:28 stderr  [pid: 17|app: 0|req: 13/13] 192.168.97.174 () {56 vars in 1122 bytes} [Mon Jul 31 16:40:27 2023] GET /api/household/1/expense?view=0 => generated 3 bytes in 933 msecs (HTTP/1.1 200) 9 headers in 412 bytes (1 switches on core 0)
2023/07/31 18:40:27 stderr  [pid: 17|app: 0|req: 12/12] 192.168.97.174 () {56 vars in 1131 bytes} [Mon Jul 31 16:40:26 2023] GET /api/household/1/expense/categories => generated 116 bytes in 657 msecs (HTTP/1.1 200) 9 headers in 414 bytes (1 switches on core 0)
2023/07/31 18:40:26 stderr  [pid: 17|app: 0|req: 11/11] 192.168.97.174 () {56 vars in 1145 bytes} [Mon Jul 31 16:40:25 2023] GET /api/household/1/planner/suggested-recipes => generated 3 bytes in 965 msecs (HTTP/1.1 200) 9 headers in 412 bytes (1 switches on core 0)
2023/07/31 18:40:25 stderr  [pid: 17|app: 0|req: 10/10] 192.168.97.174 () {56 vars in 1139 bytes} [Mon Jul 31 16:40:24 2023] GET /api/household/1/planner/recent-recipes => generated 3 bytes in 1684 msecs (HTTP/1.1 200) 9 headers in 412 bytes (1 switches on core 0)
2023/07/31 18:40:24 stderr  [pid: 17|app: 0|req: 9/9] 192.168.97.174 () {56 vars in 1125 bytes} [Mon Jul 31 16:40:23 2023] GET /api/household/1/planner/recipes => generated 3 bytes in 855 msecs (HTTP/1.1 200) 9 headers in 412 bytes (1 switches on core 0)
2023/07/31 18:40:23 stderr  [pid: 17|app: 0|req: 8/8] 192.168.97.174 () {56 vars in 1107 bytes} [Mon Jul 31 16:40:22 2023] GET /api/household/1/recipe => generated 1094 bytes in 1211 msecs (HTTP/1.1 200) 9 headers in 415 bytes (1 switches on core 0)
2023/07/31 18:40:22 stderr  [pid: 17|app: 0|req: 7/7] 192.168.97.174 () {56 vars in 1101 bytes} [Mon Jul 31 16:40:21 2023] GET /api/household/1/tag => generated 100 bytes in 911 msecs (HTTP/1.1 200) 9 headers in 414 bytes (1 switches on core 0)
2023/07/31 18:40:21 stderr  [pid: 17|app: 0|req: 6/6] 192.168.97.174 () {56 vars in 1119 bytes} [Mon Jul 31 16:40:20 2023] GET /api/household/1/shoppinglist => generated 201 bytes in 1114 msecs (HTTP/1.1 200) 9 headers in 414 bytes (1 switches on core 0)
2023/07/31 18:40:20 stderr  [pid: 17|app: 0|req: 5/5] 192.168.97.174 () {56 vars in 1093 bytes} [Mon Jul 31 16:40:19 2023] GET /api/household/1 => generated 515 bytes in 694 msecs (HTTP/1.1 200) 9 headers in 414 bytes (1 switches on core 0)
2023/07/31 18:40:14 stderr  [pid: 17|app: 0|req: 4/4] 192.168.97.174 () {56 vars in 1089 bytes} [Mon Jul 31 16:40:13 2023] GET /api/household => generated 517 bytes in 1060 msecs (HTTP/1.1 200) 9 headers in 414 bytes (1 switches on core 0)
2023/07/31 18:40:13 stderr  [pid: 17|app: 0|req: 3/3] 192.168.97.174 () {56 vars in 1079 bytes} [Mon Jul 31 16:40:12 2023] GET /api/user => generated 3214 bytes in 884 msecs (HTTP/1.1 200) 9 headers in 415 bytes (1 switches on core 0)
2023/07/31 18:40:12 stderr  [pid: 17|app: 0|req: 2/2] 192.168.97.174 () {62 vars in 1221 bytes} [Mon Jul 31 16:40:09 2023] POST /api/auth => generated 563 bytes in 3310 msecs (HTTP/1.1 200) 9 headers in 414 bytes (1 switches on core 0)
2023/07/31 18:39:39 stderr  [pid: 17|app: 0|req: 1/1] 127.0.0.1 () {28 vars in 373 bytes} [Mon Jul 31 16:39:39 2023] GET /api/health/8M4F88S8ooi4sMbLBfkkV7ctWwgibW6V => generated 52 bytes in 1 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 0)
2023/07/31 18:38:46 stderr  WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7f6c5c3bb578 pid: 17 (default app)
2023/07/31 18:38:43 stderr  spawned uWSGI http 1 (pid: 18)
2023/07/31 18:38:43 stderr  spawned uWSGI worker 1 (pid: 17, cores: 1)
2023/07/31 18:38:43 stderr  spawned uWSGI master process (pid: 16)
2023/07/31 18:38:43 stderr  *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
2023/07/31 18:38:43 stderr  uWSGI running as root, you can use --uid/--gid/--chroot options
2023/07/31 18:38:43 stderr  *** Operational MODE: single process ***
2023/07/31 18:38:43 stderr  mapped 145808 bytes (142 KB) for 1 cores
2023/07/31 18:38:43 stderr  your mercy for graceful operations on workers is 60 seconds
2023/07/31 18:38:43 stderr  your server socket listen backlog is limited to 100 connections
2023/07/31 18:38:43 stderr  python threads support enabled
2023/07/31 18:38:43 stderr  *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
2023/07/31 18:38:43 stderr  uWSGI running as root, you can use --uid/--gid/--chroot options
2023/07/31 18:38:43 stderr  Python main interpreter initialized at 0x7f6c5c3bb578
2023/07/31 18:38:43 stderr  Python version: 3.11.4 (main, Jul  4 2023, 05:35:05) [GCC 12.2.0]
2023/07/31 18:38:43 stderr  *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
2023/07/31 18:38:43 stderr  uWSGI running as root, you can use --uid/--gid/--chroot options
2023/07/31 18:38:43 stderr  uwsgi socket 0 bound to TCP address 0.0.0.0:5000 fd 6
2023/07/31 18:38:43 stderr  uWSGI http bound on 0.0.0.0:80 fd 3
2023/07/31 18:38:43 stderr  thunder lock: disabled (you can enable it with --thunder-lock)
2023/07/31 18:38:43 stderr  lock engine: pthread robust mutexes
2023/07/31 18:38:43 stderr  detected max file descriptor number: 1048576
2023/07/31 18:38:43 stderr  your memory page size is 4096 bytes
2023/07/31 18:38:43 stderr  *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
2023/07/31 18:38:43 stderr  uWSGI running as root, you can use --uid/--gid/--chroot options
2023/07/31 18:38:43 stderr  detected binary path: /opt/venv/bin/uwsgi
2023/07/31 18:38:43 stderr  current working directory: /usr/src/kitchenowl
2023/07/31 18:38:43 stderr  detected number of CPU cores: 4
2023/07/31 18:38:43 stderr  pcre jit disabled
2023/07/31 18:38:43 stderr  clock source: unix
2023/07/31 18:38:43 stderr  machine: x86_64
2023/07/31 18:38:43 stderr  nodename: 11e419ce54e0
2023/07/31 18:38:43 stderr  os: Linux-4.4.302+ #64570 SMP Tue Jun 13 21:39:55 CST 2023
2023/07/31 18:38:43 stderr  compiled with version: 12.2.0 on 19 July 2023 16:12:48
2023/07/31 18:38:43 stderr  *** Starting uWSGI 2.0.21 (64bit) on [Mon Jul 31 16:38:43 2023] ***
2023/07/31 18:38:43 stderr  [uWSGI] getting INI configuration from wsgi.ini
2023/07/31 18:38:43 stderr  INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
2023/07/31 18:38:43 stderr  INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
2023/07/31 18:38:43 stderr    return current_app.extensions['migrate'].db.get_engine()
2023/07/31 18:38:43 stderr  /usr/src/kitchenowl/migrations/env.py:21: DeprecationWarning: 'get_engine' is deprecated and will be removed in Flask-SQLAlchemy 3.1. Use 'engine' or 'engines[key]' instead.
2023/07/31 18:38:43 stderr    return current_app.extensions['migrate'].db.get_engine()
2023/07/31 18:38:43 stderr  /usr/src/kitchenowl/migrations/env.py:21: DeprecationWarning: 'get_engine' is deprecated and will be removed in Flask-SQLAlchemy 3.1. Use 'engine' or 'engines[key]' instead.

Share your configuration

Docker on Synology DSM 7.2
version: "3"
services:
    front:
        image: tombursch/kitchenowl-web:latest
        environment:
        - FRONT_URL=https://ko.xxx.yy
        ports:
        - "80:80"
        depends_on:
        - back
        networks:
          default2:
            ipv4_address: 192.168.97.162

    back:
        image: tombursch/kitchenowl:latest
        restart: always
        networks:
          default2:
            ipv4_address: 192.168.97.163
        environment:
        - JWT_SECRET_KEY=any
        - FRONT_URL=https://ko.xxx.yy
        volumes:
        - /volume1/docker/kitchenowl:/data

networks:
    default2:
       name: macvlan
       external: true
TomBursch commented 1 year ago

Hey, sorry for the late reply. Your logs do look normal, do you have any logs of the search itself? And what platform is this happening on (iOS/android/web)?