Git Product home page Git Product logo

Comments (3)

olive42 avatar olive42 commented on August 27, 2024

Can you check the Nexus logs to see if there are any errors related to uploading your script? (kitchen login, check in /opt/sonatype-work/nexus3/logs/nexus.log)

If you use the latest cookbook version, the nexus3_api resource does not take JSON content as input. I would also recommend using the nexus3_user resource,

from nexus3.

PaulusTM avatar PaulusTM commented on August 27, 2024

I currently use the following without any luck yet.

nexus3_user 'admin' do
  username 'admin'
  email '[email protected]'
  password 'admin123'
  roles ['nx-admin']
  action :create
end

During the run I get a 404 exception from the API. Do you have any pointers?

             Error executing action `run` on resource 'nexus3_api[upsert_user admin]'
             ================================================================================

             Nexus3::ApiError
             ----------------
             HTTP_STATUS=404

             Cookbook Trace:
             ---------------
             /tmp/kitchen/cache/cookbooks/nexus3/libraries/api.rb:36:in `request'
             /tmp/kitchen/cache/cookbooks/nexus3/libraries/api.rb:41:in `run_script'
             /tmp/kitchen/cache/cookbooks/nexus3/resources/api.rb:40:in `block (2 levels) in class_from_file'
             /tmp/kitchen/cache/cookbooks/nexus3/resources/api.rb:39:in `block in class_from_file'

             Resource Declaration:
             ---------------------
             # In /tmp/kitchen/cache/cookbooks/nexus3/resources/user.rb

       42:     nexus3_api "upsert_user #{new_resource.username}" do
       43:       script_name 'upsert_user'
       44:       args username: new_resource.username,
       45:            password: new_resource.password,
       46:            first_name: new_resource.first_name,
       47:            last_name: new_resource.last_name,
       48:            email: new_resource.email,
       49:            roles: new_resource.roles
       50:
       51:       action %i(create run)
       52:       endpoint new_resource.api_endpoint
       53:       username new_resource.api_username
       54:       password new_resource.api_password
       55:
       56:       content ::Nexus3::Scripts.groovy_content('upsert_user', node)
       57:     end
       58:   end

             Compiled Resource:
             ------------------
             # Declared in /tmp/kitchen/cache/cookbooks/nexus3/resources/user.rb:42:in `block (2 levels) in class_from_file'

             nexus3_api("upsert_user admin") do
        action [:create, :run]
        updated true
        default_guard_interpreter :default
        declared_type :nexus3_api
        cookbook_name "company_nexus"
        script_name "upsert_user"
        endpoint "http://localhost:8081/service/siesta/rest/v1/script"
        username "admin"
        password "admin123"
        content "import org.sonatype.nexus.security.role.NoSuchRoleException;\nimport org.sonatype.nexus.security.role.RoleIdentifier;\nimport org.sonatype.nexus.security.user.User;\nimport org.sonatype.nexus.security.user.UserManager;\nimport org.sonatype.nexus.security.user.UserNotFoundException;\nimport org.sonatype.nexus.security.SecuritySystem;\n\nimport groovy.json.JsonSlurper;\n\ndef params = new JsonSlurper().parseText(args)\n\nauthManager = security.getSecuritySystem().getAuthorizationManager(UserManager.DEFAULT_SOURCE);\n// Create a list of available from the list of passed roles. May end up empty if no role exists.\nSet<RoleIdentifier> roleList = new HashSet<RoleIdentifier>();\nparams.roles.each { role ->\n    try {\n        def newRole = authManager.getRole(role);\n        roleList.add(newRole);\n    } catch (NoSuchRoleException e) {\n        log.warn(\"No such role: ${role}, trying to set for ${params.username} from Chef\");\n    }\n}\n\ntry {\n    // Update\n    User user = security.securitySystem.getUser(params.username, UserManager.DEFAULT_SOURCE);\n\n    user.setFirstName(params.first_name);\n    user.setLastName(params.last_name);\n    user.setEmailAddress(params.email);\n    user.setRoles(roleList);\n\n    security.securitySystem.updateUser(user);\n    security.securitySystem.changePassword(params.username, params.password);\n    log.info(\"Updated information for ${params.username} from Chef\");\n} catch (UserNotFoundException e) {\n    // Create\n    security.addUser(params.username, params.first_name, params.last_name, params.email, true, params.password, params.roles);\n    log.info(\"Created user ${params.username} from Chef\");\n}\n"
        args {:username=>"admin", :password=>"admin123", :first_name=>"", :last_name=>"", :email=>"[email protected]", :roles=>["nx-admin"]}
        apiclient #<Nexus3::Api:0x000000000316e678 @http_client=#<HTTPClient:0x000000000316c3a0 @proxy=nil, @no_proxy=nil, @no_proxy_regexps=[], @base_url="http://localhost:8081/service/siesta/rest/v1/script", @default_header={}, @www_auth=#<HTTPClient::WWWAuth:0x0000000003159138 @basic_auth=#<HTTPClient::BasicAuth:0x0000000003159110 @_mutex=#<Thread::Mutex:0x000000000313ff08>, @scheme="Basic", @challenge={}, @cred=nil, @auth={#<Addressable::URI:0x1d73e0c URI:http://localhost:8081/service/siesta/rest/v1/>=>"YWRtaW46YWRtaW4xMjM="}, @force_auth=true>, @digest_auth=#<HTTPClient::DigestAuth:0x000000000313fa08 @_mutex=#<Thread::Mutex:0x000000000313ec98>, @scheme="Digest", @challenge={}, @auth={#<Addressable::URI:0x1d7a478 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @nonce_count=0>, @negotiate_auth=#<HTTPClient::NegotiateAuth:0x000000000313e720 @_mutex=#<Thread::Mutex:0x000000000313c330>, @scheme="Negotiate", @challenge={}, @auth={#<Addressable::URI:0x1d7b620 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, @ntlm_auth=#<HTTPClient::NegotiateAuth:0x00000000031277a0 @_mutex=#<Thread::Mutex:0x00000000031257e8>, @scheme="NTLM", @challenge={}, @auth={#<Addressable::URI:0x1d7abe4 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, @sspi_negotiate_auth=#<HTTPClient::SSPINegotiateAuth:0x0000000003124be0 @_mutex=#<Thread::Mutex:0x0000000003117300>, @scheme="Negotiate", @challenge={}>, @oauth=#<HTTPClient::OAuth:0x00000000031164c8 @_mutex=#<Thread::Mutex:0x0000000003114970>, @scheme="OAuth", @challenge={}, @config=nil, @auth={}, @nonce_count=0, @signature_handler={"HMAC-SHA1"=>#<Method: HTTPClient::OAuth#sign_hmac_sha1>}>, @authenticator=[#<HTTPClient::OAuth:0x00000000031164c8 @_mutex=#<Thread::Mutex:0x0000000003114970>, @scheme="OAuth", @challenge={}, @config=nil, @auth={}, @nonce_count=0, @signature_handler={"HMAC-SHA1"=>#<Method: HTTPClient::OAuth#sign_hmac_sha1>}>, #<HTTPClient::NegotiateAuth:0x000000000313e720 @_mutex=#<Thread::Mutex:0x000000000313c330>, @scheme="Negotiate", @challenge={}, @auth={#<Addressable::URI:0x1d7b620 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, #<HTTPClient::NegotiateAuth:0x00000000031277a0 @_mutex=#<Thread::Mutex:0x00000000031257e8>, @scheme="NTLM", @challenge={}, @auth={#<Addressable::URI:0x1d7abe4 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, #<HTTPClient::SSPINegotiateAuth:0x0000000003124be0 @_mutex=#<Thread::Mutex:0x0000000003117300>, @scheme="Negotiate", @challenge={}>, #<HTTPClient::DigestAuth:0x000000000313fa08 @_mutex=#<Thread::Mutex:0x000000000313ec98>, @scheme="Digest", @challenge={}, @auth={#<Addressable::URI:0x1d7a478 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @nonce_count=0>, #<HTTPClient::BasicAuth:0x0000000003159110 @_mutex=#<Thread::Mutex:0x000000000313ff08>, @scheme="Basic", @challenge={}, @cred=nil, @auth={#<Addressable::URI:0x1d73e0c URI:http://localhost:8081/service/siesta/rest/v1/>=>"YWRtaW46YWRtaW4xMjM="}, @force_auth=true>]>, @proxy_auth=#<HTTPClient::ProxyAuth:0x00000000030fdfe0 @basic_auth=#<HTTPClient::ProxyBasicAuth:0x00000000030fde00 @_mutex=#<Thread::Mutex:0x00000000030fc730>, @scheme="Basic", @challenge={}, @cred=nil, @auth={}, @force_auth=true>, @negotiate_auth=#<HTTPClient::NegotiateAuth:0x00000000030e7308 @_mutex=#<Thread::Mutex:0x00000000030e5800>, @scheme="Negotiate", @challenge={}, @auth={}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, @ntlm_auth=#<HTTPClient::NegotiateAuth:0x00000000030e4748 @_mutex=#<Thread::Mutex:0x00000000030d7e08>, @scheme="NTLM", @challenge={}, @auth={}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, @sspi_negotiate_auth=#<HTTPClient::SSPINegotiateAuth:0x00000000030d6d28 @_mutex=#<Thread::Mutex:0x00000000030d61c0>, @scheme="Negotiate", @challenge={}>, @digest_auth=#<HTTPClient::ProxyDigestAuth:0x00000000030d5360 @_mutex=#<Thread::Mutex:0x00000000030bbe10>, @scheme="Digest", @challenge=nil, @auth={}, @nonce_count=0>, @authenticator=[#<HTTPClient::NegotiateAuth:0x00000000030e7308 @_mutex=#<Thread::Mutex:0x00000000030e5800>, @scheme="Negotiate", @challenge={}, @auth={}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, #<HTTPClient::NegotiateAuth:0x00000000030e4748 @_mutex=#<Thread::Mutex:0x00000000030d7e08>, @scheme="NTLM", @challenge={}, @auth={}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, #<HTTPClient::SSPINegotiateAuth:0x00000000030d6d28 @_mutex=#<Thread::Mutex:0x00000000030d61c0>, @scheme="Negotiate", @challenge={}>, #<HTTPClient::ProxyDigestAuth:0x00000000030d5360 @_mutex=#<Thread::Mutex:0x00000000030bbe10>, @scheme="Digest", @challenge=nil, @auth={}, @nonce_count=0>, #<HTTPClient::ProxyBasicAuth:0x00000000030fde00 @_mutex=#<Thread::Mutex:0x00000000030fc730>, @scheme="Basic", @challenge={}, @cred=nil, @auth={}, @force_auth=true>]>, @request_filter=[#<HTTPClient::ProxyAuth:0x00000000030fdfe0 @basic_auth=#<HTTPClient::ProxyBasicAuth:0x00000000030fde00 @_mutex=#<Thread::Mutex:0x00000000030fc730>, @scheme="Basic", @challenge={}, @cred=nil, @auth={}, @force_auth=true>, @negotiate_auth=#<HTTPClient::NegotiateAuth:0x00000000030e7308 @_mutex=#<Thread::Mutex:0x00000000030e5800>, @scheme="Negotiate", @challenge={}, @auth={}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, @ntlm_auth=#<HTTPClient::NegotiateAuth:0x00000000030e4748 @_mutex=#<Thread::Mutex:0x00000000030d7e08>, @scheme="NTLM", @challenge={}, @auth={}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, @sspi_negotiate_auth=#<HTTPClient::SSPINegotiateAuth:0x00000000030d6d28 @_mutex=#<Thread::Mutex:0x00000000030d61c0>, @scheme="Negotiate", @challenge={}>, @digest_auth=#<HTTPClient::ProxyDigestAuth:0x00000000030d5360 @_mutex=#<Thread::Mutex:0x00000000030bbe10>, @scheme="Digest", @challenge=nil, @auth={}, @nonce_count=0>, @authenticator=[#<HTTPClient::NegotiateAuth:0x00000000030e7308 @_mutex=#<Thread::Mutex:0x00000000030e5800>, @scheme="Negotiate", @challenge={}, @auth={}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, #<HTTPClient::NegotiateAuth:0x00000000030e4748 @_mutex=#<Thread::Mutex:0x00000000030d7e08>, @scheme="NTLM", @challenge={}, @auth={}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, #<HTTPClient::SSPINegotiateAuth:0x00000000030d6d28 @_mutex=#<Thread::Mutex:0x00000000030d61c0>, @scheme="Negotiate", @challenge={}>, #<HTTPClient::ProxyDigestAuth:0x00000000030d5360 @_mutex=#<Thread::Mutex:0x00000000030bbe10>, @scheme="Digest", @challenge=nil, @auth={}, @nonce_count=0>, #<HTTPClient::ProxyBasicAuth:0x00000000030fde00 @_mutex=#<Thread::Mutex:0x00000000030fc730>, @scheme="Basic", @challenge={}, @cred=nil, @auth={}, @force_auth=true>]>, #<HTTPClient::WWWAuth:0x0000000003159138 @basic_auth=#<HTTPClient::BasicAuth:0x0000000003159110 @_mutex=#<Thread::Mutex:0x000000000313ff08>, @scheme="Basic", @challenge={}, @cred=nil, @auth={#<Addressable::URI:0x1d73e0c URI:http://localhost:8081/service/siesta/rest/v1/>=>"YWRtaW46YWRtaW4xMjM="}, @force_auth=true>, @digest_auth=#<HTTPClient::DigestAuth:0x000000000313fa08 @_mutex=#<Thread::Mutex:0x000000000313ec98>, @scheme="Digest", @challenge={}, @auth={#<Addressable::URI:0x1d7a478 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @nonce_count=0>, @negotiate_auth=#<HTTPClient::NegotiateAuth:0x000000000313e720 @_mutex=#<Thread::Mutex:0x000000000313c330>, @scheme="Negotiate", @challenge={}, @auth={#<Addressable::URI:0x1d7b620 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, @ntlm_auth=#<HTTPClient::NegotiateAuth:0x00000000031277a0 @_mutex=#<Thread::Mutex:0x00000000031257e8>, @scheme="NTLM", @challenge={}, @auth={#<Addressable::URI:0x1d7abe4 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, @sspi_negotiate_auth=#<HTTPClient::SSPINegotiateAuth:0x0000000003124be0 @_mutex=#<Thread::Mutex:0x0000000003117300>, @scheme="Negotiate", @challenge={}>, @oauth=#<HTTPClient::OAuth:0x00000000031164c8 @_mutex=#<Thread::Mutex:0x0000000003114970>, @scheme="OAuth", @challenge={}, @config=nil, @auth={}, @nonce_count=0, @signature_handler={"HMAC-SHA1"=>#<Method: HTTPClient::OAuth#sign_hmac_sha1>}>, @authenticator=[#<HTTPClient::OAuth:0x00000000031164c8 @_mutex=#<Thread::Mutex:0x0000000003114970>, @scheme="OAuth", @challenge={}, @config=nil, @auth={}, @nonce_count=0, @signature_handler={"HMAC-SHA1"=>#<Method: HTTPClient::OAuth#sign_hmac_sha1>}>, #<HTTPClient::NegotiateAuth:0x000000000313e720 @_mutex=#<Thread::Mutex:0x000000000313c330>, @scheme="Negotiate", @challenge={}, @auth={#<Addressable::URI:0x1d7b620 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, #<HTTPClient::NegotiateAuth:0x00000000031277a0 @_mutex=#<Thread::Mutex:0x00000000031257e8>, @scheme="NTLM", @challenge={}, @auth={#<Addressable::URI:0x1d7abe4 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @auth_default=nil, @ntlm_opt={:ntlmv2=>true}>, #<HTTPClient::SSPINegotiateAuth:0x0000000003124be0 @_mutex=#<Thread::Mutex:0x0000000003117300>, @scheme="Negotiate", @challenge={}>, #<HTTPClient::DigestAuth:0x000000000313fa08 @_mutex=#<Thread::Mutex:0x000000000313ec98>, @scheme="Digest", @challenge={}, @auth={#<Addressable::URI:0x1d7a478 URI:http://localhost:8081/service/siesta/rest/v1/>=>["admin", "admin123"]}, @nonce_count=0>, #<HTTPClient::BasicAuth:0x0000000003159110 @_mutex=#<Thread::Mutex:0x000000000313ff08>, @scheme="Basic", @challenge={}, @cred=nil, @auth={#<Addressable::URI:0x1d73e0c URI:http://localhost:8081/service/siesta/rest/v1/>=>"YWRtaW46YWRtaW4xMjM="}, @force_auth=true>]>], @debug_dev=nil, @redirect_uri_callback=#<Method: HTTPClient#default_redirect_uri_callback>, @test_loopback_response=[], @session_manager=#<HTTPClient::SessionManager:0x00000000030b9250 @client=#<HTTPClient:0x000000000316c3a0 ...>, @proxy=nil, @agent_name="HTTPClient/1.0", @from=nil, @protocol_version=nil, @debug_dev=nil, @socket_sync=true, @tcp_keepalive=false, @chunk_size=16384, @connect_timeout=60, @connect_retry=1, @send_timeout=120, @receive_timeout=60, @keep_alive_timeout=15, @read_block_size=16384, @protocol_retry_count=5, @ssl_config=#<HTTPClient::SSLConfig:0x0000000003091a48 @client=#<HTTPClient:0x000000000316c3a0 ...>, @cert_store=#<OpenSSL::X509::Store:0x0000000003091a20 @verify_callback=nil, @error=nil, @error_string=nil, @chain=nil, @time=nil, @_httpclient_cert_store_items=[:default]>, @cert_store_crl_items=[], @client_ca=nil, @client_key_pass=nil, @client_key=nil, @client_cert=nil, @verify_mode=3, @verify_depth=nil, @verify_callback=nil, @dest=nil, @timeout=nil, @ssl_version=:auto, @options=2197947391, @ciphers="ALL:!aNULL:!eNULL:!SSLv2", @cacerts_loaded=false>, @test_loopback_http_response=[], @transparent_gzip_decompression=false, @strict_response_size_check=false, @socket_local=#<HTTPClient::Site:0x185c48c tcp://0.0.0.0:0>, @sess_pool={#<HTTPClient::Site:0x1d3e4f0 http://localhost:8081>=>[#<HTTPClient::Session:0x0000000003a7c5f8 @client=#<HTTPClient:0x000000000316c3a0 ...>, @dest=#<HTTPClient::Site:0x1d3e4f0 http://localhost:8081>, @proxy=nil, @socket_sync=true, @tcp_keepalive=false, @requested_version=nil, @debug_dev=nil, @connect_timeout=60, @connect_retry=1, @send_timeout=120, @receive_timeout=60, @read_block_size=16384, @protocol_retry_count=5, @ssl_config=#<HTTPClient::SSLConfig:0x0000000003091a48 @client=#<HTTPClient:0x000000000316c3a0 ...>, @cert_store=#<OpenSSL::X509::Store:0x0000000003091a20 @verify_callback=nil, @error=nil, @error_string=nil, @chain=nil, @time=nil, @_httpclient_cert_store_items=[:default]>, @cert_store_crl_items=[], @client_ca=nil, @client_key_pass=nil, @client_key=nil, @client_cert=nil, @verify_mode=3, @verify_depth=nil, @verify_callback=nil, @dest=nil, @timeout=nil, @ssl_version=:auto, @options=2197947391, @ciphers="ALL:!aNULL:!eNULL:!SSLv2", @cacerts_loaded=false>, @ssl_peer_cert=nil, @test_loopback_http_response=[], @strict_response_size_check=false, @socket_local=#<HTTPClient::Site:0x185c48c tcp://0.0.0.0:0>, @agent_name="HTTPClient/1.0", @from=nil, @state=:WAIT, @requests=[], @status=404, @reason="Not Found", @headers=[["Date", "Mon, 05 Feb 2018 15:06:46 GMT"], ["Server", "Nexus/3.2.1-01 (OSS)"], ["X-Frame-Options", "SAMEORIGIN"], ["X-Content-Type-Options", "nosniff"], ["X-Siesta-FaultId", "48e0fb03-3576-4c3a-b3e3-f62dc47ef041"], ["Content-Length", "0"]], @socket=#<TCPSocket:fd 21>, @readbuf=nil, @transparent_gzip_decompression=false, @last_used=2018-02-05 15:06:46 +0000, @next_connection=true, @content_length=0, @chunked=false, @content_encoding=nil, @chunk_length=0, @version="1.1">]}, @sess_pool_mutex=#<Thread::Mutex:0x0000000003092cb8>, @sess_pool_last_checked=2018-02-05 15:06:46 +0000>, @ssl_config=#<HTTPClient::SSLConfig:0x0000000003091a48 @client=#<HTTPClient:0x000000000316c3a0 ...>, @cert_store=#<OpenSSL::X509::Store:0x0000000003091a20 @verify_callback=nil, @error=nil, @error_string=nil, @chain=nil, @time=nil, @_httpclient_cert_store_items=[:default]>, @cert_store_crl_items=[], @client_ca=nil, @client_key_pass=nil, @client_key=nil, @client_cert=nil, @verify_mode=3, @verify_depth=nil, @verify_callback=nil, @dest=nil, @timeout=nil, @ssl_version=:auto, @options=2197947391, @ciphers="ALL:!aNULL:!eNULL:!SSLv2", @cacerts_loaded=false>, @cookie_manager=#<WebAgent::CookieManager:0x000000000308b3c8 @cookies=[], @cookies_file=nil, @is_saved=true, @reject_domains=[], @accept_domains=[], @netscape_rule=false>, @follow_redirect_count=10>>
             end

             System Info:
             ------------
             chef_version=13.7.16
             platform=centos
             platform_version=7.4.1708
             ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
             program_name=chef-client worker: ppid=3014;start=15:04:12;
             executable=/opt/chef/bin/chef-client


           ================================================================================
           Error executing action `create` on resource 'nexus3_user[admin]'
           ================================================================================

           Nexus3::ApiError
           ----------------
           nexus3_api[upsert_user admin] (/tmp/kitchen/cache/cookbooks/nexus3/resources/user.rb line 42) had an error: Nexus3::ApiError: HTTP_STATUS=404

           Cookbook Trace:
           ---------------
           /tmp/kitchen/cache/cookbooks/nexus3/libraries/api.rb:36:in `request'
           /tmp/kitchen/cache/cookbooks/nexus3/libraries/api.rb:41:in `run_script'
           /tmp/kitchen/cache/cookbooks/nexus3/resources/api.rb:40:in `block (2 levels) in class_from_file'
           /tmp/kitchen/cache/cookbooks/nexus3/resources/api.rb:39:in `block in class_from_file'

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/company_nexus/recipes/nexus.rb

            23: nexus3_user 'admin' do
            24:   username 'admin'
            25:   email '[email protected]'
            26:   password 'admin123'
            27:   roles ['nx-admin']
            28:   action :create
            29: end
            30:

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/company_nexus/recipes/nexus.rb:23:in `from_file'

           nexus3_user("admin") do
             action [:create]
             updated true
             updated_by_last_action true
             default_guard_interpreter :default
             declared_type :nexus3_user
             cookbook_name "company_nexus"
             recipe_name "nexus"
             username "admin"
             email "[email protected]"
             password "*sensitive value suppressed*"
             roles ["nx-admin"]
           end

           System Info:
           ------------
           chef_version=13.7.16
           platform=centos
           platform_version=7.4.1708
           ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
           program_name=chef-client worker: ppid=3014;start=15:04:12;
           executable=/opt/chef/bin/chef-client

nexus.log

2018-02-05 15:06:44,893+0000 WARN  [qtp983440579-37] admin org.sonatype.nexus.siesta.internal.WebappExceptionMapper - (ID a6cd2195-5241-4e05-8f3c-5c038aeee24b) Response: [404] (no entity/body); mapped from: javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8081/service/siesta/rest/v1/get_user/run
2018-02-05 15:06:45,424+0000 WARN  [qtp983440579-43] admin org.sonatype.nexus.siesta.internal.WebappExceptionMapper - (ID 5b623a54-1e19-4def-84f0-4553d630b38a) Response: [404] (no entity/body); mapped from: javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8081/service/siesta/rest/v1/get_user
2018-02-05 15:06:46,347+0000 WARN  [qtp983440579-44] admin org.sonatype.nexus.siesta.internal.WebappExceptionMapper - (ID 900852c8-2602-4a94-a8e5-3787054edab5) Response: [404] (no entity/body); mapped from: javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8081/service/siesta/rest/v1/upsert_user
2018-02-05 15:06:46,475+0000 WARN  [qtp983440579-43] admin org.sonatype.nexus.siesta.internal.WebappExceptionMapper - (ID a211b0ae-d49c-489b-a795-f33440f5be2c) Response: [404] (no entity/body); mapped from: javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8081/service/siesta/rest/v1/upsert_user
2018-02-05 15:06:46,533+0000 WARN  [qtp983440579-43] admin org.sonatype.nexus.siesta.internal.WebappExceptionMapper - (ID 48e0fb03-3576-4c3a-b3e3-f62dc47ef041) Response: [404] (no entity/body); mapped from: javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8081/service/siesta/rest/v1/upsert_user/run

from nexus3.

olive42 avatar olive42 commented on August 27, 2024

The Chef run is trying to run the upsert_user script which does not seem to exist on the server; but it should have just been created. The warnings in the logs may just be due to Chef testing the existence of the scripts in load_current_value (from the api resource).

Does this work if you run chef-client again? (or kitchen converge)

from nexus3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.