Magic.



  • Working on a large Asp.net app, which uses the standard aspnet_ tables to do authentication. Well... kind of. It also has its own mechanism which kind of overlaps and kind of doesn't.

    I was adding a new role to the system, "ReadOnlyAdministrator", and accidentally typo-ed it as "ReadOnlyAdministator".

    It's now there FOREVER.

    No, seriously. The typo is there FOREVER.

    When the application runs, it runs this quick function to add roles that have been added in code:

    private static void EnsureRoles()
            {
                string[] myRoles = Enum.GetNames(typeof(Role));
                foreach (string myRole in myRoles)
                {
                    if (!Roles.RoleExists(myRole))
                        Roles.CreateRole(myRole);
                }
            }
    

    Looks reasonable? But oops, I added a typo. No biggie; I'll remove it from the DB, fix the typo in the enum, and rerun.

    ... ok now I have the correctly-spelled role, but I still have the badly spelled one?! How?

    Search all files in project for the misspelling. No longer there. Search all projects in solution. Not there. Search ENTIRE SOURCE CODE REPO. Text does not appear.

    Look at related tables in the DB, but the role isn't in any of them. ... ok? Must have been a fluke?

    Drop database, start with a BRAND NEW FRESH COPY. BRAND NEW. FRESH COPY.

    Run the app.

    ReadOnlyAdminstator is inserted into the aspnet_Roles table. Again. HOW?! HOW?!?!?!?!?!?!?!

    Magic.



  • Are you sure there's only one instance running?


  • sockdevs

    hmm.... I don't suppose you did a project clean and then rebuild?

    Assuming that listed code is the only reason that roles could be inserted into the DB then that means that the enum was not updated to include the new value, or for rasins still has the old value too.

    If you have a decompiler/inspector available you may be able to confirm that state by cracking open the appropriate built DLL.



  • @ben_lubar said:

    Are you sure there's only one instance running?

    Yes.

    @accalia said:

    hmm.... I don't suppose you did a project clean and then rebuild?

    Yes.

    My current theory is that since there's an LDAP URL in the Web.Config, somehow the group I "created" got saved to LDAP and is being restored from LDAP at some point by some scary action at a distance.

    I found a LDAP Browser app, but it's locked-up at "connecting", so I have no idea how to even check that theory.


  • sockdevs

    @blakeyrat said:

    My current theory is that since there's an LDAP URL in the Web.Config, somehow the group I "created" got saved to LDAP and is being restored from LDAP at some point by some scary action at a distance.

    this is an AD connected thing? why didn't you say so?

    yeah you've almost certainly got the AD group created for the misspelled version, so you're getting that role.

    IIRC you'll need to get a domain admin to remove that from the domain.



  • Wait, you don't need to be domain admin to make a role?


  • sockdevs

    depends on your delegate permissions, no you don't.

    You need some delegate domain permissions to create a group on the domain, but you don't need to be a domain admin.



  • @accalia said:

    this is an AD connected thing?

    I dunno?

    I said it was a theory not a PROVEN FACT ACCALIA PLEASE TREAT WHAT I JUST SAID AS IF IT WAS A PROVEN FACT!

    (Before you people bitch at me for being rude, note this is NOT "Coding Help", I did NOT ask for any advice or assistance and unsolicited advice is the worst thing since cancer dressed as Hitler for Halloween.)

    I don't even know if the LDAP URL in the Web.Config and our company's AD refer to the same list of users.

    In any case, why would I have permissions to create a group on it?



  • @blakeyrat said:

    the worst thing since cancer dressed as Hitler for Halloween

    But is it worse than Hitler dressed as Ebola-chan for Halloween?


  • sockdevs

    @blakeyrat said:

    I did NOT ask for any advice or assistance and unsolicited advice is the worst thing since cancer dressed as Hitler for Halloween.

    you post a problem on this forum and expect us not to try and solve it? and then you yell at me for trying to make a solution....

    sheesh...

    @blakeyrat said:

    I said it was a theory not a PROVEN FACT ACCALIA PLEASE TREAT WHAT I JUST SAID AS IF IT WAS A PROVEN FACT!
    you didn't have to yell. a polite "fuck off my thread" would have sufficed.



  • How DARE you see a problem and ask how to help! You sexist pig! You just don't know how to listen.

    It's not about the broken site... it's about how it makes me feel and the fact that you don't listen to me.

    It's Not About The Nail – 01:42
    — Jason Headley



  • @WernerCD said:

    it's about how it makes me feel and the fact that you don't listen to me

    One of the worst micro aggressions of all time.

    OF ALL TIME!



  • And just to piss on the fire that is the hate spewing from your soul, how about this? LMSOTFY



  • Updates:

    1. I had a co-worker witness it, so I am not a CRAZY INSANE PERSON WHO IS HALLUCINATING. At least not about this.

    2. My boss came over and I told him about the problem. He suggested switching back to the Develop branch and seeing if the role was recreated then.

    3. I did and it wasn't.

    4. So now I guess it's fixed?

    (My co-worker had no theory. My boss's theory is that it was running an outdated DLL, which also failed to be cleaned. But that doesn't explain why BOTH roles were being written to the database.)

    1. Everybody commented on how computers seem to hate me utterly and do completely random unpredictable things when I'm at the keyboard of them. DUH!

  • Discourse touched me in a no-no place

    @accalia said:

    you post a problem on this forum and expect us not to try and solve it?

    YMBNH



  • I'd curious how Accalia feels about unsolicited help. Does she just like walk along the street, and someone guys, "hey you could lose a couple dozen pounds! Here's a gym coupon!" and then is like, "wow, my heartfelt thanks, good citizen. I indeed have let myself go! I really appreciate your unsolicited advice and look forward to hearing more in the future!"


  • Discourse touched me in a no-no place

    Not sure, but she has been around long enough to know that you simply like complaining and that actually solving the problem is a barrier to that.



  • @blakeyrat said:

    "wow, my heartfelt thanks, good citizen. I indeed have let myself go! I really appreciate your unsolicited advice and look forward to hearing more in the future!"

    That would be worth saying just to see how the person responds.



  • @blakeyrat said:

    I'd curious how Accalia feels about unsolicited help.

    Yeah, your example is totally like this topic. Totally.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    unsolicited advice is the worst thing since cancer dressed as Hitler for Halloween

    At least it's not the worst of the worst, so it's got that going for it.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    Everybody commented on how computers seem to hate me utterly and do completely random unpredictable things when I'm at the keyboard of them.

    Maybe this line of work isn't for you, and you should look into cowboying.


  • Discourse touched me in a no-no place

    @boomzilla said:

    Yeah, your example is totally like this topic. Totally.

    Well, that was a useless onebox.



  • I sure hope you gave your boss a proper yelling at for offering unsolicited advice.

    In fact, since he did not solve the problem he just added to the confusion, and that, as we know, IS THE OPPOSITE TO HELPFUL!!!



  • @blakeyrat said:

    I make a change and the machine breaks the laws of physics to ignore it.

    Sounds like my entire experience with SugarCRM. And some people in management.



  • @blakeyrat said:

    Everybody commented on how computers seem to hate me utterly

    Computers only?



  • Whining is implicit sollicitation.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.