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

logging log-group list returns nothing with --compartmentidinsubtree true #860

Open
jeliker1 opened this issue Oct 17, 2024 · 5 comments
Open

Comments

@jeliker1
Copy link

oci --debug logging log-group list --compartment-id $TF_VAR_tenancy_ocid --compartmentidinsubtree true using tenancy ID for compartment-id returns empty result. Log groups do exist and are returned when specifying certain Compartment IDs

% oci logging log-group list --compartment-id ocid1.tenancy.oc2..aaaaa4szcbbrkxtwhh4abenvl7yfde2d7v5vtsaaatlpjclpzhteqy3ba72a --compartmentidinsubtree true
% oci logging log-group list --compartment-id ocid1.compartment.oc2..aaaaaaaacfnkuvtrj3rm5cqulrepfpkz733japr5iimkqfc6nmwe5aiwca6a
{
  "data": [
    {
      "compartment-id": "ocid1.compartment.oc2..aaaaaaaacfnkuvtrj3rm5cqulrepfpkz733japr5iimkqfc6nmwe5aiwca6a",
      "defined-tags": {
        "Oracle-Tags": {
          "CreatedBy": "default/[email protected]",
          "CreatedOn": "2024-07-12T17:16:19.684Z"
        }
      },
      "description": "Logging for Network resources and services",
      "display-name": "Network",
      "freeform-tags": {},
      "id": "ocid1.loggroup.oc2.us-langley-1.amaaaao6a3v47f5owdk7lz4baapxbh3nngrqvaajfhz6gg23el7vhzrum5gq",
      "lifecycle-state": "ACTIVE",
      "time-created": "2024-07-12T17:16:19.775000+00:00",
      "time-last-modified": "2024-10-17T13:26:08.027000+00:00"
    }
  ]
}
@pankajmjx
Copy link
Member

pankajmjx commented Nov 5, 2024

Hi @jeliker1 Can you share debug logs for both the command using -d option?

oci logging log-group list --compartment-id ocid1.tenancy.oc2..aaaaa4szcbbrkxtwhh4abenvl7yfde2d7v5vtsaaatlpjclpzhteqy3ba72a --compartmentidinsubtree true -d
oci logging log-group list --compartment-id ocid1.compartment.oc2..aaaaaaaacfnkuvtrj3rm5cqulrepfpkz733japr5iimkqfc6nmwe5aiwca6a -d

@jeliker
Copy link

jeliker commented Nov 5, 2024

oci -v
3.49.2

oci logging log-group list -d --compartment-id ocid1.tenancy.oc2..aaaaa4szcbbrkxtwhh4abenvl7yfde2d7v5vtsaaatlpjclpzhteqy3ba72a --compartmentidinsubtree true

DEBUG:oci_cli.cli_metrics: 2024-11-05 17:45:11.210517: Metrics is not enabled
macOS-15.1-arm64-arm-64bit-Mach-O
System name: Darwin
System release : 24.1.0
System version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031

DEBUG:oci_cli.cli_util:Config File: dict_keys(['log_requests', 'additional_user_agent', 'pass_phrase', 'user', 'fingerprint', 'tenancy', 'region', 'key_file'])
DEBUG:oci_cli.cli_util:tenancy: Environment Variable
DEBUG:oci_cli.cli_util:region: Environment Variable or Parameter
DEBUG:oci.base_client.4398019792:Endpoint: https://logging.us-luke-1.oci.oraclegovcloud.com/20200531
INFO:oci.base_client.4398019792: 2024-11-05 17:45:11.244564: Request: GET https://logging.us-luke-1.oci.oraclegovcloud.com/20200531/logGroups
DEBUG:oci.base_client.4398019792: 2024-11-05 17:45:11.716890: time elapsed for request A56D7368A9DF4BAF9C49EC301594B3EB: 0.47228687489405274
DEBUG:oci.base_client.4398019792: 2024-11-05 17:45:11.717029: Response status: 404
DEBUG:oci.base_client.4398019792: 2024-11-05 17:45:11.717121: python SDK time elapsed for deserializing: 8.95909033715725e-06
env OCI_CLI_PROFILE is set
env OCI_CONFIG_PROFILE is set
env OCI_CLI_TENANCY is set
env OCI_PYTHON_SDK_NO_SERVICE_IMPORTS is set
Not using Expect header...
send: b'GET /20200531/logGroups?compartmentId=ocid1.tenancy.oc2..aaaaa4szcbbrkxtwhh4abenvl7yfde2d7v5vtsaaatlpjclpzhteqy3ba72a&isCompartmentIdInSubtree=true HTTP/1.1\r\nuser-agent: Oracle-PythonSDK/2.136.0 (python 3.13.0; arm64-Darwin) Oracle-PythonCLI/3.49.2\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nconnection: keep-alive\r\ncontent-type: application/json\r\nopc-request-id: A56D7368A9DF4BAF9C49EC301594B3EB\r\nopc-client-retries: true\r\nopc-client-info: Oracle-PythonSDK/2.136.0\r\ndate: Tue, 05 Nov 2024 17:45:11 GMT\r\nhost: logging.us-luke-1.oci.oraclegovcloud.com\r\nauthorization: Signature algorithm="rsa-sha256",headers="date (request-target) host",keyId="ocid1.tenancy.oc2..aaaaaaaag3phd3ixt67kod45ugbngezenpfdldrdpy2bbzx6j7a727eupxwa/ocid1.user.oc2..aaaaaaaaacwinrge4zenga6qlgudbtz2m63tgwpq5zyurj63fjwrb2cyrgoq/2b:b8:1f:9d:1e:ee:e8:21:08:a7:2d:bd:58:a8:fd:34",signature="bzGduaS7knK8AKFIgsBUYfoSO9Yl7ujyN/7E87e2DJoW/iLql6hYWmeHmmDzWEGLvJAw7fdik3X6yd50P0S7SPJ+7vupg+0ZtDWZIzkOql/1/j3zQtvOSHUpOuBRwUa3I/f15kaH1NZ4F9+J6ARmRyMTQhXdZNCuq/IWQEGkhsX8hPjU+uQv8ZiJJ6FIZY2RZHNXPBaZPh7Z6KscTeQDiYudve9oJgJviCGeKd/J2BJNqx+PelOfBx0mu7dJo7UU/emPlAFO9elyqAD8Ew86iCqZ+dhdHO+RyntSeRG8WoNZjMeEHw8UwsenFHHjWXO80oliOrFyW0jlg6w0eT7YlA==",version="1"\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Date: Tue, 05 Nov 2024 17:45:11 GMT
header: opc-request-id: A56D7368A9DF4BAF9C49EC301594B3EB/E32DCED2B1D092C37ECC0B245F378005/5E1CECE1D9B51F6F15042BED8B1693B6
header: Content-Type: application/json
header: Strict-Transport-Security: max-age=31536000; includeSubDomains;
header: Content-Length: 111
Traceback (most recent call last):
  File "/opt/homebrew/bin/oci", line 8, in <module>
    sys.exit(cli())
             ~~~^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci_cli/json_skeleton_utils.py", line 78, in wrapped_call
    func(ctx, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci_cli/cli_util.py", line 925, in wrapped_call
    func(ctx, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/services/logging/src/oci_cli_logging_management/loggingmanagement_cli_extended.py", line 57, in list_log_groups_extended
    ctx.invoke(loggingmanagement_cli.list_log_groups, **kwargs)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci_cli/json_skeleton_utils.py", line 78, in wrapped_call
    func(ctx, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci_cli/cli_util.py", line 925, in wrapped_call
    func(ctx, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/services/logging/src/oci_cli_logging_management/generated/loggingmanagement_cli.py", line 1229, in list_log_groups
    result = client.list_log_groups(
        compartment_id=compartment_id,
        **kwargs
    )
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/logging/logging_management_client.py", line 2131, in list_log_groups
    return retry_strategy.make_retrying_call(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self.base_client.call_api,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
        api_reference_link=api_reference_link,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        required_arguments=required_arguments)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/retry/retry.py", line 308, in make_retrying_call
    response = func_ref(*func_args, **func_kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/base_client.py", line 535, in call_api
    response = self.request(request, allow_control_chars, operation_name, api_reference_link)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/circuitbreaker.py", line 146, in wrapper
    return self.call(function, *args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/circuitbreaker.py", line 188, in call
    return func(*args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/base_client.py", line 726, in request
    self.raise_service_error(request, response, service_code, message, operation_name, api_reference_link, target_service, request_endpoint, client_version, timestamp, deserialized_data)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/base_client.py", line 891, in raise_service_error
    raise exceptions.ServiceError(
    ...<11 lines>...
        deserialized_data=deserialized_data)
oci.exceptions.ServiceError: {'target_service': 'logging_management', 'status': 404, 'code': 'NotAuthorizedOrNotFound', 'opc-request-id': 'A56D7368A9DF4BAF9C49EC301594B3EB/E32DCED2B1D092C37ECC0B245F378005/5E1CECE1D9B51F6F15042BED8B1693B6', 'message': 'Authorization failed or requested resource not found.', 'operation_name': 'list_log_groups', 'timestamp': '2024-11-05T17:45:11.717057+00:00', 'client_version': 'Oracle-PythonSDK/2.136.0', 'request_endpoint': 'GET https://logging.us-luke-1.oci.oraclegovcloud.com/20200531/logGroups', 'logging_tips': 'To get more info on the failing request, refer to https://docs.oracle.com/en-us/iaas/tools/python/latest/logging.html for ways to log the request/response details.', 'troubleshooting_tips': "See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors_404__404_notauthorizedornotfound for more information about resolving this error. Also see https://docs.oracle.com/iaas/api/#/en/logging-management/20200531/LogGroupSummary/ListLogGroups for details on this operation's requirements. If you are unable to resolve this logging_management issue, please contact Oracle support and provide them this full error message."}

@jeliker
Copy link

jeliker commented Nov 5, 2024

oci logging log-group list -d --compartment-id ocid1.compartment.oc2..aaaaaaaacfnkuvtrj3rm5cqulrepfpkz733japr5iimkqfc6nmwe5aiwca6a

DEBUG:oci_cli.cli_metrics: 2024-11-05 17:46:30.551206: Metrics is not enabled
macOS-15.1-arm64-arm-64bit-Mach-O
System name: Darwin
System release : 24.1.0
System version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031

DEBUG:oci_cli.cli_util:Config File: dict_keys(['log_requests', 'additional_user_agent', 'pass_phrase', 'user', 'fingerprint', 'tenancy', 'region', 'key_file'])
DEBUG:oci_cli.cli_util:tenancy: Environment Variable
DEBUG:oci_cli.cli_util:region: Environment Variable or Parameter
DEBUG:oci.base_client.4350833872:Endpoint: https://logging.us-luke-1.oci.oraclegovcloud.com/20200531
INFO:oci.base_client.4350833872: 2024-11-05 17:46:30.585823: Request: GET https://logging.us-luke-1.oci.oraclegovcloud.com/20200531/logGroups
DEBUG:oci.base_client.4350833872: 2024-11-05 17:46:31.084108: time elapsed for request 1E255D3E40A44E86AD338D588DD55885: 0.4982465000357479
DEBUG:oci.base_client.4350833872: 2024-11-05 17:46:31.084281: Response status: 404
DEBUG:oci.base_client.4350833872: 2024-11-05 17:46:31.084428: python SDK time elapsed for deserializing: 8.584000170230865e-06
env OCI_CLI_PROFILE is set
env OCI_CONFIG_PROFILE is set
env OCI_CLI_TENANCY is set
env OCI_PYTHON_SDK_NO_SERVICE_IMPORTS is set
Not using Expect header...
send: b'GET /20200531/logGroups?compartmentId=ocid1.compartment.oc2..aaaaaaaacfnkuvtrj3rm5cqulrepfpkz733japr5iimkqfc6nmwe5aiwca6a HTTP/1.1\r\nuser-agent: Oracle-PythonSDK/2.136.0 (python 3.13.0; arm64-Darwin) Oracle-PythonCLI/3.49.2\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nconnection: keep-alive\r\ncontent-type: application/json\r\nopc-request-id: 1E255D3E40A44E86AD338D588DD55885\r\nopc-client-retries: true\r\nopc-client-info: Oracle-PythonSDK/2.136.0\r\ndate: Tue, 05 Nov 2024 17:46:30 GMT\r\nhost: logging.us-luke-1.oci.oraclegovcloud.com\r\nauthorization: Signature algorithm="rsa-sha256",headers="date (request-target) host",keyId="ocid1.tenancy.oc2..aaaaaaaag3phd3ixt67kod45ugbngezenpfdldrdpy2bbzx6j7a727eupxwa/ocid1.user.oc2..aaaaaaaaacwinrge4zenga6qlgudbtz2m63tgwpq5zyurj63fjwrb2cyrgoq/2b:b8:1f:9d:1e:ee:e8:21:08:a7:2d:bd:58:a8:fd:34",signature="tfxXke/6oXLE0rnBTgqKz5RCU9yEl8MCkj4a3/dmv5gF9NrSxGaPj7bsp077iFEjvlZw9wEO/4BwTnCwjFIALq/WmzrBb7htBZlr+/hKBzfTjXXOKyKHynLYH7GSmNn80gzFyUh/eCyzxKTK8WFvo49YWeIFKDumlqQmFIiYM3BstacChdrz4/J/1pYlb7or8kvZwNbxhTKGy9OtWQaHuE9lWGqtyCTMOarZ51UFOoHayvtUf+H9HhMTWUE1N/h6PEvunG3DSzi/A7DY4pB28n6xx7DstbugcJkAs97tHDnaVatW+zzpDqKpD0C8+/7kA9pPU89F6f8XszYCYLjHAg==",version="1"\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Date: Tue, 05 Nov 2024 17:46:31 GMT
header: opc-request-id: 1E255D3E40A44E86AD338D588DD55885/8BF47849F7B695C83377CEA43160D47F/62A8250C226786F63994CF213CACD93A
header: Content-Type: application/json
header: Strict-Transport-Security: max-age=31536000; includeSubDomains;
header: Content-Length: 111
Traceback (most recent call last):
  File "/opt/homebrew/bin/oci", line 8, in <module>
    sys.exit(cli())
             ~~~^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci_cli/json_skeleton_utils.py", line 78, in wrapped_call
    func(ctx, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci_cli/cli_util.py", line 925, in wrapped_call
    func(ctx, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/services/logging/src/oci_cli_logging_management/loggingmanagement_cli_extended.py", line 57, in list_log_groups_extended
    ctx.invoke(loggingmanagement_cli.list_log_groups, **kwargs)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci_cli/json_skeleton_utils.py", line 78, in wrapped_call
    func(ctx, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci_cli/cli_util.py", line 925, in wrapped_call
    func(ctx, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/services/logging/src/oci_cli_logging_management/generated/loggingmanagement_cli.py", line 1229, in list_log_groups
    result = client.list_log_groups(
        compartment_id=compartment_id,
        **kwargs
    )
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/logging/logging_management_client.py", line 2131, in list_log_groups
    return retry_strategy.make_retrying_call(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self.base_client.call_api,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
        api_reference_link=api_reference_link,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        required_arguments=required_arguments)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/retry/retry.py", line 308, in make_retrying_call
    response = func_ref(*func_args, **func_kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/base_client.py", line 535, in call_api
    response = self.request(request, allow_control_chars, operation_name, api_reference_link)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/circuitbreaker.py", line 146, in wrapper
    return self.call(function, *args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/circuitbreaker.py", line 188, in call
    return func(*args, **kwargs)
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/base_client.py", line 726, in request
    self.raise_service_error(request, response, service_code, message, operation_name, api_reference_link, target_service, request_endpoint, client_version, timestamp, deserialized_data)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/oci-cli/3.49.2/libexec/lib/python3.13/site-packages/oci/base_client.py", line 891, in raise_service_error
    raise exceptions.ServiceError(
    ...<11 lines>...
        deserialized_data=deserialized_data)
oci.exceptions.ServiceError: {'target_service': 'logging_management', 'status': 404, 'code': 'NotAuthorizedOrNotFound', 'opc-request-id': '1E255D3E40A44E86AD338D588DD55885/8BF47849F7B695C83377CEA43160D47F/62A8250C226786F63994CF213CACD93A', 'message': 'Authorization failed or requested resource not found.', 'operation_name': 'list_log_groups', 'timestamp': '2024-11-05T17:46:31.084348+00:00', 'client_version': 'Oracle-PythonSDK/2.136.0', 'request_endpoint': 'GET https://logging.us-luke-1.oci.oraclegovcloud.com/20200531/logGroups', 'logging_tips': 'To get more info on the failing request, refer to https://docs.oracle.com/en-us/iaas/tools/python/latest/logging.html for ways to log the request/response details.', 'troubleshooting_tips': "See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors_404__404_notauthorizedornotfound for more information about resolving this error. Also see https://docs.oracle.com/iaas/api/#/en/logging-management/20200531/LogGroupSummary/ListLogGroups for details on this operation's requirements. If you are unable to resolve this logging_management issue, please contact Oracle support and provide them this full error message."}

@karthik-k-kamath
Copy link
Member

Hi Jon,
OCI CLI currently only supports till Python 3.11 and we plan to add support for 3.12 by Dec, so can you please check against Python 3.11 and confirm if this issue is resolved or still exists?

@jeliker1
Copy link
Author

Same error with 3.11 (note I realize I made error on last using wrong profile; corrected here but, as I say, same error as originally reported). You'll see I get one log group if I request with compartment but get empty result if I request from tenancy with ---compartmentidinsubtree true. I have tried across multiple OC1 and OC2 tenancies with same result.

Are you saying you do not get this error? It's very easy to test as you see.

% oci -v
3.50.1

oci logging log-group list --compartment-id ocid1.compartment.oc2..aaaaaaaavaiucxfizsxdtshansuqenksf5hjg2c36prreyrxv5pkpdvlsoua -d

DEBUG:oci_cli.cli_metrics: 2024-11-12 15:17:17.551596: Metrics is not enabled
macOS-15.1-arm64-arm-64bit
System name: Darwin
System release : 24.1.0
System version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031

env OCI_CLI_PROFILE is set
env OCI_CONFIG_PROFILE is set
env OCI_CLI_TENANCY is set
env OCI_PYTHON_SDK_NO_SERVICE_IMPORTS is set
DEBUG:oci_cli.cli_util:Config File: dict_keys(['log_requests', 'additional_user_agent', 'pass_phrase', 'user', 'fingerprint', 'tenancy', 'region', 'key_file'])
DEBUG:oci_cli.cli_util:tenancy: Environment Variable
DEBUG:oci_cli.cli_util:region: Environment Variable or Parameter
DEBUG:oci.base_client.4396999632:Endpoint: https://logging.us-langley-1.oci.oraclegovcloud.com/20200531
INFO:oci.base_client.4396999632: 2024-11-12 15:17:17.609636: Request: GET https://logging.us-langley-1.oci.oraclegovcloud.com/20200531/logGroups
Not using Expect header...
send: b'GET /20200531/logGroups?compartmentId=ocid1.compartment.oc2..aaaaaaaavaiucxfizsxdtshansuqenksf5hjg2c36prreyrxv5pkpdvlsoua HTTP/1.1\r\nuser-agent: Oracle-PythonSDK/2.138.1 (python 3.11.10; arm64-Darwin) Oracle-PythonCLI/3.50.1\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nconnection: keep-alive\r\ncontent-type: application/json\r\nopc-request-id: 02A5045687A84D028C0EEBB41BAF0F2D\r\nopc-client-retries: true\r\nopc-client-info: Oracle-PythonSDK/2.138.1\r\ndate: Tue, 12 Nov 2024 15:17:17 GMT\r\nhost: logging.us-langley-1.oci.oraclegovcloud.com\r\nauthorization: Signature algorithm="rsa-sha256",headers="date (request-target) host",keyId="ocid1.tenancy.oc2..aaaaaaaatlpjclpzhteqycbbrkxtwhh4abe4szl7yfde2d7v5vtsnv3ba72a/ocid1.user.oc2..aaaaaaaaaaen4qzmthm77pxdxabegb6gfl644s6sxnk543xw7vylxa7v4l3a/06:f2:70:d0:83:55:db:68:c9:64:92:03:d1:5a:08:d2",signature="w/8dQooYiAkpY4uLHzkGE748BTwRnexe4nmTIK2+XzvorOcGpp52OdEz9qIkFWf2E1QwI6lfGP/FjlWG/G/Cy4azgR3+6S20XBQHCn3kHDw1XtyvLMdrFfUi+LPsf82YtwZ7mnxn8rstOF7tAQ2hs0D4hK8BAWJg08mwLurK5JoQ2iXsNLn0aFITwCPjdmtkAI7FGlR9U2teufWQOLVnL7Q8CFZgsd8TwWfAn62cA/0HSjXTfORtx+9R96RDjFELvfiUaReyj0thkTUuPytzI5UtD+FVdB/0bubAGwc/v+kZ/t3UZvN3/kG6x+00IN+6P1j+cbw6GuqT/oQF3o3YTQ==",version="1"\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Tue, 12 Nov 2024 15:17:17 GMT
header: opc-request-id: 02A5045687A84D028C0EEBB41BAF0F2D/5F9B50A58496F53705F296CB45B6057A
header: Strict-Transport-Security: max-age=31536000; includeSubDomains
header: X-Content-Type-Options: nosniff
header: X-Content-Type-Options: nosniff
header: Content-Type: application/json
header: Content-Length: 537
DEBUG:oci.base_client.4396999632: 2024-11-12 15:17:17.947093: time elapsed for request 02A5045687A84D028C0EEBB41BAF0F2D: 0.33741929079405963
DEBUG:oci.base_client.4396999632: 2024-11-12 15:17:17.947314: time elapsed in response: 0:00:00.330884
DEBUG:oci.base_client.4396999632: 2024-11-12 15:17:17.947406: Response status: 200
DEBUG:oci.base_client.4396999632: 2024-11-12 15:17:17.949229: python SDK time elapsed for deserializing: 0.0016965409740805626
DEBUG:oci.base_client.4396999632: 2024-11-12 15:17:17.949364: Response returned
DEBUG:oci.base_client.4396999632:time elapsed for request: 0.33980974997393787
DEBUG:oci_cli.cli_util: 2024-11-12 15:17:17.949818: time elapsed calling to_dict from render: 0.000306915957480669
DEBUG:oci_cli.cli_util: 2024-11-12 15:17:18.369758: total memory usage before printing: 69.8MiB (73220096)
{
  "data": [
    {
      "compartment-id": "ocid1.compartment.oc2..aaaaaaaavaiucxfizsxdtshansuqenksf5hjg2c36prreyrxv5pkpdvlsoua",
      "defined-tags": {
        "Oracle-Tags": {
          "CreatedBy": "default/[email protected]",
          "CreatedOn": "2024-10-17T13:26:07.745Z"
        }
      },
      "description": "Logging for Management systems and resources",
      "display-name": "Management",
      "freeform-tags": {},
      "id": "ocid1.loggroup.oc2.us-langley-1.amaaaaaapxgrqvaaedm5yyd62ujlzm6ie7q4x7pbfgakmhb7rl5ejjlw3qnq",
      "lifecycle-state": "ACTIVE",
      "time-created": "2024-10-17T13:26:07.799000+00:00",
      "time-last-modified": "2024-10-17T13:26:07.799000+00:00"
    }
  ]
}
DEBUG:oci_cli.cli_util: 2024-11-12 15:17:18.370001: Time elapsed printing response data: <1ms
DEBUG:oci_cli.cli_util: 2024-11-12 15:17:18.370037: total memory usage after printing: 69.8MiB (73220096)

oci logging log-group list --compartment-id ocid1.tenancy.oc2..aaaaaaaatlpjclpzhteqycbbrkxtwhh4abe4szl7yfde2d7v5vtsnv3ba72a --compartmentidinsubtree true -d

DEBUG:oci_cli.cli_metrics: 2024-11-12 15:23:02.990979: Metrics is not enabled
macOS-15.1-arm64-arm-64bit
System name: Darwin
System release : 24.1.0
System version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031

env OCI_CLI_PROFILE is set
env OCI_CONFIG_PROFILE is set
env OCI_CLI_TENANCY is set
env OCI_PYTHON_SDK_NO_SERVICE_IMPORTS is set
DEBUG:oci_cli.cli_util:Config File: dict_keys(['log_requests', 'additional_user_agent', 'pass_phrase', 'user', 'fingerprint', 'tenancy', 'region', 'key_file'])
DEBUG:oci_cli.cli_util:tenancy: Environment Variable
DEBUG:oci_cli.cli_util:region: Environment Variable or Parameter
DEBUG:oci.base_client.4367514256:Endpoint: https://logging.us-langley-1.oci.oraclegovcloud.com/20200531
INFO:oci.base_client.4367514256: 2024-11-12 15:23:03.052710: Request: GET https://logging.us-langley-1.oci.oraclegovcloud.com/20200531/logGroups
Not using Expect header...
send: b'GET /20200531/logGroups?compartmentId=ocid1.tenancy.oc2..aaaaaaaatlpjclpzhteqycbbrkxtwhh4abe4szl7yfde2d7v5vtsnv3ba72a&isCompartmentIdInSubtree=true HTTP/1.1\r\nuser-agent: Oracle-PythonSDK/2.138.1 (python 3.11.10; arm64-Darwin) Oracle-PythonCLI/3.50.1\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nconnection: keep-alive\r\ncontent-type: application/json\r\nopc-request-id: DFFB01D457104FC78CBEB93BC9A5BB60\r\nopc-client-retries: true\r\nopc-client-info: Oracle-PythonSDK/2.138.1\r\ndate: Tue, 12 Nov 2024 15:23:03 GMT\r\nhost: logging.us-langley-1.oci.oraclegovcloud.com\r\nauthorization: Signature algorithm="rsa-sha256",headers="date (request-target) host",keyId="ocid1.tenancy.oc2..aaaaaaaatlpjclpzhteqycbbrkxtwhh4abe4szl7yfde2d7v5vtsnv3ba72a/ocid1.user.oc2..aaaaaaaaaaen4qzmthm77pxdxabegb6gfl644s6sxnk543xw7vylxa7v4l3a/06:f2:70:d0:83:55:db:68:c9:64:92:03:d1:5a:08:d2",signature="KNsP0bOXB+nsA2cnRJle/fhU3+JaJRPlEsb6/C2ftpELKB23cXY/7JK9ZOADXzxwGZ3Gu/dq19p7lOL39OZ6Lua3mXHbaGV8Z5ol8UCTLu8gL8m3FBR9MW4z+zkj3/qhIPz56LnhPoBsgFLrZ0TWjS+LwfnmqWdiiR+1ZVH/B6kbVIib+qSZIcqeEcTgHoYH1enhTX85KMkWNE30Dpw7pT9/yQXVFGZcQ6JqHlabA6cS64QrD5TcoX2DGsT2iht8rFiaH3ha9HkfRY7UvAy1+M5xbS4+GcVktw+s+KOaFshirB8lMU+3KY8WHrT2/ULMZvXHo7HzmS7iWqMfu+pwog==",version="1"\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Tue, 12 Nov 2024 15:23:03 GMT
header: opc-request-id: DFFB01D457104FC78CBEB93BC9A5BB60/46598A1361A4FC1C48BCCBEA87B51793
header: Strict-Transport-Security: max-age=31536000; includeSubDomains
header: X-Content-Type-Options: nosniff
header: X-Content-Type-Options: nosniff
header: Content-Type: application/json
header: Content-Length: 2
DEBUG:oci.base_client.4367514256: 2024-11-12 15:23:03.342299: time elapsed for request DFFB01D457104FC78CBEB93BC9A5BB60: 0.289553957991302
DEBUG:oci.base_client.4367514256: 2024-11-12 15:23:03.342539: time elapsed in response: 0:00:00.281317
DEBUG:oci.base_client.4367514256: 2024-11-12 15:23:03.342658: Response status: 200
DEBUG:oci.base_client.4367514256: 2024-11-12 15:23:03.342866: python SDK time elapsed for deserializing: 0.00012262491509318352
DEBUG:oci.base_client.4367514256: 2024-11-12 15:23:03.342915: Response returned
DEBUG:oci.base_client.4367514256:time elapsed for request: 0.2902654579374939

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

4 participants