No internet connection
  1. Home
  2. Support

Error 404 Profile Page

By @Happyfeet01
    2020-03-01 23:37:43.052Z

    Hello,

    Just updated to the latest Version.
    When I go the Profile Page I get an 404 Error.

    {"severity":"DEBUG","message":"API request result exception [EsE4K2J2]: Status 404: 404 Not Found\nUser not found [EsEZ6F0U], site SiteBrief(1,3xdn8p4r8j,Some(comments.dasnetzundich.de),Active), ip 109.40.128.89: /-/load-user-any-details?who=lars"}

    Before I import an Backup from an Hosted Version.

    Solved in post #2, click to view
    • 7 replies
    1. I think that's because the previous admin user which did the restore,
      was missing from the dump file that got restored.

      This is because what's happening is a restore, not an import. Then, the current user (the one that does the restore), will disappear (unless it's present in the dump file that gets restored — but that's not your case, since you're restoring into a self hosted new server with had different database contents).

      So when you go to the profile page, after having done the restore, that user (your user from before the restore) is not found.

      You can do this: Open a new browser, e.g. Firefox if you use Chrome normally. And login with password as the new admin user. If that works, then you can continue logging in as that admin instead.

      (Here you can see the username and email of the new admin user, i.e. from the dump file that got restored:
      https://comments-for-dasnetzundich-de.talkyard.net/-/admin/users/enabled )

      The user that is missing (i.e. admin user from before the restore) — you can logout, in that browser. And you cannot login any more as that user, since that user is gone.

      ***

      Tips: Let's say the admin that got restored, didn't have a password. Then you could instead have gone here:

      https://comments.dasnetzundich.de/-/admin-login

      and typed the admin email address. Then, Talkyard would send a one time login email, so you could login as that admin, and add a password (so that thereafter you could login via password).

      And in case email hadn't yet been configured, you could do this:

      sudo -i
      cd /opt/talkyard
      scripts/find-admin-login-link.sh
      

      That script would look at the emails sent, and print the one-time login link.

      ***

      I'm thinking all this is a bit confusing, to the one who does the restore (i.e. to you in this case). Talkyard could show some info dialogs about what's going to happen, and that one needs to logout, and login again, as the new admin user.

      Reply1 LikeSolution
      1. H@Happyfeet01
          2020-03-02 07:32:43.898Z

          Yes that was the old admin.. After logout, reload and sign in it works.,

          But now i get an other Error when i try to save Settings.

          https://paste.dasnetzundich.de/view/embed/5078b83d
          1. That looks like a user interface bug. The UI shouldn't allow that combination of settings.

            It seems the conflicting settings are:

            • 1: Allow anonymous "login"
            • 2: Require login and Approve users

            Those settings 1 & 2 cannot be combined with each other. — I tried to reproduce this combination of settings, and save, but so far in my case the user interface did not let me configure these settings (so, worked as intended, in this case).

            I'm wondering if you happen to remember which buttons and settings you edited and in which order? before you clicked Save. Then I can try that same thing.

            If you disable (unckeck) Allow anonymous "login" ("guest" login),
            then, I'd think the error will disappear.

            Or if you disable (uncheck) both Login required and Approve users.

            (Here's the database constraint that says No to these settings:
            settings_c_guestlogin_auth CHECK (NOT (
            allow_guest_login AND (user_must_be_auth OR user_must_be_approved OR invite_only)))

            1. H@Happyfeet01
                2020-03-03 08:36:16.860Z

                Hi,

                I try to check Approve users but I get the same error. Allow creating local accounts is checked but not anonymous login.

                1. Thanks for the reply, I could reproduce this now:

                  Something went wrong: [DwE500EXC]
                  
                  org.postgresql.util.PSQLException: ERROR: new row for relation "settings3" violates check constraint "settings_c_guestlogin_auth"
                    Detail: Failing row contains (1, null, null, null, t, t, null, null, null,  ....).
                  

                  Then I should be able to fix this now soon

                  1. Hi again @Happyfeet01, I'm not 100% sure but seems I didn't remember to make Talkyard clear the in-memory cache, after a restore. I'll continue looking into this later today / tomorrow.

                    So Talkyard in-memory remembers the old site settings, and tries to save them, but the database has the new settings, causing this forbidden combination of settings.

                    If you want to, try with setting Allow guest login enabled, then save the settings. This should clear the mem cache.
                    Then, reload the page, and reconfigure the settings in the way you want.

                    Alternatively, restart the Talkyard application server: cd /opt/talkyard ; docker-compose restart app.

                    Or wait until I release a new version with a fix, later this week probably.

                    1. H@Happyfeet01
                        2020-03-03 16:59:41.276Z

                        Thanks. That works fine.. thanks for your work.