user.firstName[0] + user.lastName[0]).toUpperCase is not a function

Got this as soon as i clicked "Login with OAuth"
(user.firstName[0] + user.lastName[0]).toUpperCase is not a function - 500
TypeError: (user.firstName[0] + user.lastName[0]).toUpperCase is not a function
at file:///usr/src/app/build/server/chunks/user-avatar-a532b375.js:98:72
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/user-page-layout-8adf66ef.js:325:79
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/user-page-layout-8adf66ef.js:799:90
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/_page.svelte-52ed759c.js:56:68
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at Object.default (file:///usr/src/app/build/server/index.js:89:97)
at file:///usr/src/app/build/server/chunks/_layout.svelte-2cf582b6.js:579:32
(user.firstName[0] + user.lastName[0]).toUpperCase is not a function - 500
TypeError: (user.firstName[0] + user.lastName[0]).toUpperCase is not a function
at file:///usr/src/app/build/server/chunks/user-avatar-a532b375.js:98:72
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/user-page-layout-8adf66ef.js:325:79
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/user-page-layout-8adf66ef.js:799:90
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/_page.svelte-52ed759c.js:56:68
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at Object.default (file:///usr/src/app/build/server/index.js:89:97)
at file:///usr/src/app/build/server/chunks/_layout.svelte-2cf582b6.js:579:32
No description
52 Replies
Mr.Green Cake
Mr.Green CakeOP•2y ago
And now i'm unable to log into the account. Even after Immich restart it keeps the same thing
bo0tzz
bo0tzz•2y ago
Seems like a bug. Does your user in oauth have a first and last name set?
Mr.Green Cake
Mr.Green CakeOP•2y ago
nope
bo0tzz
bo0tzz•2y ago
If not, I think setting those should let you log in for now.
Mr.Green Cake
Mr.Green CakeOP•2y ago
just username, email and password
bo0tzz
bo0tzz•2y ago
Can you create a github issue for this as well?
Mr.Green Cake
Mr.Green CakeOP•2y ago
sure, i'm just going to try edit the user in Keycloak and will let you know nope, same issue i restarted immich and still the same error even if i set the first and last name
bo0tzz
bo0tzz•2y ago
Hmm, very weird I can't figure out any scenario where it would be possible to get this error What version of Immich are you on? @jrasm91 @Alex any idea? I figured this was just firstName or lastName being null, but they're notnull in the db so that shouldn't be possible. I've also tried setting them to an empty string but that doesn't crash either (the avatar just says 'undefined')
Mr.Green Cake
Mr.Green CakeOP•2y ago
1.60.0 currently latest yesterday i were deploying the immich
bo0tzz
bo0tzz•2y ago
Can you maybe try with a new user with the name set? Maybe it only happens on first login 🤔
Mr.Green Cake
Mr.Green CakeOP•2y ago
I don't think i can get rid of that error on Immich end. After restarting the Immich and pressing F5 or targeting the base url (immich.local.dashrave.eu in my case) it automatically throw this error without even giving me the login screen. Thankfully i didn't have any photos uploaded yet because i was aware someting like this can happen
bo0tzz
bo0tzz•2y ago
Clearing your cookies should fix that I think
Mr.Green Cake
Mr.Green CakeOP•2y ago
I just tried the other browser and i was able to get to login screen. As i filled up the First and Last name, saved the changes, i tried logging in again but same behavior. On first just infinite Immich login bar and after F5-ing the site i get the same error
(user.firstName[0] + user.lastName[0]).toUpperCase is not a function - 500
TypeError: (user.firstName[0] + user.lastName[0]).toUpperCase is not a function
at file:///usr/src/app/build/server/chunks/user-avatar-a532b375.js:98:72
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/user-page-layout-8adf66ef.js:325:79
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/user-page-layout-8adf66ef.js:799:90
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/_page.svelte-52ed759c.js:56:68
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at Object.default (file:///usr/src/app/build/server/index.js:89:97)
at file:///usr/src/app/build/server/chunks/_layout.svelte-2cf582b6.js:579:32
(user.firstName[0] + user.lastName[0]).toUpperCase is not a function - 500
TypeError: (user.firstName[0] + user.lastName[0]).toUpperCase is not a function
at file:///usr/src/app/build/server/chunks/user-avatar-a532b375.js:98:72
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/user-page-layout-8adf66ef.js:325:79
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/user-page-layout-8adf66ef.js:799:90
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at file:///usr/src/app/build/server/chunks/_page.svelte-52ed759c.js:56:68
at Object.$$render (file:///usr/src/app/build/server/chunks/index3-d03b89d1.js:270:18)
at Object.default (file:///usr/src/app/build/server/index.js:89:97)
at file:///usr/src/app/build/server/chunks/_layout.svelte-2cf582b6.js:579:32
No description
jrasm91
jrasm91•2y ago
Can you access the database?
Mr.Green Cake
Mr.Green CakeOP•2y ago
this is the Keycloak UI
No description
Mr.Green Cake
Mr.Green CakeOP•2y ago
i surely can
jrasm91
jrasm91•2y ago
Or do a curl request to update the user? You need to change the user first and last name in immich It only copies the name from keycloak the first time you sign in
Mr.Green Cake
Mr.Green CakeOP•2y ago
Ah, right. Do i need something like PHPMyAdmin to access the database?
bo0tzz
bo0tzz•2y ago
If you're comfortable with just a cli, you can use psql
Mr.Green Cake
Mr.Green CakeOP•2y ago
I'm pretty okay with CLI It is the postgresql-client-common package (Ubuntu)?
jrasm91
jrasm91•2y ago
You can connect to the docker database container and run it there without installing anything else.
Mr.Green Cake
Mr.Green CakeOP•2y ago
amazing
jrasm91
jrasm91•2y ago
Do you know the command @bo0tzz , I'm not great at the psql command line
Mr.Green Cake
Mr.Green CakeOP•2y ago
Well that's weird
No description
bo0tzz
bo0tzz•2y ago
You need to pass the user you set psql -U foo
Mr.Green Cake
Mr.Green CakeOP•2y ago
ah, i see the flags now
bo0tzz
bo0tzz•2y ago
Then \c immich (or whatever database name you used) Then select * from users should list the users table Copy the UUID of your user, then update users set "firstName"='foo', "lastName"='bar' where "id"='<uuid>' (hope I got that sql right 👀 )
Mr.Green Cake
Mr.Green CakeOP•2y ago
i grab the UUID from Keycloak right?
bo0tzz
bo0tzz•2y ago
No, from the select command
Mr.Green Cake
Mr.Green CakeOP•2y ago
uhm. It didn't skow anyhting
bo0tzz
bo0tzz•2y ago
select * from users had no output?
Mr.Green Cake
Mr.Green CakeOP•2y ago
not the first time. I'm going to try second time
bo0tzz
bo0tzz•2y ago
Oops, probably forgot the semicolon select * from users;
Mr.Green Cake
Mr.Green CakeOP•2y ago
yup, now it has output
bo0tzz
bo0tzz•2y ago
The update will also need a semicolon that I didn't put
Mr.Green Cake
Mr.Green CakeOP•2y ago
done
No description
Mr.Green Cake
Mr.Green CakeOP•2y ago
welllll......i think the bug is somewhere esle
No description
Mr.Green Cake
Mr.Green CakeOP•2y ago
or maybe i entered wrong ID because in portainer UI the the commandline is pretty bugged as you can see ah, those semicolons hooray! It worked
bo0tzz
bo0tzz•2y ago
🎉
Mr.Green Cake
Mr.Green CakeOP•2y ago
Should i add the steps to fix it on Github issue as well? (if someone run into same issue)
bo0tzz
bo0tzz•2y ago
Can't hurt, though it's a bit of a corner case and shouldn't be too hard to fix soon Up to you :)
Mr.Green Cake
Mr.Green CakeOP•2y ago
alright. I will add it as additional info. Btw, as i were deploying the immich, the admin user were created automatically. But i would like to apply OAuth to it as well as the admin account would be my main account on Immich. Is there a way how to "copy" the user to Keycloak so i can use OAuth for it as well?
bo0tzz
bo0tzz•2y ago
If you have a user in keycloak with the same email as the admin user, and then log in with that, I think it should link them. Or I believe in the account management settings in immich there should be an oauth link option as well
Mr.Green Cake
Mr.Green CakeOP•2y ago
i'm going to try! PS: clearing cookies / cache fixed the issue not being able to display the login screen. Yup, it seems like it linked those two accounts. Just last question. What is better way to run Immich. Detach admin account off your accout that you'll be using for photos upload and usage or keep them as one account?
bo0tzz
bo0tzz•2y ago
I have them as one
Mr.Green Cake
Mr.Green CakeOP•2y ago
in edge case, i can always access the database like i did now and add the storage label "admin" so i will have admin rights?
bo0tzz
bo0tzz•2y ago
Yeah
Mr.Green Cake
Mr.Green CakeOP•2y ago
epic! Love Immich and i'm really grateful to you guys that makes Immich better and better every day. One big thank you. I will tip as soon as my family joins the Immich! For now, i'm closing this topic.
jrasm91
jrasm91•2y ago
This is a bug i would say btw
bo0tzz
bo0tzz•2y ago
There's a gh issue for it now
Mr.Green Cake
Mr.Green CakeOP•2y ago
GitHub
[BUG] First and Last name must be set on setup with OAuth · Issue #...
The bug Hello. So i've set up immich on docker with additional custom proxy on top of immich's proxy and with OAuth service (Keycloak). I made a user in Keycloak but didn't specify the ...
jrasm91
jrasm91•2y ago
Ty

Did you find this page helpful?