Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHORE]: Openssl version prevents the creation of workspaces #898

Open
ennob opened this issue Mar 13, 2024 · 33 comments
Open

[CHORE]: Openssl version prevents the creation of workspaces #898

ennob opened this issue Mar 13, 2024 · 33 comments
Assignees
Labels

Comments

@ennob
Copy link

ennob commented Mar 13, 2024

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 ennob added the possible bug Bug was reported but is not confirmed or is unable to be replicated. label Mar 13, 2024
@timothycarambat timothycarambat added Desktop OS: Linux and removed possible bug Bug was reported but is not confirmed or is unable to be replicated. labels Mar 13, 2024
@timothycarambat
Copy link
Member

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
Copy link
Member

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

@ennob
Copy link
Author

ennob commented Mar 13, 2024

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.

@timothycarambat
Copy link
Member

@ennob Are you on an ARM machine?

@ennob
Copy link
Author

ennob commented Mar 13, 2024

No, x86_64 GNU/Linux (Ubuntu 23.10)

@timothycarambat
Copy link
Member

Sorry i just realized that was a dumb comment 😆

@AndKe
Copy link

AndKe commented Mar 20, 2024

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

@timothycarambat
Copy link
Member

timothycarambat commented Mar 20, 2024

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.

@ennob
Copy link
Author

ennob commented Mar 21, 2024

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

@timothycarambat
Copy link
Member

@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?

@Nindaleth
Copy link

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

@timothycarambat
Copy link
Member

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)

@AndKe
Copy link

AndKe commented Mar 21, 2024

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

@timothycarambat
Copy link
Member

timothycarambat commented Mar 21, 2024

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

@fengyunzaidushi
Copy link

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

@timothycarambat timothycarambat added the bug Something isn't working label Apr 19, 2024
@timothycarambat timothycarambat changed the title [BUG]: Openssl version prevents the creation of workspaces [CHORE]: Openssl version prevents the creation of workspaces Apr 19, 2024
@timothycarambat timothycarambat self-assigned this Apr 19, 2024
@Godot-Fye
Copy link

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

Same here, i switched back to 1.4.4.

@timothycarambat
Copy link
Member

timothycarambat commented Apr 20, 2024

@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

@Godot-Fye
Copy link

Godot-Fye commented Apr 20, 2024

@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

@timothycarambat
Copy link
Member

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

@Godot-Fye
Copy link

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

Where can i found the logs? :)

@timothycarambat
Copy link
Member

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

@zaro
Copy link

zaro commented Apr 24, 2024

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

@timothycarambat
Copy link
Member

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

@Godot-Fye
Copy link

Godot-Fye commented Apr 25, 2024

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.

@timothycarambat
Copy link
Member

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

@Godot-Fye
Copy link

@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 :)

@jaschadub
Copy link
Sponsor

I replicated the same issue on the S3 linked version.

@fengyunzaidushi
Copy link

@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 !

@nmcbride
Copy link

nmcbride commented May 10, 2024

Same in Fedora.

@timothycarambat I've seen in a few places that you only have ubuntu and do not have access to other distros to test...
Virtual machines and containers are free. You can easily spin up these other environments to test. You can also automate it here on Github or any other similar CI tool.

I get the following errors and cannot create a workspace. Which is frustrating because this project has so much potential.

Error: Schema engine exited. Error: Could not find schema-engine binary. Searched in:
- /tmp/.mount_AnythiTySjmU/resources/backend/node_modules/@prisma/engines/schema-engine-rhel-openssl-3.0.x
- /tmp/.mount_AnythiTySjmU/resources/backend/node_modules/prisma/schema-engine-rhel-openssl-3.0.x
- /tmp/.mount_AnythiTySjmU/resources/backend/node_modules/schema-engine-rhel-openssl-3.0.x
- /tmp/.mount_AnythiTySjmU/resources/backend/node_modules/prisma/runtime/schema-engine-rhel-openssl-3.0.x
Prisma schema loaded from prisma/schema.prisma
Error:
EROFS: read-only file system, unlink '/tmp/.mount_AnythiTySjmU/resources/backend/node_modules/.prisma/client/index.js'
Error: Invalid `prisma.workspaces.create()` invocation: Prisma Client could not locate the Query Engine for runtime 
"rhel-openssl-3.0.x". This happened because Prisma Client was generated for "debian-openssl-3.0.x", but the actual 
deployment required "rhel-openssl-3.0.x". Add "rhel-openssl-3.0.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-3.0.x"] } The following locations have been searched: 
/tmp/.mount_Anythi5LXScC/resources/backend/node_modules/.prisma/client 
/tmp/.mount_Anythi5LXScC/resources/backend/node_modules/@prisma/client 
/home/tim/Documents/anything-llm-desktop/anything-llm/server/node_modules/@prisma/client 
/tmp/prisma-engines /tmp/.mount_Anythi5LXScC/resources/backend/prisma

I also don't know that /home/tim should be a hard-coded search path.

@imbev
Copy link

imbev commented May 12, 2024

Also encountering this problem:

Error: Invalid `prisma.workspaces.create()` invocation: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". This happened because Prisma Client was generated for "debian-openssl-3.0.x", but the actual deployment required "rhel-openssl-3.0.x". Add "rhel-openssl-3.0.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-3.0.x"] } The following locations have been searched: /tmp/.mount_gearleAdjXS9/resources/backend/node_modules/.prisma/client /tmp/.mount_gearleAdjXS9/resources/backend/node_modules/@prisma/client /home/tim/Documents/anything-llm-desktop/anything-llm/server/node_modules/@prisma/client /tmp/prisma-engines /tmp/.mount_gearleAdjXS9/resources/backend/prisma

@craighay
Copy link

the temporary extract-and-rebuild workaround errors with 'Unexpected token': (SUSE Linux Enterprise Server 12 SP5)

squashfs-root/resources/backend/node_modules/prisma/build/index.js:867
if (typeof process !== "undefined" && typeof process.stderr?.write !== "function") {
^
SyntaxError: Unexpected token .
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

@nmcbride
Copy link

That's not a good workaround anyway imo.
If I wanted to go through all that I'd just run from source.

We just need a fixed build.

@studiosusmed
Copy link

@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 :)

I deleted the config from /home/username/.config/anythingllm, after that it worked normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

13 participants