OAuth error on server reload while it's disabled #2068

Closed
opened 2026-03-22 13:54:26 -05:00 by GiteaMirror · 15 comments
Owner

Originally created by @eirnym on GitHub (Jan 21, 2025).

Description

I see an error on openid connect every time I restart the server. I don't run server all the time and don't use any OAuth providers.

Steps to reproduce:

  1. Log in
  2. Do your stuff
  3. Kill server
  4. Run server
  5. Reload page

Error: message I see on screen:

Wystąpił błąd:
can't access property "find", e.auth.openidConnect.providers is null

Sprawdź, czy adres URL interfejsu API jest poprawny.
Message in logs:
ERROR	▶ 102 invalid character 'd' looking for beginning of value

Config:

---
service:
  unixsocket: /opt/local/www/vikunja.example.com.sock
  unixsocketmode: 0o666
  publicurl: https://vikunja.example.com
  enableemailreminders: false
log:
  enabled: true

ratelimit:
  enabled: false
sentry:
  enabled: false
typesense:
  enabled: false
redis:
  enabled: false
mailer:
  enabled: false
migration:
  todoist:
    enabled: false
  trello:
    enabled: false
  microsofttodo:
    enabled: false
auth:
  openid:
    enabled: false
metrics:
  enabled: false
autotls:
  enabled: false

Vikunja Version

v0.24.1-718-b85befb86a

Browser and version

Firefox

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

Originally created by @eirnym on GitHub (Jan 21, 2025). ### Description I see an error on openid connect every time I restart the server. I don't run server all the time and don't use any OAuth providers. Steps to reproduce: 1. Log in 2. Do your stuff 3. Kill server 4. Run server 5. Reload page Error: message I see on screen: ``` Wystąpił błąd: can't access property "find", e.auth.openidConnect.providers is null Sprawdź, czy adres URL interfejsu API jest poprawny. ``` <strike> Message in logs: ``` ERROR ▶ 102 invalid character 'd' looking for beginning of value ``` </strike> Config: ```yaml --- service: unixsocket: /opt/local/www/vikunja.example.com.sock unixsocketmode: 0o666 publicurl: https://vikunja.example.com enableemailreminders: false log: enabled: true ratelimit: enabled: false sentry: enabled: false typesense: enabled: false redis: enabled: false mailer: enabled: false migration: todoist: enabled: false trello: enabled: false microsofttodo: enabled: false auth: openid: enabled: false metrics: enabled: false autotls: enabled: false ``` ### Vikunja Version v0.24.1-718-b85befb86a ### Browser and version Firefox ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots _No response_
GiteaMirror added the needs reproduction label 2026-03-22 13:54:26 -05:00
Author
Owner

@kolaente commented on GitHub (Jan 21, 2025):

Which server do you mean? Vikunja or your openid auth server?

@kolaente commented on GitHub (Jan 21, 2025): Which server do you mean? Vikunja or your openid auth server?
Author
Owner

@eirnym commented on GitHub (Jan 21, 2025):

I have no local openid server up.

When I run Vikunja without openid, I see no error before I restart the server keeping tab open.

The problem is in Vikunja's code that assume that openid is on.

@eirnym commented on GitHub (Jan 21, 2025): I have no local openid server up. When I run Vikunja without openid, I see no error before I restart the server keeping tab open. The problem is in Vikunja's code that assume that openid is on.
Author
Owner

@kolaente commented on GitHub (Jan 21, 2025):

Ah, sorry for the confusion.

Just so that I understand that correctly: You log into Vikunja, then stop the service, then reload and then see the error?

@kolaente commented on GitHub (Jan 21, 2025): Ah, sorry for the confusion. Just so that I understand that correctly: You log into Vikunja, then stop the service, then reload and then see the error?
Author
Owner

@eirnym commented on GitHub (Jan 22, 2025):

Yes, restart server and reload tab.

@eirnym commented on GitHub (Jan 22, 2025): Yes, restart server and reload tab.
Author
Owner

@eirnym commented on GitHub (Jan 22, 2025):

Error log ERROR ▶ 102 invalid character 'd' looking for beginning of value doesn't belong to this task.

For some reason server wrote done=false into project_view.filter. But the rest is reproducible on empty setup with config given above on localhost/behind nginx

@eirnym commented on GitHub (Jan 22, 2025): Error log `ERROR ▶ 102 invalid character 'd' looking for beginning of value` doesn't belong to this task. For some reason server wrote `done=false` into `project_view.filter`. But the rest is reproducible on empty setup with config given above on localhost/behind nginx
Author
Owner

@kolaente commented on GitHub (Jan 23, 2025):

I'm unable to reproduce that. Can you give more details about your setup? Which configuration did you use? How are you hosting Vikunja? Which commands did you use to restart the service?

@kolaente commented on GitHub (Jan 23, 2025): I'm unable to reproduce that. Can you give more details about your setup? Which configuration did you use? How are you hosting Vikunja? Which commands did you use to restart the service?
Author
Owner

@eirnym commented on GitHub (Jan 23, 2025):

  1. Config file contents is in the top post already.
  2. git clean -fdx, build front end and backend in a standard way
  3. Run it from terminal using ./vikunja
  4. Route socket to local https://vikunja.example.com. I use simple Nginx and step-ca configuration.
  5. Open browser in private/temporary container/incognito mode to have no cookies and no data.
  6. Register new user. My user named frederick.
  7. Do some simple work like create projects and tasks
  8. KEEP TAB OPEN
  9. Open terminal with vikunja and hit Ctrl-C which gracefully stops the server
  10. Open the same tab, hit reload and you should see error 502 from Nginx
  11. Start server again using the same command as before.
  12. After waiting for a little while to vikunja loads all the data, hit reload.
  13. I see error I mentioned before on browser screen as I mentioned in the first post. You can disregard text in Polish, as it's just a general message, that some error happened.

Before you asked, if you press "exit" from user menu, there will be no error.

More so, I see similar error in pop up every time I log in afterwards.

JavaScript console show no error in logs which is a weird design by me, but it's your way.

@eirnym commented on GitHub (Jan 23, 2025): 1. Config file contents is in the top post already. 2. git clean -fdx, build front end and backend in a standard way 3. Run it from terminal using `./vikunja` 4. Route socket to local https://vikunja.example.com. I use simple Nginx and step-ca configuration. 5. Open browser in private/temporary container/incognito mode to have no cookies and no data. 6. Register new user. My user named `frederick`. 7. Do some simple work like create projects and tasks 8. KEEP TAB OPEN 9. Open terminal with vikunja and hit Ctrl-C which gracefully stops the server 10. Open the same tab, hit reload and you should see error 502 from Nginx 11. Start server again using the same command as before. 12. After waiting for a little while to vikunja loads all the data, hit reload. 13. I see error I mentioned before on browser screen as I mentioned in the first post. You can disregard text in Polish, as it's just a general message, that some error happened. Before you asked, if you press "exit" from user menu, there will be no error. More so, I see similar error in pop up every time I log in afterwards. JavaScript console show no error in logs which is a weird design by me, but it's your way.
Author
Owner

@eirnym commented on GitHub (Jan 24, 2025):

after a very little search (just grepping expression from the message above), I've found 2 errors on front end side, which assumes that oauth is enabled and configured. (src/stores/au.th.ts)

From that I suppose, that back end and UI may contain other similar bombs for disabled features

@eirnym commented on GitHub (Jan 24, 2025): after a very little search (just grepping expression from the message above), I've found 2 errors on front end side, which assumes that `oauth` is enabled and configured. (`src/stores/au.th.ts`) From that I suppose, that back end and UI may contain other similar bombs for disabled features
Author
Owner

@kolaente commented on GitHub (Jan 24, 2025):

Does it work without the proxy?

  1. After waiting for a little while to vikunja loads all the data, hit reload.

Does that mean Vikunja loads everything in the browser? Or do you mean in the cli?

More so, I see similar error in pop up every time I log in afterwards.

Do you see that as red banner in the bottom left or do you see it on the login screen where the llama picture is on the left?

@kolaente commented on GitHub (Jan 24, 2025): Does it work without the proxy? > 12. After waiting for a little while to vikunja loads all the data, hit reload. Does that mean Vikunja loads everything in the browser? Or do you mean in the cli? > More so, I see similar error in pop up every time I log in afterwards. Do you see that as red banner in the bottom left or do you see it on the login screen where the llama picture is on the left?
Author
Owner

@kolaente commented on GitHub (Jan 24, 2025):

I've pushed a potential fix for this in 66293795e7 - can you check with the next unstable build (should be ready for deployment in ~45min, also on try)?

@kolaente commented on GitHub (Jan 24, 2025): I've pushed a potential fix for this in 66293795e7bea4efda5a52f27728270c17b34241 - can you check with the next unstable build (should be ready for deployment in ~45min, also on [try](https://try.vikunja.io))?
Author
Owner

@eirnym commented on GitHub (Jan 25, 2025):

Thank you, this error is not showing again.

now it logs me out every time I reload server, but it probably should be an another issue. I don't know when this behaviour has been changed.

@eirnym commented on GitHub (Jan 25, 2025): Thank you, this error is not showing again. now it logs me out every time I reload server, but it probably should be an another issue. I don't know when this behaviour has been changed.
Author
Owner

@kolaente commented on GitHub (Jan 25, 2025):

Glad it's fixed now!

now it logs me out every time I reload server, but it probably should be an another issue. I don't know when this behaviour has been changed.

This is actually intended behaviour. Because it can't reach the server, it deletes all data that you have stored in your browser.

@kolaente commented on GitHub (Jan 25, 2025): Glad it's fixed now! > now it logs me out every time I reload server, but it probably should be an another issue. I don't know when this behaviour has been changed. This is actually intended behaviour. Because it can't reach the server, it deletes all data that you have stored in your browser.
Author
Owner

@eirnym commented on GitHub (Jan 25, 2025):

I see. Am I correctly understanding, that if I have temporary connectivity problems, such I'm traveling in a train, I'll be constantly logging in?

@eirnym commented on GitHub (Jan 25, 2025): I see. Am I correctly understanding, that if I have temporary connectivity problems, such I'm traveling in a train, I'll be constantly logging in?
Author
Owner

@kolaente commented on GitHub (Jan 26, 2025):

If you're offline it won't log you out, only if it can't reach the server (but you're otherwise online).

@kolaente commented on GitHub (Jan 26, 2025): If you're offline it won't log you out, only if it can't reach the server (but you're otherwise online).
Author
Owner

@eirnym commented on GitHub (Jan 27, 2025):

During travels by train, I use cellular network from my phone. So hotspot is "on", but server might be unreachable quite often.

Any other services won't me log out just because I'm offline, neither public, nor corporative.

@eirnym commented on GitHub (Jan 27, 2025): During travels by train, I use cellular network from my phone. So hotspot is "on", but server might be unreachable quite often. Any other services won't me log out just because I'm offline, neither public, nor corporative.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#2068