nextcloud / stt_whisper

Speech-To-Text provider running OpenAI Whisper locally
23 stars 0 forks source link

"Could not execute the whisper executable" #15

Closed ohthehugemanatee closed 6 months ago

ohthehugemanatee commented 1 year ago

I'm running on the alpine-based linuxserver/docker-nextcloud container on x64. The error message isn't very helpful: which executable? Why couldn't it run? Was there an error message? In the app's bin directory I found main and main-musl without much explanation. They both refuse to run with bash: ./main-musl: cannot execute: required file not found

Can I get more information on this? Seems like it should be able to run on my system. I'd rather not recompile if I can avoid it...

qcdebug commented 1 year ago

I have a bare metal install with the same issue. I can execute whisper at the CLI with stellar results but it seems that nextcloud can't find the binary or the learning models. I also have a "Background tasks are not executed via cron. This app requires background jobs to be executed via cron." I don't know if that last one is related or not.

SystemKeeper commented 1 year ago

Check if the binaries in /var/www/nextcloud/apps/stt_whisper/bin/main are executable for you. It wasn't for me (failed with a GLIBC error). Cloning the repo and then running make bin/main creates a new binary which can be used instead of the shipped one.

madmudklip commented 1 year ago

Running Nextcloud AIO docker and experiencing the same issue. Confirmed everything is executable under /var/www/nextcloud/custom_apps/stt_whisper/bin/ but this path does not contain main.

marcelklehr commented 1 year ago

this path does not contain main.

What do you mean by that? The bin folder doesn't contain any files named main?

It may be that my attempt to compile whisper for musl on a non-musl system failed :/

madmudklip commented 1 year ago

@marcelklehr no sorry my mistake, its there, I was just being an idiot. Then I really have no idea why Nextcloud could not execute the whisper executable.

SystemKeeper commented 1 year ago

Did you try to run it manually inside the container to see if it actually works?

madmudklip commented 1 year ago

Actually found an error on running occ maintenance:repair for my other issue related to llm

marcelklehr commented 1 year ago

the docker user may not have write permissions for these files

madmudklip commented 1 year ago

the docker user may not have write permissions for these files

I updated the permissions in the docker to allow all rwx on the files but made no difference

marcelklehr commented 1 year ago

As I said

It may be that my attempt to compile whisper for musl on a non-musl system failed :/

that would mean that the app as it is, is not compatible with alpine and you will need to compile it yourself (which is not that hard)

tcitworld commented 1 year ago

It wasn't for me (failed with a GLIBC error). Cloning the repo and then running make bin/main creates a new binary which can be used instead of the shipped one.

Same kind of error here.

./main: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./main)
./main: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./main)
./main: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./main)

It's because the system I'm using it on is still running Debian 11 (bullseye), which has glibc 2.31. @marcelklehr do you mind building on older systems so that the glibc version is not an issue?

madmudklip commented 1 year ago

As I said

It may be that my attempt to compile whisper for musl on a non-musl system failed :/

that would mean that the app as it is, is not compatible with alpine and you will need to compile it yourself (which is not that hard)

Compiling it makes it possible to run main manually, but the Nextcloud error that it cannot execute the Whisper executable remains, additionally a new error appears on the admin pane "failed to load settings." Running occ maintenance:repair reveals no errors.

marcelklehr commented 1 year ago

Compiling it makes it possible to run main manually, but the Nextcloud error that it cannot execute the Whisper executable remains

Where (which OS) did you compile? Where (which OS) are you running manually?

badmotorfinger commented 1 year ago

I'm running nextcloud from docker containers. There's over 7 containers running. How do I know which container to run this command in?

occ stt_whisper:download-models [model-name] ?

madmudklip commented 1 year ago

@marcelklehr apologies for not replying quickly, I was away for some time.

This install seems to have issues with AIO Nextcloud docker instance. Nextcloud AIO docker image runs the on Alpine Linux 3.18.3.

Installing from the app marketplace, the following behaviour is observed:

An error shows that the whisper executable is not found Trying to run main manually from within the container results in error "./main: cannot execute: required file not found" Downloading any of the models does not resolve the error.

Trying to compile manually results in a different issue.

To compile manually I did the following: Enter terminal in main container for Nextcloud - in my case

- sudo docker exec -it nextcloud-aio-nextcloud bash
- cd apps
- git clone https://github.com/nextcloud/stt_whisper
- cd stt_whisper
- git clone https://github.com/ggerganov/whisper.cpp
- apk add make which tar curl gcc g++ 
- Make /bin/main

This compiles successfully and running main manually works, but results in strange behaviour in Nextcloud. The admin page for Whisper is present but completely empty. Whisper shows as active in Artificial Intelligence admin page, but doesn't show up in Nextcloud assistant nor in any context menus, that being said I'm not clear where it will show up once working correctly.

marcelklehr commented 1 year ago

The admin page for Whisper is present but completely empty

Is there an error in the javascript console (can usually be opened in the browser with F12)?

doesn't show up in Nextcloud assistant nor in any context menus, that being said I'm not clear where it will show up once working correctly.

By default it will only show up in Nextcloud Talk for recording transcriptions. You can install https://github.com/nextcloud/stt_helper to get a smart picker that works with all speech to text providers, including stt_whisper (UPDATE:), once the app is ready -- it's in development.

madmudklip commented 1 year ago

Is there an error in the javascript console (can usually be opened in the browser with F12)?

Inspecting the page on loading reveals no js errors, or any errors at all for that matter.

By default it will only show up in Nextcloud Talk for recording transcriptions.

Checking talk I can't see this option, and making a call and starting a recording no transcribing option was available either unfortunately.

marcelklehr commented 1 year ago

Inspecting the page on loading reveals no js errors, or any errors at all for that matter.

Anything in the nextcloud server log?

Checking talk I can't see this option, and making a call and starting a recording no transcribing option was available either unfortunately.

Mh, for that you'll have to ask on the talk repo (it's called spreed here on github), I don't know the procedure to enable transcriptions.

SystemKeeper commented 1 year ago

Mh, for that you'll have to ask on the talk repo (it's called spreed here on github), I don't know the procedure to enable transcriptions.

Needs to be enabled through config https://nextcloud-talk.readthedocs.io/en/latest/settings/#app-configuration 🙂

marcelklehr commented 1 year ago

@SystemKeeper Nice, will add that to https://github.com/nextcloud/documentation/pull/11196

xplosionmind commented 1 year ago

Hi to you all! Thanks for the conversation, it is really informative. Still, I would not really want to risk and meddle with the Nextcloud files in my server. Therefore, I would like to ask you if you think there might be a fix to this issue by changing the code of this repository/extension. Otherwise, is the only possible solution to run things manually, as I believe most of you did?

For the record, I am using Nextcloud via YunoHost, based on Debian 11 for the moment. I am getting the same exact error @tcitworld gets.

gimlicloud commented 1 year ago

I am also getting this error, and I have tried every solution listed here with no progress.

kyteinsky commented 1 year ago

Hi, if you have this error, you can try the following steps:

  1. verify you have a file with path apps/stt_whisper/bin/main or apps/stt_whisper/bin/main-musl and it is executable
  2. try to run it manually like this: ./main audio_file.wav. Compile it and place the binary file inside bin/ if it does not work.
  3. make sure the webserver user can execute the main or main-musl file
  4. if it still does not work, report it here along with your machine's architecture and OS (uname -a and cat /etc/*-release). Also, don't forget to attach the Nextcloud logs

 

@madmudklip You need to compile the javascript files when using the git source.

npm ci && npm run build
szaimen commented 1 year ago

@marcelklehr is this app also not compatible with musl? Should we put this into the readme of the app?

kyteinsky commented 1 year ago

@szaimen It is and will be fixed in the next release. Compiling the whisper binary and ensuring correct permissions should work for now.

marcelklehr commented 6 months ago

This app is now deprecated in favor of https://github.com/nextcloud-releases/stt_whisper2 which is documented at https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html