oracle / oracle/oci-cli

oci iam user update cannot set email that is previously empty

Open
#771 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

IAM
Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

If a new user does not have an email already set at creation, it appears impossible to add one later.

  • check user properties
$ oci iam user get --user-id ocid1.user.oc1..aaaaaaaao.......{
  "data": {
    "capabilities": {
      "can-use-api-keys": true,
      "can-use-auth-tokens": true,
      "can-use-console-password": true,
      "can-use-customer-secret-keys": true,
      "can-use-db-credentials": true,
      "can-use-o-auth2-client-credentials": true,
      "can-use-smtp-credentials": true
    },
    "compartment-id": "ocid1.tenancy.oc1.....",
    "db-user-name": null,
    "defined-tags": {
      "Oracle-Tags": {
        "CreatedBy": "default/dch@...",
        "CreatedOn": "2024-04-30T10:10:17.233Z"
      }
    },
    "description": "doge",
    "email": null,   <--------------------- problem
    "email-verified": false,
    "external-identifier": "026c4b4fa9c44b53a757117bbd8a0997",
    "freeform-tags": {},
    "id": "ocid1.user.oc1...........",
    "identity-provider-id": null,
    "inactive-status": null,
    "is-mfa-activated": false,
    "last-successful-login-time": null,
    "lifecycle-state": "ACTIVE",
    "name": "dch...",
    "previous-successful-login-time": null,
    "time-created": "2024-04-30T10:10:17.299000+00:00"
  },
  "etag": "d8797afa54604bc290634901c309f108"
}
  • now try to set it
$ oci iam user update --force  --user-id ocid1.user.oc1..... --email dch@...

ServiceError:
{
    "client_version": "Oracle-PythonSDK/2.126.0, Oracle-PythonCLI/3.40.0",
    "code": "IdcsConversionError",
    "logging_tips": "Please run the OCI CLI command using --debug flag to find more debug information.",
    "message": "PATCH request failed{\"schemas\":[\"urn:ietf:params:scim:api:messages:2.0:Error\",\"urn:ietf:params:scim:api:oracle:idcs:extension:messages:Error\"],\"detail\":\"The target path \\\"emails[type eq \\\"work\\\"]\\\" specified in the PATCH operation does not exist.\",\"status\":\"400\",\"urn:ietf:params:scim:api:oracle:idcs:extension:messages:Error\":{\"messageId\":\"error.common.manager.targetAttrNotExists\"}}",
    "opc-request-id": "282B2FC6A86D49F081F50D98648C9FE9/EFACB4476350E30B36D49F7B368690A3/DCFB753987232C948894CC16FA042525",
    "operation_name": "update_user",
    "request_endpoint": "PUT https://identity.....oci.oraclecloud.com/20160918/users/ocid1.user.oc1.....",
    "status": 400,
    "target_service": "identity",
    "timestamp": "2024-04-30T11:06:15.883402+00:00",
    "troubleshooting_tips": "See [https://docs.oracle.com/iaas/Content/API/References/apierrors.htm] for more information about resolving this error. If you are unable to resolve this issue, run this CLI command with --debug option and contact Oracle support and provide them the full error message."
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the oci iam user update command and its update_user operation, reproducing the request against a user whose email is null. Trace the PUT request to the identity endpoint and determine why the work-email PATCH target is missing; done means the same update can add an email and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.