Retry the following unexpected errors in gam print users.
Some checks are pending
Build and test GAM / build (Win64, build, 7, VC-WIN64A, windows-2022) (push) Waiting to run
Build and test GAM / build (aarch64, build, 2, linux-aarch64, [self-hosted linux arm64]) (push) Waiting to run
Build and test GAM / build (aarch64, build, 4, linux-aarch64, [self-hosted linux arm64], yes) (push) Waiting to run
Build and test GAM / build (aarch64, build, 6, darwin64-arm64, macos-14) (push) Waiting to run
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 3, linux-x86_64, ubuntu-22.04, yes) (push) Waiting to run
Build and test GAM / build (x86_64, build, 5, darwin64-x86_64, macos-13) (push) Waiting to run
Build and test GAM / build (x86_64, test, 10, ubuntu-24.04, 3.10) (push) Waiting to run
Build and test GAM / build (x86_64, test, 11, ubuntu-24.04, 3.11) (push) Waiting to run
Build and test GAM / build (x86_64, test, 8, ubuntu-24.04, 3.13) (push) Waiting to run
Build and test GAM / build (x86_64, test, 9, ubuntu-24.04, 3.9) (push) Waiting to run
Build and test GAM / merge (push) Blocked by required conditions
Build and test GAM / publish (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Check for Google Root CA Updates / check-apis (push) Waiting to run

ERROR: 400: failedPrecondition - Precondition check failed.
ERROR: 500: unknownError - Unknown Error.
This commit is contained in:
Ross Scroggs
2024-10-07 19:54:34 -07:00
parent caddda2b1c
commit cae58ffb96
5 changed files with 44 additions and 12 deletions

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.00.13'
__version__ = '7.00.14'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@@ -18536,7 +18536,9 @@ def doPrintAliases():
entityList = callGAPIpages(cd.users(), 'list', 'users',
pageMessage=getPageMessage(showFirstLastItems=True), messageAttribute='primaryEmail',
throwReasons=[GAPI.INVALID_ORGUNIT, GAPI.INVALID_INPUT, GAPI.DOMAIN_NOT_FOUND,
GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST],
GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST,
GAPI.UNKNOWN_ERROR, GAPI.FAILED_PRECONDITION],
retryReasons=[GAPI.UNKNOWN_ERROR, GAPI.FAILED_PRECONDITION],
query=query, orderBy='email',
fields=f'nextPageToken,users({",".join(userFields)})',
maxResults=GC.Values[GC.USER_MAX_RESULTS], **kwargs)
@@ -18549,6 +18551,8 @@ def doPrintAliases():
except GAPI.domainNotFound as e:
entityActionFailedWarning([Ent.ALIAS, None, Ent.DOMAIN, kwargs['domain']], str(e))
continue
except (GAPI.unknownError, GAPI.failedPrecondition) as e:
entityActionFailedExit([Ent.USER, None], str(e))
except (GAPI.resourceNotFound, GAPI.forbidden, GAPI.badRequest):
accessErrorExit(cd)
count = len(users)
@@ -18631,9 +18635,13 @@ def doPrintAddresses():
try:
entityList = callGAPIpages(cd.users(), 'list', 'users',
pageMessage=getPageMessage(showFirstLastItems=True), messageAttribute='primaryEmail',
throwReasons=[GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST],
throwReasons=[GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST,
GAPI.UNKNOWN_ERROR, GAPI.FAILED_PRECONDITION],
retryReasons=[GAPI.UNKNOWN_ERROR, GAPI.FAILED_PRECONDITION],
orderBy='email', fields=f'nextPageToken,users({",".join(userFields)})',
maxResults=GC.Values[GC.USER_MAX_RESULTS], **kwargs)
except (GAPI.unknownError, GAPI.failedPrecondition) as e:
entityActionFailedExit([Ent.USER, None], str(e))
except (GAPI.resourceNotFound, GAPI.forbidden, GAPI.badRequest):
accessErrorExit(cd)
for user in entityList:
@@ -44598,7 +44606,9 @@ def doPrintUsers(entityList=None):
feed = yieldGAPIpages(cd.users(), 'list', 'users',
pageMessage=pageMessage, messageAttribute='primaryEmail',
throwReasons=[GAPI.DOMAIN_NOT_FOUND, GAPI.INVALID_ORGUNIT, GAPI.INVALID_INPUT,
GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN,
GAPI.UNKNOWN_ERROR, GAPI.FAILED_PRECONDITION],
retryReasons=[GAPI.UNKNOWN_ERROR, GAPI.FAILED_PRECONDITION],
query=query, fields=fields,
showDeleted=showDeleted, orderBy=orderBy, sortOrder=sortOrder, viewType=viewType,
projection=schemaParms['projection'], customFieldMask=schemaParms['customFieldMask'],
@@ -44639,6 +44649,8 @@ def doPrintUsers(entityList=None):
else:
entityActionFailedWarning([Ent.USER, None], str(e))
continue
except (GAPI.unknownError, GAPI.failedPrecondition) as e:
entityActionFailedExit([Ent.USER, None], str(e))
except (GAPI.badRequest, GAPI.resourceNotFound, GAPI.forbidden):
accessErrorExit(cd)
if showItemCountOnly: