Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug(?) on amcsetup to register servers #17

Open
jamesonwildwood opened this issue Aug 26, 2016 · 5 comments
Open

Bug(?) on amcsetup to register servers #17

jamesonwildwood opened this issue Aug 26, 2016 · 5 comments

Comments

@jamesonwildwood
Copy link

Error running the cookbook:

 ================================================================================�[0m
172.20.163.30   �[31mRecipe Compile Error in /var/chef/cache/cookbooks/mulesoft/recipes/default.rb�[0m
172.20.163.30   ================================================================================�[0m
172.20.163.30   
172.20.163.30 �[0m  SocketError�[0m
172.20.163.30   -----------�[0m
172.20.163.30   getaddrinfo: Name or service not known�[0m
172.20.163.30   
172.20.163.30 �[0m  Cookbook Trace:�[0m
172.20.163.30   ---------------�[0m
172.20.163.30     /var/chef/cache/cookbooks/mule/libraries/mule_helper.rb:64:in `anypoint_post'
172.20.163.30 �[0m    /var/chef/cache/cookbooks/mule/libraries/mule_helper.rb:14:in `get_auth_token'
172.20.163.30 �[0m    /var/chef/cache/cookbooks/mule/libraries/mule_helper.rb:7:in `amc_setup'
172.20.163.30 �[0m    /var/chef/cache/cookbooks/mulesoft/recipes/default.rb:78:in `from_file'
172.20.163.30 �[0m    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:336:in `load_recipe'�[0m
172.20.163.30   
172.20.163.30 �[0m  Relevant File Content:�[0m
172.20.163.30   ----------------------�[0m
172.20.163.30   /var/chef/cache/cookbooks/mule/libraries/mule_helper.rb:
172.20.163.30 �[0m  
172.20.163.30 �[0m   57:              response = https.get(uri.path, headers)
172.20.163.30 �[0m   58:          end
172.20.163.30 �[0m   59:  
172.20.163.30 �[0m   60:          def anypoint_post(url, body, headers)
172.20.163.30 �[0m   61:              uri = URI(url)
172.20.163.30 �[0m   62:              https = Net::HTTP.new(uri.host, uri.port)
172.20.163.30 �[0m   63:              https.use_ssl = true
172.20.163.30 �[0m   64>>             response = https.post(uri.path, body, headers)
172.20.163.30 �[0m   65:          end
172.20.163.30 �[0m   66:      end
172.20.163.30 �[0m   67:  end

Usage in the cookbook:

vault = chef_vault_item(:mulesoft, "anypoint")
anypoint_username = vault["anypoint.username"]
anypoint_password = vault["anypoint.password"]

Chef::Recipe.send(:include, Mule::Helper)
regToken = amc_setup(anypoint_username, anypoint_password,'myOrg',node[:mulesoft][:env])

mule_instance "mule-#{node[:hostname]}" do
    enterprise_edition true
    amc_setup regToken
@MrMcCartney
Copy link
Contributor

getaddrinfo: Name or service not known often means that a DNS lookup has failed. I'll look at replicating it as soon as I can to find some concrete causes.

In the mean time, can you check that the FQDN of the server this cookbook is being run on is correct? HTTP libraries for some languages can do a reverse lookup and get weird errors.

@jamesonwildwood
Copy link
Author

Yea, we were having network issues earlier, seems to be resolved now. But I am having trouble registering on ARM.

Everything seems to work except that part. And ARM has decided that our two ESB servers are "Gateways" and not ESB.

@jamesonwildwood
Copy link
Author

172.20.151.31                 Communication between Anypoint Management Center and the Mule Agent is authorized by using two way SSL verification. In the following step we are 
172.20.151.31                 going to create a keystore and request Anypoint Management Center to sign it. Your private key will never leave your machine.
172.20.151.31                 
172.20.151.31                 
172.20.151.31                 Sending Sign request to Anypoint Management Center 
172.20.151.31                 
172.20.151.31                 Mule Agent configured successfully
172.20.151.31                 Connecting to Core Services to extract client_id and client_secret
172.20.151.31                 
172.20.151.31                 The token provided is not valid 
172.20.151.31                 java.lang.RuntimeException: Cannot get Client Secret information from Organization
172.20.151.31                   at com.mulesoft.agent.installer.utils.InstallerCoreServicesUtils.getCoreServicesUserInformation(InstallerCoreServicesUtils.java:65)
172.20.151.31                   at com.mulesoft.agent.installer.HybridInstaller.install(HybridInstaller.java:125)
172.20.151.31                   at com.mulesoft.agent.installer.ScriptOption.runOn(ScriptOption.java:47)
172.20.151.31                   at com.mulesoft.agent.installer.AgentInstaller.main(AgentInstaller.java:97)

@jamesonwildwood
Copy link
Author

Eventually I gave up on it and logged in to register the servers from the command prompt.

@claytonflesher
Copy link
Contributor

As of Mule 3.8.0, an API registered with the Runtime Manager is a gateway by default, I believe.

Per the documentation:

Mule 3.8.0 runtime unifies the API Gateway runtime with the core Mule runtime, eliminating the need to configure API Gateway.

https://docs.mulesoft.com/api-manager/configuring-an-api-gateway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants