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

Error executing action authorize on resource 'arcgis_enterprise_portal[Authorize Portal for ArcGIS]' #295

Open
mayorvlf opened this issue Nov 24, 2021 · 9 comments

Comments

@mayorvlf
Copy link

================================================================================
Error executing action `authorize` on resource 'arcgis_enterprise_portal[Authorize Portal for ArcGIS]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '127'
---- Begin output of "/arcgis/portal/tools/authorizeSoftware" -f "/opt/software/authorization_files/10.9/ArcGIS_Enterprise_Portal_109_366387_20211123.json" ----
STDOUT:
STDERR: sh: 1: /arcgis/portal/tools/authorizeSoftware: not found
---- End output of "/arcgis/portal/tools/authorizeSoftware" -f "/opt/software/authorization_files/10.9/ArcGIS_Enterprise_Portal_109_366387_20211123.json" ----
Ran "/arcgis/portal/tools/authorizeSoftware" -f "/opt/software/authorization_files/10.9/ArcGIS_Enterprise_Portal_109_366387_20211123.json" returned 127

Cookbook Trace:
---------------
/root/.cinc/local-mode-cache/cache/cookbooks/arcgis-enterprise/providers/portal.rb:292:in `block in class_from_file'

Resource Declaration:
---------------------
# In /root/.cinc/local-mode-cache/cache/cookbooks/arcgis-enterprise/recipes/portal.rb

 54: arcgis_enterprise_portal 'Authorize Portal for ArcGIS' do
 55:   authorization_file node['arcgis']['por

cinc-stacktrace.out.txt
tal']['authorization_file']
56: authorization_file_version node['arcgis']['portal']['authorization_file_version']
57: user_license_type_id node['arcgis']['portal']['user_license_type_id']
58: portal_url node['arcgis']['portal']['url']
59: username node['arcgis']['portal']['admin_username']
60: password node['arcgis']['portal']['admin_password']
61: action :authorize
62: end
63:

Compiled Resource:
------------------
# Declared in /root/.cinc/local-mode-cache/cache/cookbooks/arcgis-enterprise/recipes/portal.rb:54:in `from_file'

arcgis_enterprise_portal("Authorize Portal for ArcGIS") do
  action [:authorize]
  default_guard_interpreter :default
  declared_type :arcgis_enterprise_portal
  cookbook_name "arcgis-enterprise"
  recipe_name "portal"
  authorization_file "/opt/software/authorization_files/10.9/ArcGIS_Enterprise_Portal.json"
  authorization_file_version "10.9"
  user_license_type_id "creatorUT"
  portal_url "https://esr.domain.com:7443/arcgis"
  username "xxxxxxx"
  password "xxxxxxxx"
end

System Info:
------------
chef_version=15.17.4
platform=ubuntu
platform_version=20.04
ruby=ruby 2.6.7p197 (2021-04-05 revision 67941) [x86_64-linux]
program_name=/usr/bin/cinc-client
executable=/opt/cinc/bin/cinc-client
@cameronkroeker
Copy link
Contributor

Hi @mayorvlf,

Could you try the following request in a web browser (on the portal node) to see what is returned?

https://esr.domain.com:7443/arcgis/portaladmin/?f=pjson

We should see a response similar to:

{
    "status": "error",
    "messages": ["The portal site has not been initialized. Please create a new site and try again."],
    "resources": ["license"],
    "isPortalLicensed": false,
    "isLicenseFileRequired": true,
    "isUserTypeLicensing": true,
    "version": "10.9"
}

Thanks,
Cameron K.

@mayorvlf
Copy link
Author

mayorvlf commented Nov 24, 2021

Hi @cameronkroeker I followed your instructions and this is what I get in return from the browser:
{
"error" : {
"code" : 499,
"message" : "Token Required.",
"details" : null
}
}

@cameronkroeker
Copy link
Contributor

Hi @cameronkroeker I followed your instructions and this is what I get in return from the browser: { "error" : { "code" : 499, "message" : "Token Required.", "details" : null } }

Hi @mayorvlf,

This means the portal site already exists which means you'll either need to pass in a token, or login with a portal administrator account then submit the request.

Was the portal site previously created manually or on a different chef run?

Thanks,
Cameron K.

@mayorvlf
Copy link
Author

Hi Cameron,
I was using a different chef run but as errors were coming up had to re-run the recipe after fixing the issue.

@cameronkroeker
Copy link
Contributor

Hi Cameron, I was using a different chef run but as errors were coming up had to re-run the recipe after fixing the issue.

Hi @mayorvlf,

May I ask what steps were taken to resolve the issue?

Thanks,
Cameron K.

@mayorvlf
Copy link
Author

Hi Cameron,
I was able to fix some other issue related to directory location and run the recipe again to continue installation then I ran into this current issue that have not been able to fix for what I understand it is looking for this directory to run the authorization file /arcgis/portal/tools/authorizeSoftware but the authorizeSoftware is missing in that directory.

@cameronkroeker
Copy link
Contributor

cameronkroeker commented Nov 29, 2021

Hi Cameron, I was able to fix some other issue related to directory location and run the recipe again to continue installation then I ran into this current issue that have not been able to fix for what I understand it is looking for this directory to run the authorization file /arcgis/portal/tools/authorizeSoftware but the authorizeSoftware is missing in that directory.

Portal for ArcGIS 10.9 uses user type licenses, which means the authorization file (*.json) is passed through the portal site, and not the Authorization tool. In the cookbooks we do a check to see if its user type licensing or if the authorization needs to be handled by the tool:

action :authorize do
unless ::File.exists?(@new_resource.authorization_file)
raise "File '#{@new_resource.authorization_file}' not found."
end
portal_admin_client = ArcGIS::PortalAdminClient.new(
@new_resource.portal_url,
@new_resource.username,
@new_resource.password)
portal_admin_client.wait_until_available
if portal_admin_client.is_user_type_licensing

If "isUserTypeLicensing": true, is returned then the authorization file will be sent to the Create Site action (I believe this started in 10.7+):

# Create Site
arcgis_enterprise_portal 'Create Portal Site' do
portal_url node['arcgis']['portal']['url']
user_license_type_id node['arcgis']['portal']['user_license_type_id']
authorization_file node['arcgis']['portal']['authorization_file']

But if "isUserTypeLicensing": false, is returned then that means the portal authorization file (*.prvc or *.ecp) needs to be authorized using the tool (10.6.1 and below):

else
# Authorize Portal
cmd = node['arcgis']['portal']['authorization_tool']

This is why I was curious to see what was being returned. For some reason in your case its going into the else statement and trying to authorize the portal license (*.json) via the tool when it should actually be passed into the create site action.

Thanks,
Cameron K.

@cameronkroeker
Copy link
Contributor

Hello @mayorvlf,

I wanted to follow up to see if there has been any progress made on this issue? Also, there is a new release of the cookbooks v3.8.0 that may be worth trying as well.

Thanks,
Cameron K.

@cameronkroeker
Copy link
Contributor

Similar issue:
#257

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

2 participants