anything-llm icon indicating copy to clipboard operation
anything-llm copied to clipboard

[CHORE]: Openssl version prevents the creation of workspaces

Open ennob opened this issue 3 months ago • 37 comments

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

I am using the AppImage for Linux. When attempting to create a new workspace I get the following error:

Error: Invalid `prisma.workspaces.create()` invocation: Prisma Client could not locate the Query Engine for runtime "debian-openssl-1.1.x".

This happened because Prisma Client was generated for "debian-openssl-3.0.x", but the actual deployment required "debian-openssl-1.1.x".

Add "debian-openssl-1.1.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it: generator client { provider = "prisma-client-js" binaryTargets = ["native", "debian-openssl-1.1.x"] }

The following locations have been searched: /tmp/.mount_AnythiEIHOMn/resources/backend/node_modules/.prisma/client /tmp/.mount_AnythiEIHOMn/resources/backend/node_modules/@prisma/client /home/tim/Documents/anything-llm-desktop/anything-llm/server/node_modules/@prisma/client /tmp/prisma-engines /tmp/.mount_AnythiEIHOMn/resources/backend/prisma

It seems to be a problem with the openssl version, but it must be the version included in the appimage because my system is running openssl 3.0.10 (on Ubuntu)

> openssl version
OpenSSL 3.0.10 1 Aug 2023 (Library: OpenSSL 3.0.10 1 Aug 2023)

Maybe both versions could be supported for maximum flexibility?

Are there known steps to reproduce?

  1. Run appimage desktop application
  2. Select ollama running on localhost
  3. Use default embedding and database
  4. Create workspace <-- this fails

To get a more verbose error message

  1. Restart the application which sends you directly to the main interface (on-boarding has already been completed).
  2. Create workspace <- This will fail again but with a more verbose error message.

ennob avatar Mar 13 '24 10:03 ennob

This is because we compile the AppImage on Ubuntu 22 and you must be on another version. This was resolved in a discord thead via manual recomp :/. Gonna leave this open as basically, we need to see if Prisma can generate the client at runtime so the correct openssl is used.

https://discord.com/channels/1114740394715004990/1194390131247943690/1215776724243976222

Solution: https://discord.com/channels/1114740394715004990/1194390131247943690/1215964957099819049

timothycarambat avatar Mar 13 '24 16:03 timothycarambat

TLDR:

  • cd to where ur AnythingLLMDesktop.AppImage is
  • run ./AnythingLLMDesktop.AppImage --appimage-extract
  • cd squashfs-root/resources/backend/
  • node node_modules/prisma generate (will need node installed)
  • cd ../../
  • ./AppRun

this is temporary

timothycarambat avatar Mar 13 '24 16:03 timothycarambat

Thanks, that works for me. I rebuilt the appimage with env ARCH=x86_64 ./appimagetool-x86_64.AppImage ./squashfs-root AnythingLLMDesktop-modified.AppImage just for convenience.

ennob avatar Mar 13 '24 17:03 ennob

@ennob Are you on an ARM machine?

timothycarambat avatar Mar 13 '24 18:03 timothycarambat

No, x86_64 GNU/Linux (Ubuntu 23.10)

ennob avatar Mar 13 '24 21:03 ennob

Sorry i just realized that was a dumb comment 😆

timothycarambat avatar Mar 13 '24 23:03 timothycarambat

Exactly same issue here, (Also Ubuntu 23.10) - what are the chances of a fix & new release soon? Thank you

AndKe avatar Mar 20 '24 19:03 AndKe

I am unable to replicate this issue on a totally fresh install of Ubuntu 22.0 LTS that the appimage was not built on.

If you are running into this issue - can you attempt to run this version (1.4.1) that basically pins the ENVs PRISMA_SCHEMA_ENGINE_BINARY & PRISMA_QUERY_ENGINE_LIBRARY to the local binaries bundled in the app instead of assuming the system.

https://s3.us-west-1.amazonaws.com/public.useanything.com/support/linux-prisma-patch/AnythingLLMDesktop.AppImage

Please run via CLI chmod a+x ./AnythingLLMDesktop.AppImage and ./AnythingLLMDesktop.AppImage so you can tail the logs during boot.

timothycarambat avatar Mar 20 '24 21:03 timothycarambat

@timothycarambat v1.4.1 works for me without any modification. v1.4.0 (from https://useanything.com/download) does not.

ennob avatar Mar 21 '24 18:03 ennob

@ennob Thank you for trying that out! Will wait for a couple more confirmations before merging but so far looks like. What OS are you on?

timothycarambat avatar Mar 21 '24 19:03 timothycarambat

I can confirm that the v1.4.1 prerelease linked above works out of the box. I'm on Fedora 39.

Nindaleth avatar Mar 21 '24 21:03 Nindaleth

Alright, gonna ship this then in the next patch. If this issue closes, the patch is released.

(if you are coming to this thread and it is open - please still test and confirm)

timothycarambat avatar Mar 21 '24 21:03 timothycarambat

@timothycarambat 1.4.1 works for mee too (ubuntu 23.10) - thank you.

AndKe avatar Mar 21 '24 22:03 AndKe

New release is available on https://useanything.com/download and includes this patch + new custom folder management. You can download and use that image now with no issue

timothycarambat avatar Mar 21 '24 23:03 timothycarambat

i have download the latest version,why i still have the problem: image

fengyunzaidushi avatar Apr 19 '24 04:04 fengyunzaidushi

i have download the latest version,why i still have the problem: image

Same here, i switched back to 1.4.4.

Godot-Fye avatar Apr 19 '24 08:04 Godot-Fye

@fengyunzaidushi | @Godot-Fye Since you have this issue and I don't have access to an environment to replicate I created a rebuild of v1.5.0 but with some changes to the build process for the AppImage to include the required prisma engine since the /tmp directory AppImages mount to is not writable (so the engine cannot download on the fly).

Can you test this for me? If it works for you it will work for everyone. Can confirm it works on Ubuntu 22LTS https://s3.us-west-1.amazonaws.com/public.useanything.com/staging/AnythingLLMDesktop.AppImage

timothycarambat avatar Apr 20 '24 00:04 timothycarambat

@fengyunzaidushi | @Godot-Fye Since you have this issue and I don't have access to an environment to replicate I created a rebuild of v1.5.0 but with some changes to the build process for the AppImage to include the required prisma engine since the /tmp directory AppImages mount to is not writable (so the engine cannot download on the fly).

Can you test this for me? If it works for you it will work for everyone. Can confirm it works on Ubuntu 22LTS https://s3.us-west-1.amazonaws.com/public.useanything.com/staging/AnythingLLMDesktop.AppImage

I have run the Version, but it "stops" on this screen (Version 1.4.4 loads fine):

anythingllm_stops

It seems that it can't load my existent Worskpace. No Error Messages appear. Any log i can post to help you?

System: Manjaro KDE, Kernel 6.6.26-1-MANJARO

Godot-Fye avatar Apr 20 '24 10:04 Godot-Fye

When it mounts there is no logs at all from the app image?

timothycarambat avatar Apr 20 '24 19:04 timothycarambat

When it mounts there is no logs at all from the app image?

Where can i found the logs? :)

Godot-Fye avatar Apr 22 '24 15:04 Godot-Fye

When you run ./AnythingLLMDesktop.AppImage the terminal window you are booting from will dump logs into that pane. How are you running the AppImage?

timothycarambat avatar Apr 22 '24 19:04 timothycarambat

Happens to me also with Fedora 40 and 1.5.0 :

Error: Invalid `prisma.workspaces.create()` invocation: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-1.1.x". This happened because Prisma Client was generated for "debian-openssl-3.0.x", but the actual deployment required "rhel-openssl-1.1.x". Add "rhel-openssl-1.1.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it: generator client { provider = "prisma-client-js" binaryTargets = ["native", "rhel-openssl-1.1.x"] } The following locations have been searched: /tmp/.mount_AnythiAhwFTZ/resources/backend/node_modules/.prisma/client /tmp/.mount_AnythiAhwFTZ/resources/backend/node_modules/@prisma/client /home/tim/Documents/anything-llm-desktop/anything-llm/server/node_modules/@prisma/client /tmp/prisma-engines /tmp/.mount_AnythiAhwFTZ/resources/backend/prisma

zaro avatar Apr 24 '24 18:04 zaro

That new staging AppImage only includes the openssl- engines. Not rhel however seems like ill have to add all of them now

timothycarambat avatar Apr 24 '24 20:04 timothycarambat

When you run ./AnythingLLMDesktop.AppImage the terminal window you are booting from will dump logs into that pane. How are you running the AppImage?

I just start the Image over the KDE Menu, it asks me if i wish to run it one time or integrate it in my system. If is start the Appimage on Console, this is the Log Output:

Updating location Prisma binaries for linux builds.
libva error: vaGetDriverNames() failed with unknown libva error
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "anythingllm.db" at "file:/home/fye/.config/anythingllm-desktop/storage/anythingllm.db"

Already in sync, no schema change or pending migration was found.

EROFS: read-only file system, unlink '/tmp/.mount_AnythiNlbwGX/resources/backend/node_modules/.prisma/client/index.js'


Prisma schema loaded from prisma/schema.prisma
Error: 
EROFS: read-only file system, unlink '/tmp/.mount_AnythiNlbwGX/resources/backend/node_modules/.prisma/client/index.js'


[OllamaProcessManager] Ollama will bind on port 11434 when booted.

Godot-Fye avatar Apr 25 '24 15:04 Godot-Fye

@Godot-Fye but the app never loads? Looks like the DB loaded and was migrated.

timothycarambat avatar Apr 25 '24 16:04 timothycarambat

@Godot-Fye but the app never loads? Looks like the DB loaded and was migrated.

1.4.4 loads perfect, 1.5.0 does not. 1.5.0 "hangs" on the screen i postet :)

Godot-Fye avatar Apr 25 '24 17:04 Godot-Fye

I replicated the same issue on the S3 linked version.

jaschadub avatar Apr 25 '24 19:04 jaschadub

@timothycarambat i have download the v1.5.1 it still the same problem:

image

The following locations have been searched:
  /tmp/.mount_Anythiz5DB7b/resources/backend/node_modules/.prisma/client
  /tmp/.mount_Anythiz5DB7b/resources/backend/node_modules/@prisma/client
  /home/tim/Documents/anything-llm-desktop/anything-llm/server/node_modules/@prisma/client
  /tmp/prisma-engines
  /tmp/.mount_Anythiz5DB7b/resources/backend/prisma
prisma:error 
Invalid `prisma.system_settings.findFirst()` invocation:


Prisma Client could not locate the Query Engine for runtime "debian-openssl-1.1.x".

This happened because Prisma Client was generated for "debian-openssl-3.0.x", but the actual deployment required "debian-openssl-1.1.x".
Add "debian-openssl-1.1.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "debian-openssl-1.1.x"]
}

The following locations have been searched:
  /tmp/.mount_Anythiz5DB7b/resources/backend/node_modules/.prisma/client
  /tmp/.mount_Anythiz5DB7b/resources/backend/node_modules/@prisma/client
  /home/tim/Documents/anything-llm-desktop/anything-llm/server/node_modules/@prisma/client
  /tmp/prisma-engines
  /tmp/.mount_Anythiz5DB7b/resources/backend/prisma
prisma:error 
Invalid `prisma.system_settings.upsert()` invocation:


Prisma Client could not locate the Query Engine for runtime "debian-openssl-1.1.x".

This happened because Prisma Client was generated for "debian-openssl-3.0.x", but the actual deployment required "debian-openssl-1.1.x".
Add "debian-openssl-1.1.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "debian-openssl-1.1.x"]
}

The following locations have been searched:
  /tmp/.mount_Anythiz5DB7b/resources/backend/node_modules/.prisma/client
  /tmp/.mount_Anythiz5DB7b/resources/backend/node_modules/@prisma/client
  /home/tim/Documents/anything-llm-desktop/anything-llm/server/node_modules/@prisma/client
  /tmp/prisma-engines
  /tmp/.mount_Anythiz5DB7b/resources/backend/prisma
[TELEMETRY SENT] {
  event: 'workspace_created',
  distinctId: '85784926-7ce5-408a-bad9-4ce328fc82a2',
  properties: {
    multiUserMode: false,
    LLMSelection: 'localai',
    VectorDbSelection: 'lancedb',
    runtime: 'desktop'
  }
}
prisma:error 
Invalid `prisma.event_logs.create()` invocation:


Prisma Client could not locate the Query Engine for runtime "debian-openssl-1.1.x".

This happened because Prisma Client was generated for "debian-openssl-3.0.x", but the actual deployment required "debian-openssl-1.1.x".
Add "debian-openssl-1.1.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "debian-openssl-1.1.x"]
}

The following locations have been searched:
  /tmp/.mount_Anythiz5DB7b/resources/backend/node_modules/.prisma/client
  /tmp/.mount_Anythiz5DB7b/resources/backend/node_modules/@prisma/client
  /home/tim/Documents/anything-llm-desktop/anything-llm/server/node_modules/@prisma/client
  /tmp/prisma-engines
  /tmp/.mount_Anythiz5DB7b/resources/backend/prisma

thank you !

fengyunzaidushi avatar Apr 28 '24 01:04 fengyunzaidushi