Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-3363

Observium monthly traffic and peering graph is showing up as blank upon user login

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • Web Interface
    • CentOS 7.8.2003

    Description

      Hi,

      We're experiencing an issue with Observium where logged in users just get a blank image for the monthly transit and peering traffic graph. On the client side this is ultimately an <img> element that makes a call to /html/graph.php as its source attribute. When trying to directly load this source link, we get:

      Function generate_query_permitted() on page '' called before include cache-data.inc.php or something wrong with caching permissions. Please report this to developers!

      We believe we have set up all permissions properly, and this graph has worked in the past, but there may be something we're missing on the permissions end. I looked into it, and this is what I found:

       

      • The root cause of the error comes in line 2159 in html/include/functions.inc.php. This checks if $GLOBALS['permissions'] (global var 'permissions') is set. If not, it throws the error described above.
      • index.php includes /html/includes/authenticate.inc.php, i'm assuming to authenticate the user. On line 390 of authenticate, $permissions is set as a global variable by calling the permissions_cache function, which pulls user permissions from the Observium MariaDB. It looks at the tables entity_permissions, roles_users, and roles_entity_permissions. The table entity_permissions is completely empty, but I am unsure if this is intentional. There are no comments on that. The table roles_users matches role_id's to user_id's. roles_entity_permissions then matches device id's, types, etc. to those role_id's, so that certain user's can only view certain devices. In our case, it looks like any administrator has full access to all devices (role_id = 2). I made sure that roles_users had the proper user ids added as administrators with full access. This did not solve the problem.
      • From what I can gather, my educated guess is that $GLOBALS['permissions'] is not getting cached properly/at all after being set on index.php. Because the front-end image's src attribute is calling a new instance of html/graph.php to load the graph, those previous global variables will not apply, and will need to be either stored as a cookie or passed as a query param. I am curious about the 'nocache' query param when calling graph.php, and I wonder if that contains some answers, but unfortunately I could not find any reference to it in the code.

      Attachments

        Activity

          People

            adama Adam Armstrong
            druffner David Ruffner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: