Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Grafana
  3. Not Able to Login in Grafana Using Cloudron LDAP

Not Able to Login in Grafana Using Cloudron LDAP

Scheduled Pinned Locked Moved Solved Grafana
11 Posts 4 Posters 544 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nebulonN Offline
    nebulonN Offline
    nebulon
    Staff
    wrote on last edited by
    #2

    Is this error shown in the UI, are there any error logs in the browser or the app on the server side?

    1 Reply Last reply
    0
    • arshsahzadA Offline
      arshsahzadA Offline
      arshsahzad
      wrote on last edited by arshsahzad
      #3

      Hi @nebulon,

      Below is the error while I'm trying to login in to Grafana, Actually at the time of setup of Grafana, I did change the default username (admin) and password as to the LDAP user

      May 08 20:43:48 ERROR[05-08|15:13:48] Error while trying to authenticate user logger=context userId=0 orgId=0 uname= error="cannot remove last grafana admin" remote_addr=172.71.198.118 traceID=

      May 08 20:43:48 ERROR[05-08|15:13:48] Request Completed logger=context userId=0 orgId=0 uname= method=POST path=/login status=500 remote_addr=172.71.198.118 time_ms=166 duration=166.861445ms size=66 referer=https://grafana.example.com/login handler=/login

      1 Reply Last reply
      0
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by girish
        #4

        Oh so those user mapping topics are often a mess and its best to not change the username of the pre-setup admin but only set it to a strong password.

        If you have not changed the admin password before, can you try user username with password "admin" if that works, then add a new admin in the UI (say with username "admin") then your ldap user will be able to login again, but will get initially demoted to non-admin.

        1 Reply Last reply
        0
        • nebulonN nebulon marked this topic as a question on
        • Jan MacenkaJ Offline
          Jan MacenkaJ Offline
          Jan Macenka
          wrote on last edited by Jan Macenka
          #5

          Same issues here. I tracked it down somewhat in the Log-Files while restoring to some older backuped versions.

          In App-Version v1.16.4 things seemed to be working v1.17 seems to be boroken. However even in v1.16.4 there was this behavior in the logs:

          image.png

          In the more extensive log-files there was this:
          6fc54cfb-c1a8-4fa8-b7c5-d69f6dffce84-image.png

          And in an earlier version, I found this:

          b5e57e3d-199b-4ee5-b8bc-4cf65650e3f9-image.png

          To me this looks like there were some breaking-changes in how LDAP is handled or how required resources are loaded.

          @nebulon could you look into that? If required, shoot me a message and I can give access to my instance for further review.

          My current "quick fix" is to restore to a backup of at v1.16.4 and disable automatic updates, though this should only be a short-term work-a-round.

          girishG 1 Reply Last reply
          1
          • girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #6

            @Jan-Macenka The undefined stuff is not an issue, it is just some spurious logs. We already removed them last week. The AWS migration notice is also not an issue. This comes from AWS Module, this is also getting replaced next release.

            Would like to debug this further though, because I can't reproduce it with latest grafana atleast.

            1 Reply Last reply
            1
            • Jan MacenkaJ Jan Macenka

              Same issues here. I tracked it down somewhat in the Log-Files while restoring to some older backuped versions.

              In App-Version v1.16.4 things seemed to be working v1.17 seems to be boroken. However even in v1.16.4 there was this behavior in the logs:

              image.png

              In the more extensive log-files there was this:
              6fc54cfb-c1a8-4fa8-b7c5-d69f6dffce84-image.png

              And in an earlier version, I found this:

              b5e57e3d-199b-4ee5-b8bc-4cf65650e3f9-image.png

              To me this looks like there were some breaking-changes in how LDAP is handled or how required resources are loaded.

              @nebulon could you look into that? If required, shoot me a message and I can give access to my instance for further review.

              My current "quick fix" is to restore to a backup of at v1.16.4 and disable automatic updates, though this should only be a short-term work-a-round.

              girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #7

              @Jan-Macenka also, did you change the admin username by any chance?

              Jan MacenkaJ 1 Reply Last reply
              0
              • girishG girish

                @Jan-Macenka also, did you change the admin username by any chance?

                Jan MacenkaJ Offline
                Jan MacenkaJ Offline
                Jan Macenka
                wrote on last edited by
                #8

                @girish as a fist measure, I changed the password for admin/admin, later I gave Server-Admin Priviledges to my primary LDAP profile and deleted the admin-user as I viewed it only as a potential security-risk. Is there a need to keep this local user around?
                Also I activated Support-Access inkl. SSH access, should you want to dig around some more.

                1 Reply Last reply
                0
                • nebulonN Offline
                  nebulonN Offline
                  nebulon
                  Staff
                  wrote on last edited by
                  #9

                  So the issue is, that the app for some reason demotes the LDAP user after login, while it syncs other properties. And since that user is currently the only admin left, it errors so it is not left without an admin.

                  For a start you have to add a local admin and then we have to see why the LDAP login demotes the user also.

                  Jan MacenkaJ 1 Reply Last reply
                  1
                  • nebulonN nebulon

                    So the issue is, that the app for some reason demotes the LDAP user after login, while it syncs other properties. And since that user is currently the only admin left, it errors so it is not left without an admin.

                    For a start you have to add a local admin and then we have to see why the LDAP login demotes the user also.

                    Jan MacenkaJ Offline
                    Jan MacenkaJ Offline
                    Jan Macenka
                    wrote on last edited by Jan Macenka
                    #10

                    @nebulon I re-created the local admin-user and set it to disabled. Re-ran the upgrade to version v1.17 and the first login afterwards worked. However for some reason the login started failing only some time after the update, so I'll check it over the next days.

                    Thanks for the ad-hoc debugging! I deactivated remote SSH access again.

                    Update:

                    After checking the User-Management, the Permission system appears to have changed because I get notifications of insufficient rights:
                    a1d7f513-4355-402f-b9a2-b6766ea84cac-image.png

                    Also my Organisations seem to be gone or at the least I lack the rights to view them.

                    1 Reply Last reply
                    0
                    • Jan MacenkaJ Offline
                      Jan MacenkaJ Offline
                      Jan Macenka
                      wrote on last edited by
                      #11

                      I did not finaly figure out what it was but was able to revert back to a backup-state that worked.
                      Ended up just creating a new Grafana App and manually transfered all settings. Not it appears to be working fine.
                      So probably I screwed up somewhere but it does not seem to be a bigger Application issue.

                      1 Reply Last reply
                      0
                      • nebulonN nebulon has marked this topic as solved on
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search