rsxdalv / tts-generation-webui

TTS Generation Web UI (Bark, MusicGen + AudioGen, Tortoise, RVC, Vocos, Demucs, SeamlessM4T, MAGNet, StyleTTS2, MMS, Stable Audio, Mars5, F5-TTS, ParlerTTS)
https://rsxdalv.github.io/tts-generation-webui/
MIT License
1.76k stars 190 forks source link

this error is following me everywhere, i don't know what it means, but seems to be related to fastapi #404

Open BornSaint opened 4 days ago

BornSaint commented 4 days ago

RuntimeError: Form data requires "python-multipart" to be installed. You can install "python-multipart" with:

pip install python-multipart

BornSaint commented 4 days ago

reinstalled conda to see if it solves, and there's the stacktrace:

creating configuration files ... ok
running bootstrap script ... 2024-10-27 13:04:21.882 -03 [56783] FATAL:  data directory "/media/r/transition/tts-generation-webui/data/postgres" has invalid permissions
2024-10-27 13:04:21.882 -03 [56783] DETAIL:  Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
child process exited with exit code 1
initdb: removing data directory "/media/r/transition/tts-generation-webui/data/postgres"
Error: Command failed: initdb -D /media/r/transition/tts-generation-webui/data/postgres -U postgres
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at $sh (/media/r/transition/tts-generation-webui/installer_scripts/js/shell.js:31:12)
    at initializeDatabase (/media/r/transition/tts-generation-webui/installer_scripts/js/applyDatabaseConfig.js:23:11)
    at applyDatabaseConfig (/media/r/transition/tts-generation-webui/installer_scripts/js/applyDatabaseConfig.js:27:9)
    at exports.initializeApp (/media/r/transition/tts-generation-webui/installer_scripts/js/initializeApp.js:260:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async main (/media/r/transition/tts-generation-webui/installer_scripts/init_app.js:99:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 56730,
  stdout: null,
  stderr: null
}
Failed to apply database config
Initializing extensions...
Installing node_modules...
>cd react-ui && npm install
npm warn deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported

added 1395 packages, and audited 1396 packages in 35s

279 packages are looking for funding
  run `npm fund` for details

17 vulnerabilities (5 low, 5 moderate, 7 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
Successfully installed node_modules
Building react-ui...
>cd react-ui && npm run build

> tts-generation-webui-react@0.1.0 prebuild
> node generate-plugin-imports.js

No React UI extensions found

> tts-generation-webui-react@0.1.0 build
> next build

   Creating an optimized production build ...
(node:56887) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 ✓ Compiled successfully
   Linting and checking validity of types ...

./src/components/MagnetModelSelector.tsx
180:6  Warning: React Hook React.useEffect has a missing dependency: 'fetchOptions'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/MusicgenModelSelector.tsx
97:6  Warning: React Hook React.useEffect has a missing dependency: 'fetchOptions'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/extensions/link.ts
1:1  Warning: Assign object to a variable before exporting as module default  import/no-anonymous-default-export

./src/hooks/useLocalStorage.ts
65:6  Warning: React Hook useEffect has a missing dependency: 'extend'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/pages/pipeline.tsx
136:6  Warning: React Hook React.useEffect has missing dependencies: 'model', 'setBarkVoiceGenerationParams', 'setMagnetParams', 'setMahaParams', 'setMmsParams', 'setMusicgenParams', 'setTortoiseGenerationParams', and 'setVallexParams'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
   Collecting page data ...
   Generating static pages (0/35) ...
   Generating static pages (8/35) 
   Generating static pages (17/35) 
selected 
   Generating static pages (26/35) 
Error: ENOENT: no such file or directory, scandir '/media/r/transition/tts-generation-webui/favorites'
    at async Object.readdir (node:internal/fs/promises:950:18)
    at async getDataFromJSON (/media/r/transition/tts-generation-webui/react-ui/.next/server/chunks/3197.js:1:1131)
    at async getStaticProps (/media/r/transition/tts-generation-webui/react-ui/.next/server/pages/outputs/[name].js:1:1625) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/media/r/transition/tts-generation-webui/favorites'
}
Error: ENOENT: no such file or directory, scandir '/media/r/transition/tts-generation-webui/outputs'
    at async Object.readdir (node:internal/fs/promises:950:18)
    at async getDataFromJSON (/media/r/transition/tts-generation-webui/react-ui/.next/server/chunks/3197.js:1:1131)
    at async getStaticProps (/media/r/transition/tts-generation-webui/react-ui/.next/server/pages/outputs/[name].js:1:1625) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/media/r/transition/tts-generation-webui/outputs'
}
 ✓ Generating static pages (35/35) 
   Finalizing page optimization ...
   Collecting build traces ...

Route (app)                                        Size     First Load JS
─ λ /api/upload                                    0 B                0 B
+ First Load JS shared by all                      0 B

Route (pages)                                      Size     First Load JS
┌ ● /                                              1.84 kB         136 kB
├   /_app                                          0 B            86.6 kB
├ ○ /404                                           184 B          86.8 kB
├ λ /api/gradio/[name]                             0 B            86.6 kB
├ λ /api/webui-generations/[...name]               0 B            86.6 kB
├ ○ /audio-conversion                              969 B           135 kB
├ ○ /audio-conversion/demucs                       1.06 kB         160 kB
├ ○ /audio-conversion/rvc (337 ms)                 5.83 kB         188 kB
├ ○ /audio-conversion/vocos_wav (336 ms)           4.91 kB         163 kB
├ ○ /audio-music-generation                        872 B           135 kB
├ ○ /audio-music-generation/magnet                 3.89 kB         193 kB
├ ○ /audio-music-generation/musicgen               5.17 kB         192 kB
├ ○ /audio-music-generation/stable-audio (332 ms)  2.29 kB         169 kB
├ ● /db                                            373 B            87 kB
├ ● /extensions/[name]                             2.62 kB         137 kB
├   └ /extensions/extension_xtts_simple
├ ○ /extensions/huggingface_cache_manager          1.97 kB         136 kB
├ ○ /outputs                                       416 B           135 kB
├ ● /outputs/[name] (677 ms)                       437 B           135 kB
├   ├ /outputs/outputs (644 ms)
├   └ /outputs/favorites
├ ○ /outputs/ffmpeg-metadata-page                  5.84 kB         164 kB
├ ● /outputs/generations                           486 B           135 kB
├ ● /outputs/voice-drafts                          659 B           135 kB
├ ○ /pipeline                                      6.88 kB         241 kB
├ ○ /placeholder                                   297 B           134 kB
├ ○ /text-to-speech                                1.05 kB         135 kB
├ ○ /text-to-speech/bark                           1.85 kB         174 kB
├ ○ /text-to-speech/bark/bark_settings             3.64 kB         141 kB
├ ○ /text-to-speech/bark/bark_voice_generation     4.23 kB         180 kB
├ ○ /text-to-speech/bark/vocos_npz                 930 B           159 kB
├ ● /text-to-speech/bark/voices (675 ms)           514 B           135 kB
├ ○ /text-to-speech/maha-tts                       7.47 kB         191 kB
├ ○ /text-to-speech/mms                            1.69 kB         193 kB
├ ○ /text-to-speech/tortoise                       2.96 kB         215 kB
├ ○ /text-to-speech/vallex                         4.39 kB         174 kB
├ ○ /tools                                         359 B           134 kB
└ ○ /tools/gpu_info                                351 B           137 kB
+ First Load JS shared by all                      93.6 kB
  ├ chunks/framework-e01539b19c62df36.js           45.3 kB
  ├ chunks/main-e9ecd87650e3c18b.js                32.8 kB
  ├ chunks/pages/_app-21bb898b8c6db73d.js          6.39 kB
  ├ chunks/webpack-8bd59df194125124.js             2.12 kB
  └ css/c708664b05630efb.css                       7 kB

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)

Successfully built react-ui
Checking if torch has CUDA...
>python -c import torch; exit(0 if torch.cuda.is_available() else 1)

Finished init app.

postgres: could not access directory "/media/r/transition/tts-generation-webui/data/postgres": Arquivo ou diretório inexistente
Run initdb or pg_basebackup to initialize a PostgreSQL data directory.
Form data requires "python-multipart" to be installed. 
You can install "python-multipart" with: 

pip install python-multipart

Starting server...

Env file not found. Creating default env.
Config file not found. Creating default config.
Loading decorator extension Decorator Save Ogg
  Skipping disabled decorator extension decorator_disabled
  Decorator decorator_save_flac loaded
  Decorator decorator_save_flac_generator loaded
  Decorator decorator_save_ogg loaded
  Decorator decorator_save_ogg_generator loaded
  Done in 0.02 seconds. (Decorator Save Ogg)

Loading decorator extension Decorator Save Waveform
  Decorator decorator_save_waveform_plot loaded
  Done in 0.39 seconds. (Decorator Save Waveform)

Loading decorator extension Decorator Average Execution Time
  Decorator decorator_average_execution_time loaded
  Done in 0.01 seconds. (Decorator Average Execution Time)

Starting React UI...
Starting Postgres...
Starting Gradio server...
 Gradio interface options:
  inline:               False
  inbrowser:            True
  share:                False
  debug:                False
  max_threads:          40
  auth:                 None
  auth_message:         None
  prevent_thread_lock:  False
  show_error:           False
  server_name:          127.0.0.1
  server_port:          7770
  height:               500
  width:                100%
  favicon_path:         None
  ssl_keyfile:          None
  ssl_certfile:         None
  ssl_keyfile_password: None
  ssl_verify:           True
  quiet:                True
  show_api:             True
  _frontend:            True
Traceback (most recent call last):
  File "/media/r/transition/tts-generation-webui/server.py", line 392, in <module>
    start_gradio_server()
  File "/media/r/transition/tts-generation-webui/server.py", line 315, in start_gradio_server
    demo = main_ui()
  File "/media/r/transition/tts-generation-webui/server.py", line 115, in main_ui
    with gr.Blocks(
  File "/media/r/transition/tts-generation-webui/installer_files/env/lib/python3.10/site-packages/gradio/blocks.py", line 1127, in __init__
    self.queue()
  File "/media/r/transition/tts-generation-webui/installer_files/env/lib/python3.10/site-packages/gradio/blocks.py", line 2226, in queue
    self.app = routes.App.create_app(self)
  File "/media/r/transition/tts-generation-webui/installer_files/env/lib/python3.10/site-packages/gradio/routes.py", line 456, in create_app
    def login(form_data: OAuth2PasswordRequestForm = Depends()):
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/routing.py", line 994, in decorator
    self.add_api_route(
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/routing.py", line 933, in add_api_route
    route = route_class(
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/routing.py", line 554, in __init__
    self.dependant = get_dependant(path=self.path_format, call=self.endpoint)
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 284, in get_dependant
    sub_dependant = get_param_sub_dependant(
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 118, in get_param_sub_dependant
    return get_sub_dependant(
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 154, in get_sub_dependant
    sub_dependant = get_dependant(
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 277, in get_dependant
    param_details = analyze_param(
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 474, in analyze_param
    ensure_multipart_is_installed()
  File "/home/r/.local/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 107, in ensure_multipart_is_installed
    raise RuntimeError(multipart_not_installed_error) from None
RuntimeError: Form data requires "python-multipart" to be installed. 
You can install "python-multipart" with: 

pip install python-multipart

Failed to start the app, exiting...
(tts-webui) r@rpc:/media/r/transition/tts-generation-webui$ 
(tts-webui) r@rpc:/media/r/transition/tts-generation-webui$ 
> tts-generation-webui-react@0.1.0 start
> next start

 ⨯ Failed to start server
Error: listen EADDRINUSE: address already in use :::3000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at Server.listen (node:net:2067:7)
    at /media/r/transition/tts-generation-webui/react-ui/node_modules/next/dist/server/lib/start-server.js:254:16
    at new Promise (<anonymous>)
    at startServer (/media/r/transition/tts-generation-webui/react-ui/node_modules/next/dist/server/lib/start-server.js:191:11)
    at nextStart (/media/r/transition/tts-generation-webui/react-ui/node_modules/next/dist/cli/next-start.js:50:40)
    at /media/r/transition/tts-generation-webui/react-ui/node_modules/next/dist/bin/next:157:54
    at async main (/media/r/transition/tts-generation-webui/react-ui/node_modules/next/dist/bin/next:157:5) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '::',
  port: 3000
}
rsxdalv commented 4 days ago

I might need to see the full install log. Alternatively, we can start with install_scripts/diagnostics.sh to see if we can spot the problem here. For reference, here is a successful pip install on different platforms. https://github.com/rsxdalv/tts-generation-webui/actions/runs/11543859511

BornSaint commented 2 days ago

I might need to see the full install log. Alternatively, we can start with install_scripts/diagnostics.sh to see if we can spot the problem here. For reference, here is a successful pip install on different platforms. https://github.com/rsxdalv/tts-generation-webui/actions/runs/11543859511

log.log Windows and Linux, doesn't matter, it's the same error

rsxdalv commented 2 days ago

Thanks. It seems like most of it succeeded but I see what could be a big hidden issue: pip is installing in two different places:

File "/media/r/transition/tts-generation-webui/installer_files/env/lib/python3.10/site-packages/gradio/routes.py", line 456, in create_app def login(form_data: OAuth2PasswordRequestForm = Depends()): File "/home/r/.local/lib/python3.10/site-packages/fastapi/routing.py", line 994, in decorator self.add_api_route(

Both in the correct place of media/... But then also in home/ I suspect this could be the reason why the dependencies don't match, i.e. gradio and fastapi.

BornSaint commented 2 days ago

Thanks. It seems like most of it succeeded but I see what could be a big hidden issue: pip is installing in two different places:

File "/media/r/transition/tts-generation-webui/installer_files/env/lib/python3.10/site-packages/gradio/routes.py", line 456, in create_app def login(form_data: OAuth2PasswordRequestForm = Depends()): File "/home/r/.local/lib/python3.10/site-packages/fastapi/routing.py", line 994, in decorator self.add_api_route(

Both in the correct place of media/... But then also in home/ I suspect this could be the reason why the dependencies don't match, i.e. gradio and fastapi.

solved by going to project root dir with cd command, and then:

conda activate ./installer_files/env &&  \
pip install -U python-multipart==0.0.2 && \
conda deactivate

then just try to run again and should be ok just need to downgrade python-multipart to 0.0.2

rsxdalv commented 2 days ago

Good!

Also I found this issue: https://github.com/pypa/pip/issues/5702

Could you please check if you have pip with "user" mode? There are reports that in this user mode pip just installs outside of the virtual env.