ChocolateApp / Chocolate

The future of media manager
https://chocolateapp.github.io/
GNU General Public License v3.0
429 stars 16 forks source link

Chocolate fail read media path #27

Closed martadinata666 closed 7 months ago

martadinata666 commented 7 months ago
INFO:werkzeug:10.0.2.100 - - [25/Mar/2024 17:48:08] "GET /favicon.ico HTTP/1.1" 200 -
ERROR:chocolate_app:Exception on /rescan_all [POST]
Traceback (most recent call last):
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/routes/libraries.py", line 261, in rescan_all
    type_to_call[library["lib_type"]](library["lib_name"])
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 1793, in getOthersVideos
    getOthersVideos(library, directoryPath)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 1799, in getOthersVideos
    print_loading(allVideos, index, title)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 268, in print_loading
    terminal_size = os.get_terminal_size().columns - 1
                    ^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 25] Inappropriate ioctl for device
INFO:werkzeug:10.0.2.100 - - [25/Mar/2024 17:48:42] "POST /rescan_all HTTP/1.1" 500 -

2024-03-25-175139_766x420_scrot

Maybe just some clunkyness of react apps passing to chocolate.

Linux Bookworm Personal docker build

Impre-visible commented 7 months ago

As I can see, the problem come from the loading printing, cause u don't have any terminal, so i cant show the loading. I'm gonna patch that as soon as I can, and i come back to u

Impre-visible commented 7 months ago

Hi @martadinata666, I released the 1.7.9 that should path the error, if you still have errors, don't hesitate to put theme here

martadinata666 commented 7 months ago

I assume i should use dev branch right? Or 1.7.9 mean somewhere? If that so dev branch then the issue persist, as docker when running doesn't really had terminal.

INFO:werkzeug:10.0.2.100 - - [26/Mar/2024 19:15:02] "GET /get_all_users HTTP/1.1" 200 -
INFO:werkzeug:10.0.2.100 - - [26/Mar/2024 19:15:17] "POST /create_library HTTP/1.1" 200 -
INFO:werkzeug:10.0.2.100 - - [26/Mar/2024 19:15:17] "GET /get_all_libraries_created HTTP/1.1" 200 -
ERROR:chocolate_app:Exception on /rescan_all [POST]
Traceback (most recent call last):
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/routes/libraries.py", line 261, in rescan_all
    type_to_call[library["lib_type"]](library["lib_name"])
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 1793, in getOthersVideos
    getOthersVideos(library, directoryPath)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 1799, in getOthersVideos
    print_loading(allVideos, index, title)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 268, in print_loading
    terminal_size = os.get_terminal_size().columns - 1
                    ^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 25] Inappropriate ioctl for device
INFO:werkzeug:10.0.2.100 - - [26/Mar/2024 19:15:21] "POST /rescan_all HTTP/1.1" 500 -
INFO:werkzeug:10.0.2.100 - - [26/Mar/2024 19:15:50] "POST /edit_library HTTP/1.1" 200 -
INFO:werkzeug:10.0.2.100 - - [26/Mar/2024 19:15:50] "GET /get_all_libraries_created HTTP/1.1" 200 -
ERROR:chocolate_app:Exception on /rescan_all [POST]
Traceback (most recent call last):
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/routes/libraries.py", line 261, in rescan_all
    type_to_call[library["lib_type"]](library["lib_name"])
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 1793, in getOthersVideos
    getOthersVideos(library, directoryPath)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 1799, in getOthersVideos
    print_loading(allVideos, index, title)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 268, in print_loading
    terminal_size = os.get_terminal_size().columns - 1
                    ^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 25] Inappropriate ioctl for device
INFO:werkzeug:10.0.2.100 - - [26/Mar/2024 19:15:52] "POST /rescan_all HTTP/1.1" 500 -
Impre-visible commented 7 months ago

oh yes, the dev branch is the appropriate one, cause the 7.1.9 is if you use the python package on pypi (pip install chocolate_app)

martadinata666 commented 7 months ago

Did the chocolate app trigger frontend rebuild? On master branch seems it behave different

> chocolate_react@2.0.0 start
> react-scripts start

WARNING:root:Config file not found at /var/chocolate/config.ini. Creating a new one...
2024-03-27 11:09:03,685 INFO success: processes entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-27 11:09:03,685 INFO success: app entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-27 11:09:03,685 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
(node:29) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:29) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...

Compiled with warnings.

Warning
(1961:3) autoprefixer: Replace fill-available to stretch, because spec had been changed

[eslint] 
src/Components/Shared/Video.jsx
  Line 25:10:  'timeOfPreviousClick' is assigned a value but never used  no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

WARNING in ./src/App.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/App.css)
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning

(1961:3) autoprefixer: Replace fill-available to stretch, because spec had been changed

WARNING in [eslint] 
src/Components/Shared/Video.jsx
  Line 25:10:  'timeOfPreviousClick' is assigned a value but never used  no-unused-vars

webpack compiled with 2 warnings
Compiling...
Compiled with warnings.

Warning
(1961:3) autoprefixer: Replace fill-available to stretch, because spec had been changed

[eslint] 
src/Components/Shared/Video.jsx
  Line 25:10:  'timeOfPreviousClick' is assigned a value but never used  no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

WARNING in ./src/App.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/App.css)
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning

(1961:3) autoprefixer: Replace fill-available to stretch, because spec had been changed

WARNING in [eslint] 
src/Components/Shared/Video.jsx
  Line 25:10:  'timeOfPreviousClick' is assigned a value but never used  no-unused-vars

webpack compiled with 2 warnings
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/__main__.py", line 3791, in <module>
    start_chocolate()
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/__main__.py", line 3720, in start_chocolate
    FrontEndRebuilder.rebuild_frontend()
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/plugins_loader/FrontEndRebuilder.py", line 68, in rebuild_frontend
    build_frontend(frontend_path, dir_path, requirements)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/plugins_loader/FrontEndRebuilder.py", line 123, in build_frontend
    os.chdir(frontend_path)
FileNotFoundError: [Errno 2] No such file or directory: '/home/docker/frontend_temp'
Follow this tutorial to get your TMDB API Key : https://developers.themoviedb.org/3/getting-started/introduction
2024-03-27 11:11:17,036 WARN exited: app (exit status 1; not expected)
2024-03-27 11:11:18,038 INFO spawned: 'app' with pid 79
2024-03-27 11:11:18,039 WARN received SIGQUIT indicating exit request
2024-03-27 11:11:18,039 INFO waiting for processes, app, web to die
2024-03-27 11:11:19,041 INFO success: app entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-27 11:11:19,041 WARN stopped: web (terminated by SIGTERM)
2024-03-27 11:11:21,133 INFO waiting for processes, app to die
2024-03-27 11:11:22,134 WARN stopped: app (terminated by SIGQUIT (core dumped))
2024-03-27 11:11:22,134 WARN stopped: processes (terminated by SIGTERM)

Then manually create frontend_temp, dunno why it looking for template.

docker@faef0fcc5d5a:~$ python3 -m chocolate_app
Follow this tutorial to get your TMDB API Key : https://developers.themoviedb.org/3/getting-started/introduction
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/__main__.py", line 3791, in <module>
    start_chocolate()
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/__main__.py", line 3720, in start_chocolate
    FrontEndRebuilder.rebuild_frontend()
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/plugins_loader/FrontEndRebuilder.py", line 68, in rebuild_frontend
    build_frontend(frontend_path, dir_path, requirements)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/plugins_loader/FrontEndRebuilder.py", line 156, in build_frontend
    shutil.copy(f"{build_folder}/index.html", f"{chocolate_path}/templates/index.html")
  File "/usr/lib/python3.11/shutil.py", line 419, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/docker/templates/index.html'
Impre-visible commented 7 months ago

Did the chocolate app trigger frontend rebuild? On master branch seems it behave different

> chocolate_react@2.0.0 start
> react-scripts start

WARNING:root:Config file not found at /var/chocolate/config.ini. Creating a new one...
2024-03-27 11:09:03,685 INFO success: processes entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-27 11:09:03,685 INFO success: app entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-27 11:09:03,685 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
(node:29) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:29) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...

Compiled with warnings.

Warning
(1961:3) autoprefixer: Replace fill-available to stretch, because spec had been changed

[eslint] 
src/Components/Shared/Video.jsx
  Line 25:10:  'timeOfPreviousClick' is assigned a value but never used  no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

WARNING in ./src/App.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/App.css)
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning

(1961:3) autoprefixer: Replace fill-available to stretch, because spec had been changed

WARNING in [eslint] 
src/Components/Shared/Video.jsx
  Line 25:10:  'timeOfPreviousClick' is assigned a value but never used  no-unused-vars

webpack compiled with 2 warnings
Compiling...
Compiled with warnings.

Warning
(1961:3) autoprefixer: Replace fill-available to stretch, because spec had been changed

[eslint] 
src/Components/Shared/Video.jsx
  Line 25:10:  'timeOfPreviousClick' is assigned a value but never used  no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

WARNING in ./src/App.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/App.css)
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning

(1961:3) autoprefixer: Replace fill-available to stretch, because spec had been changed

WARNING in [eslint] 
src/Components/Shared/Video.jsx
  Line 25:10:  'timeOfPreviousClick' is assigned a value but never used  no-unused-vars

webpack compiled with 2 warnings
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/__main__.py", line 3791, in <module>
    start_chocolate()
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/__main__.py", line 3720, in start_chocolate
    FrontEndRebuilder.rebuild_frontend()
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/plugins_loader/FrontEndRebuilder.py", line 68, in rebuild_frontend
    build_frontend(frontend_path, dir_path, requirements)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/plugins_loader/FrontEndRebuilder.py", line 123, in build_frontend
    os.chdir(frontend_path)
FileNotFoundError: [Errno 2] No such file or directory: '/home/docker/frontend_temp'
Follow this tutorial to get your TMDB API Key : https://developers.themoviedb.org/3/getting-started/introduction
2024-03-27 11:11:17,036 WARN exited: app (exit status 1; not expected)
2024-03-27 11:11:18,038 INFO spawned: 'app' with pid 79
2024-03-27 11:11:18,039 WARN received SIGQUIT indicating exit request
2024-03-27 11:11:18,039 INFO waiting for processes, app, web to die
2024-03-27 11:11:19,041 INFO success: app entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-03-27 11:11:19,041 WARN stopped: web (terminated by SIGTERM)
2024-03-27 11:11:21,133 INFO waiting for processes, app to die
2024-03-27 11:11:22,134 WARN stopped: app (terminated by SIGQUIT (core dumped))
2024-03-27 11:11:22,134 WARN stopped: processes (terminated by SIGTERM)

Then manually create frontend_temp, dunno why it looking for template.

docker@faef0fcc5d5a:~$ python3 -m chocolate_app
Follow this tutorial to get your TMDB API Key : https://developers.themoviedb.org/3/getting-started/introduction
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/__main__.py", line 3791, in <module>
    start_chocolate()
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/__main__.py", line 3720, in start_chocolate
    FrontEndRebuilder.rebuild_frontend()
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/plugins_loader/FrontEndRebuilder.py", line 68, in rebuild_frontend
    build_frontend(frontend_path, dir_path, requirements)
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/plugins_loader/FrontEndRebuilder.py", line 156, in build_frontend
    shutil.copy(f"{build_folder}/index.html", f"{chocolate_path}/templates/index.html")
  File "/usr/lib/python3.11/shutil.py", line 419, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/docker/templates/index.html'

Oh shit, the frontend should create itself the folder and everything... I'm gonna look at this today of I can

Impre-visible commented 7 months ago

Okay, I pushed an update, this one verify that the frontend_temp folder exists. So you can try with the latest dev commit

martadinata666 commented 7 months ago

Oh another error pop out, I confirmed the path exists.

INFO:werkzeug:192.168.0.4 - - [27/Mar/2024 13:31:23] "POST /create_library HTTP/1.1" 200 -
INFO:werkzeug:192.168.0.4 - - [27/Mar/2024 13:31:23] "GET /get_all_libraries_created HTTP/1.1" 200 -
ERROR:chocolate_app:Exception on /rescan_all [POST]
Traceback (most recent call last):
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/routes/libraries.py", line 268, in rescan_all
    type_to_call[library["lib_type"]](library["lib_name"])
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/scans.py", line 1919, in getOthersVideos
    allVideos = os.listdir(f"{allVideosPath}")
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'str | None'
INFO:werkzeug:192.168.0.4 - - [27/Mar/2024 13:32:58] "POST /rescan_all HTTP/1.1" 500 -

2024-03-27-134436_689x485_scrot

A question, why the main app need to build the web? As per usual flow is, build web and app separately, then the react output build, copied into app dir. Assuming chocolate use /var/chocolate then it will become /var/chocolate/static /var/chocolate/template that copied from separate react build.

This is sample how usual flow works. Still need works but the gist of it.

FROM 192.168.0.2:5050/dedyms/debian:dev as app
RUN git clone --depth=1 -b dev https://github.com/ChocolateApp/Chocolate.git app && \
    cd app && \
    pip3 install --timeout=10000 --user --break-system-packages .

FROM 192.168.0.2:5050/dedyms/node:lts-dev as web
RUN git clone --depth=1 -b dev https://github.com/ChocolateApp/ChocolateReact.git web && \
    cd web && \
    npm -d install && \
    npm -d run build

FROM 192.168.0.2:5050/dedyms/node:lts-ffmpeg
RUN sudo apt update && \
    sudo apt install -y --no-install-recommends python3-minimal python3-pip python3-wheel supervisor git
RUN sudo mkdir /var/chocolate /var/chocolate/plugins && \
    sudo chown -R $CONTAINERUSER:$CONTAINERUSER /var/chocolate
COPY --from=app --chown=$CONTAINERUSER:$CONTAINERUSER $HOME/.local $HOME/.local
COPY --from=web $HOME/web/build /var/chocolate/templates
RUN mv /var/chocolate/template/static /var/chocolate/static
COPY --chown=$CONTAINERUSER:$CONTAINERUSER supervisor /supervisor
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["supervisord","-c","/supervisor/supervisord.conf"]
Impre-visible commented 7 months ago

okay, the version I'm working on use "metaprogramming" to allow plugins to inject html pages. So If there's no plugins, or one is edited, I build the frontend. The new error is way different and our problem of frontend is patched, here its simply a mistype error, I put an = instead of a : for a type, so the default value has been "str | None" instead of "". Thats strang thats allowed, its patched

martadinata666 commented 7 months ago

Just rebuild, another error popped out

192.168.0.4 - - [28/Mar/2024 10:03:27] "GET /favicon.ico HTTP/1.1" 200 -
[2024-03-28 10:03:31,804] ERROR in app: Exception on /rescan_all [POST]
Traceback (most recent call last):
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docker/.local/lib/python3.11/site-packages/chocolate_app/routes/libraries.py", line 268, in rescan_all
    type_to_call[library["lib_type"]](library["lib_name"])
TypeError: getOthersVideos() missing 1 required positional argument: 'allVideosPath'
192.168.0.4 - - [28/Mar/2024 10:03:31] "POST /rescan_all HTTP/1.1" 500 -
Impre-visible commented 7 months ago

Ok, that's dumb cause I should have patched the error lol. It's patched

martadinata666 commented 7 months ago

Working for now 👍🏼 thanks