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!

Authentication failure message while running GlassFish "asadmin deploy" command



  • Hi

    I am trying to run the following command for GlassFish server:

    asadmin deploy --force=true --createtables=true business.ear

    I added a Command Line action with the following parameters:
    Executable path - the path to asadmin.bat
    Working Directory - Project folder
    Argument = deploy --force=true --createtables=true business.ear

    This gave an error:

    Action Group 2: Build Website
    Action 3: Execute Y:\software\glassfish3\glassfish\bin\asadmin.bat (--user admin deploy --force=true --createtables=true aces3-business-services\api-dist\aces3-business-services-ear.ear) in Y:\Projects\ACESIII
    Initializing action...
    RemoteAction Initialization Complete:
    Temp Directory: Y:\software\BuildMaster_SVCTMP_A3_S4\TMP
    Source Directory: Y:\Projects\ACESIII
    Target Directory: Y:\software\BuildMaster_SVCTMP_A3_S4\WRK
    Server: NEETI-ORACLE (Id: 1)
    Initialization complete. Executing...
    Arguments: deploy --force=true --createtables=true aces3-business-services\api-dist\aces3-business-services-ear.ear
    Working Directory: Y:\Projects\ACESIII
    Executing Y:\software\glassfish3\glassfish\bin\asadmin.bat
    Authentication failed for user: null
    Command deploy failed.
    (Usually, this means invalid user name and/or password)
    Process Exit Code: 1 (0x00000001)
    Execution complete. Finalizing...
    Finalization complete.

    So changed the Arguments to --user admin deploy --force=true --createtables=true <path of ear file>

    Then saw the error for:
    Action Group 2: Build Website
    Action 3: Execute Y:\software\glassfish3\glassfish\bin\asadmin.bat (--user admin deploy --force=true --createtables=true aces3-business-services\api-dist\aces3-business-services-ear.ear) in Y:\Projects\ACESIII
    Initializing action...
    RemoteAction Initialization Complete:
    Temp Directory: Y:\software\BuildMaster_SVCTMP_A3_S4\TMP
    Source Directory: Y:\Projects\ACESIII
    Target Directory: Y:\software\BuildMaster_SVCTMP_A3_S4\WRK
    Server: NEETI-ORACLE (Id: 1)
    Initialization complete. Executing...
    Arguments: --user admin deploy --force=true --createtables=true aces3-business-services\api-dist\aces3-business-services-ear.ear
    Working Directory: Y:\Projects\ACESIII
    Executing Y:\software\glassfish3\glassfish\bin\asadmin.bat
    Authentication failed for user: admin
    Command deploy failed.
    (Usually, this means invalid user name and/or password)
    Process Exit Code: 1 (0x00000001)
    Execution complete. Finalizing...
    Finalization complete.

    I am running this on my local machine, not any remote server.

    It works when I run the command directly from command window without "user" option.

    Any idea where I am going wrong?

    Thank you



  • Hi Neeti,

    This most likely has to do with the user credentials that the service is running under; can you change the service credentials to your account... just to test?

    Alex



  • How do I find the service credentials for GlassFish?

    I used "admin" as the username - username created at the time of GlassFish installation.



  • Hi Alex,

    When I run BuildMaster interactively, then the asadmin command is successful and it does not show Authentication failure message.

    Why does it work when running BuildMaster in interactive mode?

    Thanks
    Neeti



  • Hi Neeti,

    This happens with all sorts of automation; the problem is that asadmin is storing the password for "admin" somewhere in your user profile or user credential store. Because the service is running under a different user (LOCAL SYSTEM, usually), the password is not available for that user.

    This is generally why it's best to run BuildMaster (or other automation services) under a domain service account; this way, you can log in to the server as that user and set-up the necessary credentials.

    There may be a way to set this in asadmin (perhaps a -password option?), but I'm not that familiar w/ asadmin.

    Alex



  • Hi Alex,

    How do I run in a Domain service account?

    Would running in IIS mean the same?

    I tried to explicitly add the password in the action, but it worked for one action and failed for the second as the 2nd build file was trying to use asadmin command or trying to get the asadmin directory and it gave an Authentication failure there.

    [ear] Building ear: Y:\Projects\ACESIII\aces3-business-services\api-dist\aces3-business-services-ear.ear
    deploy:
    [exec] Authentication failed for user: nullCommand deploy failed.
    [exec]
    [exec] (Usually, this means invalid user name and/or password)
    BUILD FAILED
    Y:\Projects\ACESIII\deployment\deployment.xml:152: The following error occurred while executing this line:
    Y:\Projects\ACESIII\aces3-business-services\api-build.xml:470: exec returned: 1
    Total time: 13 seconds

    The line 470 in api-build.xml is for retrieving the asadmin directory and it failed when it tried to deploy.

    Neeti



  • You can use your account credentials for testing purposes; but for long term-usage, an systems administrator should set up a service account for BuildMaster and its agents to use.

    To change service credentials, go to "View Local Services" and then edit the BuildMaster Service. You can just set it to your account.

    If using IIS, go to App Pools, BuildMaster App Pool, Advanced settings, and change Application Pool Identity to your account.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation