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



  • 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


  • inedo-engineer

    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



  • 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>
    

  • inedo-engineer

    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



  • @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


  • inedo-engineer

    Frederik,

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

        GitLab::Get-Source
        (
            Credentials: gitlab-user
        );
    


  • @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.


  • inedo-engineer

    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 :)



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation