Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Unraid #14

Open
osnapitsjoey opened this issue Mar 17, 2023 · 26 comments
Open

Unraid #14

osnapitsjoey opened this issue Mar 17, 2023 · 26 comments

Comments

@osnapitsjoey
Copy link

still not working on unraid. Even tried giving up special permissions. seems like It cant write to a file it cant make if that helps
find: /app/immich: No such file or directory Warning: For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'yarn add sharp', and Next.js will use it automatically for Image Optimization. Read more: https://nextjs.org/docs/messages/sharp-missing-in-production Failed to write image to cache DxXAfpAlrkPLCxzj0zfIeNmMpKSOb7I2M9eiXEvL5kw= [Error: EACCES: permission denied, mkdir '/app/ai-chat-app/.next/cache/images'] { errno: -13, code: 'EACCES', syscall: 'mkdir', path: '/app/ai-chat-app/.next/cache/images'

is what im getting with or without special perms

@hydazz
Copy link
Member

hydazz commented Mar 17, 2023

oopsie, update the container and lmk how it goes

@osnapitsjoey
Copy link
Author

osnapitsjoey commented Mar 17, 2023 via email

@hydazz
Copy link
Member

hydazz commented Mar 17, 2023

Sharp is not needed? Can you access the webui?

@osnapitsjoey
Copy link
Author

osnapitsjoey commented Mar 17, 2023 via email

@hydazz
Copy link
Member

hydazz commented Mar 17, 2023

you can try run npm install --prefix /app/ai-chat-app sharp in the container and restart it, but I don't believe this will fix this issue

(--prefix not -p)

@hydazz
Copy link
Member

hydazz commented Mar 26, 2023

any logs?

@McJoppy
Copy link

McJoppy commented Mar 27, 2023

There have been a couple of updates for Unraid recently which I installed - and that's when it broke for me.

The obvious thing which looks broken is

[next-auth][error][NO_SECRET] 
https://next-auth.js.org/errors#no_secret Please define a `secret` in production. MissingSecret [MissingSecretError]: Please define a `secret` in production.
    at assertConfig (/app/ai-chat-app/node_modules/next-auth/core/lib/assert.js:42:12)
    at AuthHandler (/app/ai-chat-app/node_modules/next-auth/core/index.js:70:52)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NextAuthHandler (/app/ai-chat-app/node_modules/next-auth/next/index.js:24:19)
    at async /app/ai-chat-app/node_modules/next-auth/next/index.js:60:32
    at async Object.apiResolver (/app/ai-chat-app/node_modules/next/dist/server/api-utils/node.js:372:9)
    at async NextNodeServer.runApi (/app/ai-chat-app/node_modules/next/dist/server/next-server.js:514:9)
    at async Object.fn (/app/ai-chat-app/node_modules/next/dist/server/next-server.js:828:35)
    at async Router.execute (/app/ai-chat-app/node_modules/next/dist/server/router.js:243:32)
    at async NextNodeServer.runImpl (/app/ai-chat-app/node_modules/next/dist/server/base-server.js:432:29) {
  code: 'NO_SECRET'
}

@McJoppy
Copy link

McJoppy commented Mar 27, 2023

If it helps, after upgrade the URI I end up at is /auth/error?error=Configuration

@osnapitsjoey
Copy link
Author

If it helps, after upgrade the URI I end up at is /auth/error?error=Configuration

did you delete the app in reinstall? or add NextURl variables yet?

ive done that to no avail, but it may help you. seems borked on unraid

@McJoppy
Copy link

McJoppy commented Mar 28, 2023

I have only used the Unraid update feature

@hydazz
Copy link
Member

hydazz commented Mar 28, 2023

@McJoppy you are missing some variables, delete the template and reinstall it from CA, or add them manually:
https://github.com/imagegenius/docker-ai-chat-app#variables

I have also added a check for variables... a1de736

@McJoppy
Copy link

McJoppy commented Mar 29, 2023

I've reinstalled and filled out the required vars however when trying to re-add the API key it doesn't seem to work:

prisma:error 
Invalid `prisma.setting.findMany()` invocation:


The column `main.Setting.userId` does not exist in the current database.

@hydazz
Copy link
Member

hydazz commented Mar 29, 2023

delete the appdata

@McJoppy
Copy link

McJoppy commented Mar 29, 2023

Sorry - I totally missed the var for NEXTAUTH_URL so had the (unaccessible) default.

Updated to IP address for my internal network and can confirm all is good now!

@osnapitsjoey
Copy link
Author

osnapitsjoey commented Mar 29, 2023 via email

@McJoppy
Copy link

McJoppy commented Mar 29, 2023

I did also uninstall, delete the appdata dir on the Unraid server before altering the variable.

It's working again for me - try

  • Uninstall the app
  • Delete eg. /mnt/cache/appdata/ai-chat-app or where ever the data is
  • Reinstall via app search for chatgpt
  • Double check vars :)

@osnapitsjoey
Copy link
Author

osnapitsjoey commented Mar 29, 2023 via email

@osnapitsjoey
Copy link
Author

I did also uninstall, delete the appdata dir on the Unraid server before altering the variable.

It's working again for me - try

  • Uninstall the app
  • Delete eg. /mnt/cache/appdata/ai-chat-app or where ever the data is
  • Reinstall via app search for chatgpt
  • Double check vars :)

are you ussing the 192.168 ip for your next_URL? ive done all this and stil have the issue

@hydazz
Copy link
Member

hydazz commented Mar 30, 2023

NEXTAUTH_URL should be set to http://<unraid_ip>:3000

@McJoppy
Copy link

McJoppy commented Mar 30, 2023

NEXTAUTH_URL seems to be a request sent from your browser and not the Chat AI system ie. if you are accessing the web service via some other URL, this should match that (browser redirects to this URL).

Eg. I use https://chat.some.domain.i.own/ which is reversed proxied via Nginx - so I've set this to https://chat.some.domain.i.own/

@hydazz
Copy link
Member

hydazz commented Mar 30, 2023

Have you tried deleting the database?

@hydazz
Copy link
Member

hydazz commented Mar 30, 2023

What database? I deleted the whole folder out of appdata with the console.

What's the output of printenv in the container?

@McJoppy
Copy link

McJoppy commented Mar 30, 2023

Once you uninstalled the app, did you remove the app data from the (most likely) cache drive?

On my Unraid system I deleted the folder /mnt/cache/appdata/ai-chat-app

@osnapitsjoey
Copy link
Author

osnapitsjoey commented Mar 30, 2023 via email

@McJoppy
Copy link

McJoppy commented Mar 30, 2023

I think it's valid to ask what vars have been configured - would be happy to share, to help someone developing a neat open source tool I'm interested in using (FYI the API key is configured via the web interface and not the ENV VARS).

I didn't need to set up anything new - just remove the old install (including deletion of appdata dir) then configure the 4 variables in the Unraid interface
image

@hydazz
Copy link
Member

hydazz commented Mar 30, 2023

Also, to be clear, when I say sketch, I mean the DEV is asking me to post my VARS here which include my private OpenAI API key, my login and password. I am not going to do that. And that should not be something that is asked of a user on a public forum.

It's not that deep mate, you could have copied and pasted the output of printenv, and simply removed any confidential information.

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

No branches or pull requests

3 participants