#Error after upgrading (Unable to login)
1 messages · Page 1 of 1 (latest)
the primary need to upgrade was that workflows stopped working on the older version I was using
I am not exactly sure of what exact version of twenty I was on previously, although it was surely above version 1.0.0
Hey @robust snow you need to incrementally upgrade your twenty instance across minor versions so it can proceed to execute each upgrade and migrations required by each version
You can check your previous version by looking at your workspace version in database located in core.workspace.version
what query shall I run
and I believe my portainer messed up so it got upgraded to the latest at once which must have caused the problem
is it fixable though?
if yes, then how
You should restore the backup you have to its version
And proceed to upgrade incrementally
To the latest version
so I can create a new instance with the version in my db then?
Double checking that your workspace version got updated to the just installed version is always a plus
I'm not sure to understand the question
To fix your issue you need to determine what version is coming from your backup
the original docker stack is messed up as of now, should I reinstall that stack with the same version as my db or create a new stack
how do I check that?
restore this backup from this twenty version
looking to your workspace version located at schema core table workspace column version
can u give me a query, I am not too sure if I understand
SELECT version FROM core.workspace
Or using docker exec for example
docker exec -e PGPASSWORD="${PG_DATABASE_PASSWORD}" "${CONTAINER_NAME}" \
psql -h localhost -U "${PG_DATABASE_USER}" -d "${PG_DATABASE_NAME}" -t -c \
"SELECT version FROM core.workspace LIMIT 1;" | xargs)
Assuming you only have one workspace
Or if you have any access to a db GUI explorer following path i've shared
can I get this from the backup file?
also seems like a syntax error in the query, I am not really used to postgresql
seems like I am still on 0.55.8
Then you will need to restore this backup in a 0.55.8 twenty version and proceed to incremental upgrade to next minor version
Cannot read properties of undefined (reading 'reduce') error while logging in on v0.55.8
this was the output when I tried to query
WARNING: database "default" has a collation version mismatch
DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.41.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE "default" REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
0.55.8
I tried multiple versions from 1.0.0 to 1.5.0, none of them seems to work, 0.55.8 also seems not to work, error says Cannot read properties of undefined (reading 'reduce')
are you still using a twenty postgres pg spilo database image ?
this is my docker compose file
db:
image: postgres:16
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${PG_DATABASE_USER:-postgres}
POSTGRES_PASSWORD: ${PG_DATABASE_PASSWORD:-postgres}
healthcheck:
test: pg_isready -U ${PG_DATABASE_USER:-postgres} -h localhost -d postgres
interval: 5s
timeout: 5s
retries: 10
restart: always
Please help
Your db instance seems to be the correct one
I would like more context please
please let me know what else is needed
currently v0.55.8 gives me the error - Cannot read properties of undefined (reading 'reduce')
v1.1.0 was working but certain elements like workflows were broken
when I upgraded, it went straight to v1.5.0 and broke everything
luckily I backed up the db with the command
I am unable to get this working on the version 0.55.8 and 1.0.0 and above
You twenty instance might have got corrupted by upgrading from 0.55.8 to 1.5.0
I would recommend restoring a backup of a clean 0.55.8 instance
let me try that once
And proceed to upgrade incrementally
Workspace not found on new instance of v0.55.8
and multi workspace is disabled
While restoring a backup of 0.55.8 ?
One that has not been attempted to get migrated to 1.5.0
could you please clear your cache
yarn command:prod cache:flush
this needs to be run in the server container right?
Yes
let me try
Workspace not found same error
do I need to restart the container after the flush?
I made this backup on v1.x.x
which was somehow upgraded from v0.55.8
I do have a backup from before that, but it might not have some changes init
let me try with that one, if it works, it works
¯_(ツ)_/¯
nope
I'm not sure to understand
It's not a 0.55.8 dump then
yes
Please restore a backup of the version of twenty you try to run
I had installed v0.55.8 initially, but when I was upgrading it wrongly got upgraded to v1.x.x directly, it somehow worked, but now I am unaware of the version that was v1.x.x
and cant find it in the db also
v1.x.x was working somewhat fine, but then I again made the mistake to upgrade to v1.5.0 directly without sequential upgrades
the workspace ?
or the workspace version
the version that is v1.x.x
version
I'm not sure to undestand, you can't find it because it's 0.55.8 or because there's nothing ?
it says 0.55.8 but it was not 0.55.8
and the one which was actually on v0.55.8 says that You're not member of this workspace.
can we vc if you are available?
i feel i fked up the upgrade
and now think my db is fked
Please help bro
with the query u sent me it shows 0.55.8, but I was not using 0.55.8 while I backed this version up, 0.55.8 was the version I initially installed
Hi
@mossy turret let me know when you are available, my crm is dead, please help ☹️
Hey there, please try restoring a backup that has not been corrupted in the correspoding twenty version
Then proceed to incremental upgrade
sure
hey, even with the best backup, it says that You're not member of this workspace.
I had that backup on v0.55.8
Are you sure you haven't changed your credentials since then ?
Could you please try creating a new workpsace member
how do I do that?
User does not have access to this workspace
this happens when I try to signup
even if I try to change the pass on my previous account, it says You're not member of this workspace.
maybe I can show it to u better on a vc stream on discord
Hi
@mossy turret bro really sorry to bother you, nothing seems to work, please help me with the suitable solution 🙁
Hey all good have you tried clearing your cache using yarn command:prod cache:flush ?
yes
Honestly I'm not sure understand where your workspace is at exactly
Could you please share the exact process you're following in order to restore your backup on the previous version
Do you correctly restart all your containers etc
echo $APP_VERSION in twenty-server will show what curent twenty version is running
should I try to restart again?
yea, it is not working
not letting me log in
I am sure I havent changed the username or the password
Please run echo $APP_VERSION is the twenty-server container
To double check it's in the expected version
After changing the tag you indeed need to restart your instance
this is a new instance, which I started on v0.55.8 and then restored the backup on
but this is what portainer shows
and this is what I see when I print all env vars
So it seems like your workspace has correctly been restarted on the good version
Adding a new workpsace member either using the invite link or classic password email is not working either ?
I dont know how to do that
and I cant log in from my admin account
Please find your invite hash in your database at core.workspace.inviteHash
https://your_twenty.com/invite/YOUR_HASH
and try creating a new workspace member this way
ERROR: column "invitehash" does not exist LINE 1: SELECT inviteHash FROM core.workspace LIMIT 1;
public invite link is disabled
Please toggle core.workspace.isPublicInviteLinkEnabled to true
Entity "apiKey" does not have a primary column. Primary column is required to have in all your entities. Use @PrimaryColumn decorator to add a primary column to your entity. on the crm page
Would need more context
Were the workspace member creation + logging successful in the first place ?
I had only 1 user initially, that was the admin, I didn't try adding any other users, but my main admin account was working originally...
Which means you just got this new error out of the blue ?
yes...
What about the process we were on creating a new user through the invite hash
this error
uhm, I have 3 backups, all 3 of them seem broken then
on server right?
yes
do I need a restart?
Normally no, but just do by default at this point
should I try to login or try to create a new user
anyway none of it works 😟
Do you still have a live production available ?
Exporting everything as csv and re-importing in fresh new install
Seems to be the solution here
Depending on the complexity of your twenty instance
see
- I made a new instance of v0.55.8
- Restored my backup
- Tried logging in, but unable to login
- Ran
yarn command:prod cache:flush - Tried loggin in, but unable to login
- Checked app version, which was as expected
- Tried using hash to create new user.
- Got
Entity "apiKey" does not have a primary column. Primary column is required to have in all your entities. Use @PrimaryColumn decorator to add a primary column to your entity. on the crm page - We are here now
no 💀
had many complex fields too and workflows also
Please try restoring your bakcup on the exact version you were
I assume it wasn't 0.55.8
I think you will be able to access your instance on uper version
the db says 0.55.8 but it was something like 1.x.x
I am not exactly sure of that 1.x.x version
If you have any versioning of your .env
i got it from the twenty github as an example, it used latest
and thats where everything got messed up
Ok I see we should definitly remove this dockerhub privisioning
I tried all major releases v1.0.0, v1.1.0, v1.2.0, v1.3.0, v1.4.0, v1.5.0
😢
and on restarts also, it auto upgraded
that is what fished up
do you believe it is possible to restore my crm...?
Yes for sure, in the worst case scenario we still have the data in the dump
Would you consider sharing a dump of your instance ?
uhm, sure, it doesnt contain any secrets right?
Credentials secrets no, private data such as emails or inserted data yes
We can plan a vc
sure lmk
We can have a call tomorrow 10:15am CEST timezone ?
works
Cool ! see you tomorrow
CEST
alright
Hey @robust snow I'm sorry but I'll have to postone our call to 25 sep 3pm CEST if it's also ok for you
alright
Hi, just a reminder...
Hey will be there on 3pm today CEST
alright
in #1147463229086380145
@mossy turret sup bro 👋 found something?
Hey @robust snow, unfortunately nothing new on your issue I would recommend as discussed together to manually export your few workflows and data model in a fresh new twenty instance
alright, also whats the ETA for the next update, so I will plan to start with the new update...
Next version should be published on dockerHub by next Friday
Just for posterity reindec database use
psql -d "postgres" -U "postgres"
ALTER DATABASE postgres REFRESH COLLATION VERSION;
REINDEX DATABASE;
\c template1
ALTER DATABASE template1 REFRESH COLLATION VERSION;
REINDEX DATABASE;
\c default
ALTER DATABASE "default" REFRESH COLLATION VERSION;
REINDEX DATABASE;