Skip to content

Conversation

@samuelabreu
Copy link
Contributor

Backtrace:

thread 'tokio-runtime-worker' panicked at src/client.rs:233:55:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: ddv::client::<impl core::convert::From<aws_sdk_dynamodb::types::_local_secondary_index_description::LocalSecondaryIndexDescription> for ddv::data::LocalSecondaryIndexDescription>::from
   5: alloc::vec::in_place_collect::from_iter_in_place
   6: ddv::client::to_table_description
   7: ddv::app::App::load_table_description::{{closure}}
   8: tokio::runtime::task::raw::poll
   9: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  10: tokio::runtime::scheduler::multi_thread::worker::Context::run
  11: tokio::runtime::context::runtime::enter_runtime
  12: tokio::runtime::scheduler::multi_thread::worker::run
  13: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  14: tokio::runtime::task::core::Core<T,S>::poll
  15: tokio::runtime::task::harness::Harness<T,S>::poll
  16: tokio::runtime::blocking::pool::Inner::run

Table which error occur can be created locally (don't know if happens on AWS) with:

aws dynamodb create-table \
  --table-name test1 \
  --endpoint-url http://localhost:8000 \
  --attribute-definitions \
      AttributeName=c_id,AttributeType=N \
      AttributeName=main_id,AttributeType=S \
      AttributeName=main_number,AttributeType=S \
  --key-schema \
      AttributeName=c_id,KeyType=HASH \
      AttributeName=main_id,KeyType=RANGE \
  --local-secondary-indexes '[
      {
        "IndexName": "main_number",
        "KeySchema": [
          {"AttributeName": "c_id", "KeyType": "HASH"},
          {"AttributeName": "main_number", "KeyType": "RANGE"}
        ],
        "Projection": {"ProjectionType": "ALL"}
      }
    ]' \
  --billing-mode PAY_PER_REQUEST

Backtrace:
```
thread 'tokio-runtime-worker' panicked at src/client.rs:233:55:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: ddv::client::<impl core::convert::From<aws_sdk_dynamodb::types::_local_secondary_index_description::LocalSecondaryIndexDescription> for ddv::data::LocalSecondaryIndexDescription>::from
   5: alloc::vec::in_place_collect::from_iter_in_place
   6: ddv::client::to_table_description
   7: ddv::app::App::load_table_description::{{closure}}
   8: tokio::runtime::task::raw::poll
   9: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  10: tokio::runtime::scheduler::multi_thread::worker::Context::run
  11: tokio::runtime::context::runtime::enter_runtime
  12: tokio::runtime::scheduler::multi_thread::worker::run
  13: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  14: tokio::runtime::task::core::Core<T,S>::poll
  15: tokio::runtime::task::harness::Harness<T,S>::poll
  16: tokio::runtime::blocking::pool::Inner::run
```

Table which error occur can be created locally (don't know if happens on
AWS) with:
```sh
aws dynamodb create-table \
  --table-name test1 \
  --endpoint-url http://localhost:8000 \
  --attribute-definitions \
      AttributeName=c_id,AttributeType=N \
      AttributeName=main_id,AttributeType=S \
      AttributeName=main_number,AttributeType=S \
  --key-schema \
      AttributeName=c_id,KeyType=HASH \
      AttributeName=main_id,KeyType=RANGE \
  --local-secondary-indexes '[
      {
        "IndexName": "main_number",
        "KeySchema": [
          {"AttributeName": "c_id", "KeyType": "HASH"},
          {"AttributeName": "main_number", "KeyType": "RANGE"}
        ],
        "Projection": {"ProjectionType": "ALL"}
      }
    ]' \
  --billing-mode PAY_PER_REQUEST
```
@samuelabreu
Copy link
Contributor Author

After i open this pull request i realize wasn't using aws dynamodb image locally, but moto for dynamo service, so this is probably a incomplete implementation by moto.

Sorry for this pull request.

@lusingander
Copy link
Owner

Thanks for reporting this.
Currently, we don't correctly understand when and what values ​​are set, including DynamoDB itself, so we need to sort this out.
For now, since these fields are not currently referenced in the application, I think it's fine to correct them for now.

@lusingander lusingander merged commit dead90a into lusingander:master Sep 28, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants