Outline | Dex Authentication Not Working

The “support” category is meant to ask for help or troubleshooting related to installing or using YunoHost or its applications. It is not to ask assistance on general system administration, network administration or special use cases that goes beyond the scope of the project. If you wish to discuss more advanced use case, please post in the “Advanced Use Case” category.

Before posting, please :

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.0.7 (testing)
I have access to my server : Through SSH & through the webadmin

Description of my issue

I cannot log in to my Outline instance anymore. Dex’s logs look like this:

time="2022-06-16T08:54:15Z" level=info msg="keys expired, rotating"
time="2022-06-16T08:54:15Z" level=error msg="failed to rotate keys: update: attempt to write a readonly database"

And I see this when trying to log in:
image

What can I do to fix this?

Hi :wave:
Could you please describe a bit more ?
Did it work before ?
Did you upgrade Yunohost or Outline or Dex before it broke ? I have shipped a new dex version recently
When do you get that screen ? Is that when you click on the “login with Yunohost” button on outline ?
Is Dex service running ?

And could you please check the ownership and authorizations of the /opt/yunohost/dex/dex.db file ?

Did it work before ?

Yes, it did, but I don’t remember it breaking because

Did you upgrade Yunohost or Outline or Dex before it broke ? I have shipped a new dex version recently

I think I did, yes.

When do you get that screen ? Is that when you click on the “login with Yunohost” button on outline ?
Is Dex service running ?

The service is running, and the error comes when clicking on the login button inside Outline. Also happens when directly giving my E-Mail.

Thanks for helping me out!

This is the output when running ls -al on the file. The blanked out user space is my username.

Ok thanks for your reply.
I believe it shouldn’t be your username, but dex user. Let me check on a fully working instance

Could you please try : sudo chown dex:dex dex.db command in /opt/yunohost/dex directory ?
And then sudo yunohost service restart dex

Now, dex just doesn’t start up. Seems like the same messages are in the logs.
Sorry for the small delay.

Can you please share more complete logs from Dex service ?

Ohh I have found this interesting topic here :

There is that mention :

Lastly, another FAQ says: “Make sure that the directory containing the database file is also writable to the user executing the CGI script.” I think this is because the engine needs to create more files in the directory.

So could you please send me the result of :
ls -ld /opt/yunohost/dex/

It should be looking like : drwxr-x--- 14 dex www-data 4096 Jun 21 05:25 /opt/yunohost/dex/

Yup, that doesn’t match up.
The output is following: drwxr-x--- 14 <username> www-data 4096 Jun 6 14:42 /opt/yunohost/dex/
<username> is my user, and not dex. What should I do to change that?

Could you please try sudo chown -R dex:www-data /opt/yunohost/dex ?
I hope this will definitely solve your issue.
To be honest I have no idea how that directory could change owner…
Did you do anything special with your Yunohost ?

2 Likes

I’m pretty sure it will solve your issue. I was able to reproduce your bug by changing the directory owner

The next step will be to understand how Dex package did manage to get in that state to avoid anybody else to have the same troubles… Unless you tell me it’s maybe a non standard thing you did on your server

The solution you provided me worked flawlessly, just marked this topic as resolved.
Though I do not know what I must’ve done to do that. It has been a long while since I’ve had to log in, so I don’t know. It must’ve been me fiddling around sometime because I do remember exploring how the database looked like.
Thanks a lot for your help!

You’re welcome !
And welcome to the Yunohost community by the way. Have you discovered Yunohost thanks to Outline discussions on GitHub ?

Thanks for your return, I’m glad your instance is repaired.
So I’ll assume this won’t happen again for other dex / outline users.

1 Like

And welcome to the Yunohost community by the way. Have you discovered Yunohost thanks to Outline discussions on GitHub ?

I got it recommended by a friend, who used it before me.

So I’ll assume this won’t happen again for other dex / outline users.

I also hope so :p.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.