Ad Widget

Collapse

unable to login - reason & solution

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #1

    unable to login - reason & solution

    are you unable to log in to your zabbix installation ? have a completely clean db, but default login does not work either ?
    are there no error messages of any kind, browser just returns you to the login window ?
    nasty.

    solution - check your server/client time difference. cookie might expire at the same moment it is set.
    huge thanks to carlheaton for the help with this issue
    Zabbix 3.0 Network Monitoring book
  • abi
    Member
    • Jun 2006
    • 81

    #2
    hi,

    hm.. i have experienced this problem only while using postgresql
    as backend (and had no solution to it). What database do you use?

    Especially as the frontend was installed on the same machine
    as the Database, so no time difference at all.

    Comment

    • richlv
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Oct 2005
      • 3112

      #3
      in this particular case it was with mysql 5.
      i'd guess time difference should be db independent.
      while logging mysql queries, i could see that admin password was succesfully queried and session id inserted into the database.
      Zabbix 3.0 Network Monitoring book

      Comment

      • abi
        Member
        • Jun 2006
        • 81

        #4
        Originally posted by richlv
        in this particular case it was with mysql 5.
        i'd guess time difference should be db independent.
        while logging mysql queries, i could see that admin password was succesfully queried and session id inserted into the database.
        yeah, i've had a look at the frontends php source and it does
        indeed catch the right values from the database, but then right
        after the login was successful it seemed like a http-forward
        happened and in between something fcked.

        I did not have a look at the cookie part but it sounds reasonable.

        Comment

        • abi
          Member
          • Jun 2006
          • 81

          #5
          hi,

          this seems to be an issue in the frontends code.

          This problem only occurs if you visit the page from localhost
          (http://localhost/zabbix/). If the frontend is installed on another host (or you call it with http://127.0.0.1/zabbix/)
          it works like a charm.

          Has probably something to do with the Domain set when creating
          the cookie.
          Last edited by abi; 20-09-2006, 13:23.

          Comment

          • abi
            Member
            • Jun 2006
            • 81

            #6
            hi again,

            looking at the code in index.php:

            if($USER_DETAILS["url"] != '')
            {
            echo "<HTML><HEAD>";
            echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=".$USER_DETAILS["url"]."\">";
            echo "</HEAD></HTML>";
            return;
            }

            because of some reason (i dont know) $USER_DETAILS includes
            a space when the frontend is called with http://localhost/..

            A rough patch for this issue is:

            -if($USER_DETAILS["url"] != '')
            +if($USER_DETAILS["url"] != ' ')

            looking at the data.sql:

            INSERT INTO users VALUES (1,'Admin','Zabbix','Administrator','d41d8cd98f00b 204e9800998ecf8427e',' ',900,'en_gb',30);
            INSERT INTO users VALUES (2,'guest','Default','User','d41d8cd98f00b204e9800 998ecf8427e',' ',900,'en_gb',30);

            i see it does indeed insert a space here, so either the data.sql
            or the script should be fixed (the data.sql fix would be much
            much cleaner, though).
            Last edited by abi; 20-09-2006, 13:42.

            Comment

            • abi
              Member
              • Jun 2006
              • 81

              #7
              *push*

              Comment

              • James Wells
                Senior Member
                • Jun 2005
                • 664

                #8
                Greetings,
                Originally posted by abi
                i see it does indeed insert a space here, so either the data.sql
                or the script should be fixed (the data.sql fix would be much
                much cleaner, though).
                Attached is a patch that hits both of the issues you point out.
                Attached Files
                Unofficial Zabbix Developer

                Comment

                Working...