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] Error deleting Table Entity with empty rowkey #36690

Closed
3 tasks done
maheshnapte opened this issue Sep 11, 2023 · 2 comments · Fixed by #36721
Closed
3 tasks done

[BUG] Error deleting Table Entity with empty rowkey #36690

maheshnapte opened this issue Sep 11, 2023 · 2 comments · Fixed by #36721
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables

Comments

@maheshnapte
Copy link

Bug Description:
We are using azure-data-tables-12.3.14 library but getting issue in deleteting table entity with empty rowkey. This was allowed operation in older 8.6.6 library.
As per the document https://learn.microsoft.com/en-us/rest/api/storageservices/Designing-a-Scalable-Partitioning-Strategy-for-Azure-Table-Storage, empty stiring is permited for rowkey and partitionkey.

Exception:
2023-09-11 11:46:47.212 ERROR [ main] com.azure.data.tables.TableClient [MsgID=] : 'partitionKey' and 'rowKey' cannot be null

To Reproduce

  1. Add row in table storage with empty rowkey.
  2. try to delete is using the method
    public Response<Void> deleteEntityWithResponse(TableEntity entity, boolean ifUnchanged, Duration timeout, Context context) avilable in the library.
  3. The exception provided in the Exception section of this bug will be reproduced

Code Snippet
private Response deleteEntityWithResponse(String partitionKey, String rowKey, String eTag, boolean ifUnchanged,
Duration timeout, Context context) {
Context contextValue = TableUtils.setContext(context, true);
OptionalLong timeoutInMillis = TableUtils.setTimeout(timeout);

    String finalETag = ifUnchanged ? eTag : "*";

    if (isNullOrEmpty(partitionKey) || isNullOrEmpty(rowKey)) {
        throw logger.logExceptionAsError(new IllegalArgumentException("'partitionKey' and 'rowKey' cannot be null"));
    }

    Callable<Response<Void>> callable = () -> tablesImplementation.getTables().deleteEntityWithResponse(
        tableName, TableUtils.escapeSingleQuotes(partitionKey), TableUtils.escapeSingleQuotes(rowKey), finalETag, null,
        null, null, contextValue);

    try {
        return timeoutInMillis.isPresent()
            ? THREAD_POOL.submit(callable).get(timeoutInMillis.getAsLong(), TimeUnit.MILLISECONDS)
            : callable.call();
    } catch (Exception ex) {
        Throwable except = mapThrowableToTableServiceException(ex);
        return swallow404Exception(except);
    }
}

Expected behavior
The exeption should not be thrown while deleting a row from the azure table storage with empty partitionKey and rowKey
row.
image

Setup:

  • OS: [Windows 11]
  • IDE: [Spring Toool Suite]
  • Library/Libraries: [com.azure:azure-data-tables:12.3.14 (groupId:artifactId:version)]
  • Java version: [17]
  • App Server/Environment: [Tomcatl]
  • Frameworks: [Spring Boot]

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables labels Sep 11, 2023
@joshfree joshfree changed the title [BUG] [BUG] Error deleting Table Entity with empty rowkey Sep 11, 2023
@joshfree joshfree removed the needs-team-triage Workflow: This issue needs the team to triage. label Sep 11, 2023
@joshfree
Copy link
Member

@jairmyree could you please follow up with @maheshnapte

@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Sep 11, 2023
@jairmyree
Copy link
Member

@maheshnapte Thank you for reaching out, I'll take a look at this and respond soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants