Tigris Upload Failed to Dispatch

Hi, I’m trying to use Tigris to upload a few images using aws-sdk-s3 rust crate. Here is a snippet:

pub async fn example(
    access_key_id: String,
    secret_access_key: String,
    bucket_name: String,
    key: String,
    data: Vec<u8>,
) -> Result<()> {
    let creds = Credentials::new(
        access_key_id,
        secret_access_key,
        None,
        None,
        "provider_name",
    );

    let config = aws_config::defaults(BehaviorVersion::latest())
        .credentials_provider(creds)
        .region(Region::new("auto"))
        .load()
        .await;

    let client = S3Client::new(&config);
    let data = ByteStream::from(data);

    client
        .put_object()
        .bucket(bucket_name)
        .key(&key)
        .body(data)
        .send()
        .await
        .map_err(|e| anyhow::anyhow!(e))?;

    Ok(())
}

I’m getting back a dispatch error from the put_object() call:

 Tigris PUT Failed: dispatch failure

I’ve verified that all my credentials are populating from env vars. This is the signature for Credentials::new

    pub fn new(
        access_key_id: impl Into<String>,
        secret_access_key: impl Into<String>,
        session_token: Option<String>,
        expires_after: Option<SystemTime>,
        provider_name: &'static str,
    ) -> Self 

Anyone have an idea of why the Dispatch Failure may be happening on Tigris?

1 Like

Added storage

From General to Questions / Help

@kennet The snippet looks good, could you also try by explicitly setting the Tigris URL?

 let config = aws_config::defaults(BehaviorVersion::latest())
        .credentials_provider(creds)
        .region(Region::new("auto"))
        .endpoint_url("https://fly.storage.tigris.dev")
        .load()
        .await;

Let me know if that works.

@himank Thank you that solved the problem I was having.

Great!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.