Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    NullReferenceException when using Gitlab extension

    Scheduled Pinned Locked Moved Support
    bugbuildmaster
    8 Posts 4 Posters 58 Views 1 Watching
    Loading More Posts
    • 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.
    • ? This user is from outside of this forum
      Guest
      last edited by

      Hi,

      I am getting a NullReferenceException when trying to use the gitlab extension.
      Full stacktrace:

      System.NullReferenceException: Object reference not set to an instance of an object.
      at Inedo.Extensions.GitLab.SuggestionProviders.CredentialsProjectNameSuggestionProvider.<GetSuggestionsAsync>d__0.MoveNext() in C:\ProgramData\BuildMaster\Temp\Service\_E882\Src\Git\GitLab.InedoExtension\SuggestionProviders\CredentialsProjectNameSuggestionProvider.cs:line 17
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Inedo.Web.Editors.PropertyEditors.SuggestablePropertyEditor.SuggestableTextBox.<>c__DisplayClass3_0.<<-ctor>b__0>d.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Inedo.Web.Controls.SimpleInput.<Inedo-Web-Controls-ISimpleEventProcesser-ProcessRequestAsync>d__70.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Inedo.Web.PageFree.SimplePageBase.<ProcessRequestAsync>d__47.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)
      at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
      at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
      at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
      

      This is observed through the developer tools in Firefox on the Resource Credentials page when editing a Gitlab credential and trying to input a group name/project. When clicking in the field I get a HTTP500 from the following URL (Sanitized):
      http://buildmaster/error?fullMessage=<long base64 string> - the response tab shows the above stacktrace.

      This happens with both self-hosted Gitlab CE and gitlab.com

      It also affects that I cannot use the gitlab extension at all elsewhere in Buildmaster.

      Where to start debugging/fixing this?

      Product: BuildMaster
      Version: 6.1.7

      1 Reply Last reply Reply Quote 0
      • jjonesJ Offline
        jjones inedo-engineer
        last edited by

        Hi Frederik,

        I wasn't able to recreate this error.. Try deleting the GitLab extension and reinstalling it. Also start with new resource credential. Something may have corrupted the credential record..

        Thanks,
        Jason

        1 Reply Last reply Reply Quote 0
        • F Offline
          fbjerggaard
          last edited by

          Hi Jason,

          Sorry fro the late reply - haven't had time to deal with it until now.

          I just tried installing a brand new server today with a brand new Buildmaster install and I still have the same issue.

          Running wireshark on the server I don't see any traffic to the gitlab server at all. Checking the database on the buildmaster server, the credential entry looks fine to me in there as well.
          This is the Configuration_Xml entry from the database:

          <Inedo.Extensions.GitLab.Credentials.GitLabCredentials Assembly="GitLab"><Properties ApiUrl="https://my-gitlab-server/api" UserName="user"><Password Encrypted="aes128">aesencryptedpasswordhere</Password></Properties></Inedo.Extensions.GitLab.Credentials.GitLabCredentials>
          
          1 Reply Last reply Reply Quote 0
          • jjonesJ Offline
            jjones inedo-engineer
            last edited by

            Hi Frederik,

            So you are using a local version of GitLab? I haven't tested with that yet, but have you ever successfully created a credential for GitLab with a non-local instance?

            Thanks,
            Jason

            F 1 Reply Last reply Reply Quote 0
            • F Offline
              fbjerggaard @jjones
              last edited by

              @jjones Yes I am using a self-hosted Gitlab CE. I have just tried with a gitlab.com account but I get the same error there. Looking through the source code for the gitlab extension, it looks like it never gets the groupname or username parameter to use in the CoalesceString function.
              https://github.com/Inedo/inedox-git/blob/master/Git/GitLab.InedoExtension/SuggestionProviders/CredentialsGroupNameSuggestionProvider.cs#L17

              I tried filling the group name manually in the configuration for the credential to see if the project would then autocomplete, but it still throws the same exception as in the first post here.

              Thanks,
              Frederik

              1 Reply Last reply Reply Quote 0
              • jjonesJ Offline
                jjones inedo-engineer
                last edited by

                Frederik,

                Are you able to use this credential in a plan to see the full error message?

                    GitLab::Get-Source
                    (
                        Credentials: gitlab-user
                    );
                
                F 1 Reply Last reply Reply Quote 0
                • F Offline
                  fbjerggaard @jjones
                  last edited by fbjerggaard

                  @jjones It looks like it is working from within the plan editor - I get autocomplete suggestions for groups and projects now.
                  I then tried the resource credentials again, and it doesn't work there. Also, I just spotted that when I have added a group to the credential, I cannot remove it again. When clearing the field and saving it simply puts in the old value again.

                  [Update] I played a bit with it, and now git pulls are working and I am in process of building stuff, so yay!
                  It does however still seem like there is a bug in the credential editor page with the autocompletion of group/project, and also where you cannot delete a group once it is set.

                  1 Reply Last reply Reply Quote 0
                  • jraschJ Offline
                    jrasch inedo-engineer
                    last edited by

                    I fixed this incidentally in this commit: https://github.com/Inedo/inedox-git/commit/325562db2ea5996a1dc559f5997dca49cc9452df

                    The fix is available as of v1.3.1 of the Git(Hub|Lab)? extensions :)

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post
                    Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation