[Solved] NewContext() Expect user 'olduser' but current user is: newuser #2071

Closed
opened 2025-11-02 04:23:14 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @coolaj86 on GitHub (Jul 19, 2018).

  • Gitea version (or commit ref): 1.4.0
  • Git version: 2.7.4
  • Operating system: Ubuntu
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
[...s/setting/setting.go:994 NewContext()] [E] Expect user 'olduser' but current user is: newuser

Description

I need to run two instances of gitea on a single server and I found out that using the same username for both causes problems with ssh authorized keys.

I tried to change the user that the one instance runs as (and change all related files to be owned by that new user), but it complains at me about the system user having changed.

How can I correct this? Is there a cache directory that I need to delete? Or a SQL UPDATE that I need to run? And why is it tied to a system account in the first place?

Originally created by @coolaj86 on GitHub (Jul 19, 2018). - Gitea version (or commit ref): 1.4.0 - Git version: 2.7.4 - Operating system: Ubuntu - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ``` [...s/setting/setting.go:994 NewContext()] [E] Expect user 'olduser' but current user is: newuser ``` ## Description I need to run two instances of gitea on a single server and I found out that using the same username for both causes problems with ssh authorized keys. I tried to change the user that the one instance runs as (and change all related files to be owned by that new user), but it complains at me about the system user having changed. How can I correct this? Is there a cache directory that I need to delete? Or a SQL UPDATE that I need to run? And why is it tied to a system account in the first place?
Author
Owner

@coolaj86 commented on GitHub (Jul 19, 2018):

Solution

It turns out that all I had to do was update the username in custom/conf/app.ini

@coolaj86 commented on GitHub (Jul 19, 2018): Solution ====== It turns out that all I had to do was update the username in `custom/conf/app.ini`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2071