Skip to content

AzBlob: Confusing error message if access_key can't be decoded as base-64 #4108

@amunra

Description

@amunra

This took me a while to hunt down.

We ended up mis-configuring our access_key param for azure blob and this was the error:

Unexpected (persistent) at stat, context: { called: reqsign::Sign, service: azblob, path: index.msgpack } => signing http request, source: base64 decode failed for InvalidByte(85, 61): base64 decode failed for InvalidByte(85, 61)

I've traced this back to the pub async fn sign<T>(&self, req: &mut Request<T>) -> Result<()> { function in core/src/services/azblob/core.rs.

The error I'd expect to read something like:

bad `access_key` configured, could not decode as base-64

Ideally it would be helpful to report the error sooner, say in:

impl Builder for AzblobBuilder {
    fn build(&mut self) -> Result<Self::Accessor> {

Related... I've also noticed separately that building the operator from a map can panic if the map doesn't contain the right keys (e.g. if container is missing).

This is because of this code:

    fn from_map(map: HashMap<String, String>) -> Self {
        let config = AzblobConfig::deserialize(ConfigDeserializer::new(map))
            .expect("config deserialize must **succeed");**

These issues would be a small PR to raise, but I appreciate that with so many service implementations there's probably a "proper" way of doing this in the context of opendal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions