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

cosmos attachment missing field id #276

Closed
ctaggart opened this issue May 31, 2021 · 3 comments
Closed

cosmos attachment missing field id #276

ctaggart opened this issue May 31, 2021 · 3 comments
Labels
Cosmos The azure_cosmos crate

Comments

@ctaggart
Copy link
Contributor

The only e2e_test that fails after the #274 fixes is:

     Running tests\attachment_00.rs (target\debug\deps\attachment_00-ee0af8439f1ea0a6.exe)

running 1 test
test attachment ... FAILED

failures:

---- attachment stdout ----
thread 'attachment' panicked at 'called `Result::unwrap()` on an `Err` value: JsonError(Error("missing field `id`", line: 1, column: 2141))', sdk\cosmos\tests\attachment_00.rs:45:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    attachment

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.84s
@ctaggart
Copy link
Contributor Author

ctaggart commented May 31, 2021

Error handling just needs to be updated. Similar to #270, the response status needs to be checked for success.

To reproduce:

cargo test --features test_e2e -p azure_cosmos --test attachment_00 

request body:

{"id":"test-cosmos-db-attachment"}

response body for HTTP status code 409:

{
  "code": "Conflict",
  "message": "Message: {\"Errors\":[\"Resource with specified id, name, or unique index already exists.\"]}\r\nActivityId: 79186e83-164f-43ce-a42e-80190afeca92, Request URI: /apps/3ba0b0ed-c219-4d68-829c-9c648620ce16/services/3d792dfa-f2ed-430c-b40b-9860a1fa851e/partitions/d70eb249-68aa-42bb-8c7f-b8d490167a52/replicas/132657633109063235p, RequestStats: \r\nRequestStartTime: 2021-05-31T18:07:39.3739713Z, RequestEndTime: 2021-05-31T18:07:39.3839546Z,  Number of regions attempted:1\r\nResponseTime: 2021-05-31T18:07:39.3839546Z, StoreResult: StorePhysicalAddress: rntbd://10.0.0.21:11300/apps/3ba0b0ed-c219-4d68-829c-9c648620ce16/services/3d792dfa-f2ed-430c-b40b-9860a1fa851e/partitions/d70eb249-68aa-42bb-8c7f-b8d490167a52/replicas/132657633109063235p, LSN: 511, GlobalCommittedLsn: 511, PartitionKeyRangeId: , IsValid: True, StatusCode: 409, SubStatusCode: 0, RequestCharge: 1.24, ItemLSN: -1, SessionToken: -1#511, UsingLocalLSN: False, TransportException: null, ResourceType: Database, OperationType: Create\r\nResponseTime: 2021-05-31T18:07:39.3839546Z, StoreResult: StorePhysicalAddress: rntbd://10.0.0.21:11300/apps/3ba0b0ed-c219-4d68-829c-9c648620ce16/services/3d792dfa-f2ed-430c-b40b-9860a1fa851e/partitions/d70eb249-68aa-42bb-8c7f-b8d490167a52/replicas/132657633109063235p, LSN: 511, GlobalCommittedLsn: 511, PartitionKeyRangeId: , IsValid: True, StatusCode: 409, SubStatusCode: 0, RequestCharge: 1.24, ItemLSN: -1, SessionToken: -1#511, UsingLocalLSN: False, TransportException: null, ResourceType: Database, OperationType: Create\r\nResponseTime: 2021-05-31T18:07:39.3839546Z, StoreResult: StorePhysicalAddress: rntbd://10.0.0.21:11300/apps/3ba0b0ed-c219-4d68-829c-9c648620ce16/services/3d792dfa-f2ed-430c-b40b-9860a1fa851e/partitions/d70eb249-68aa-42bb-8c7f-b8d490167a52/replicas/132657633109063235p, LSN: 511, GlobalCommittedLsn: 511, PartitionKeyRangeId: , IsValid: True, StatusCode: 409, SubStatusCode: 0, RequestCharge: 1.24, ItemLSN: -1, SessionToken: -1#511, UsingLocalLSN: False, TransportException: null, ResourceType: Database, OperationType: Create\r\n, SDK: Microsoft.Azure.Documents.Common/2.11.0"
}

@MindFlavor
Copy link
Contributor

Can't seem to repro it:

✔ 18:25 ~/src/rust/azure-sdk-for-rust/sdk/cosmos/src [master {origin/master}|✔] $ cargo test --features test_e2e -p azure_cosmos --test attachment_00
    Finished test [unoptimized + debuginfo] target(s) in 0.04s
     Running tests/attachment_00.rs (/home/MINDFLAVOR/mindflavor/src/rust/azure-sdk-for-rust/target/debug/deps/attachment_00-a3ce96b7f67d0bbd)

running 1 test
test attachment ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.91s

Can you please check if you have a test-cosmos-db-attachment database in your subscription? The test fails if it's there (the tests aren't idempotent at the moment if they fail halfway through).

@cataggar cataggar added the Cosmos The azure_cosmos crate label Oct 26, 2021
@rylev
Copy link
Contributor

rylev commented Aug 24, 2022

Closing this as I cannot reproduce. We can open this again if we find out it is still an issue.

@rylev rylev closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cosmos The azure_cosmos crate
Projects
None yet
Development

No branches or pull requests

4 participants