https://discord.cloudflare.com logo
Join Discord
Powered by
# r2
  • e

    Erisa | Support Engineer

    05/21/2023, 8:11 PM
    seems okay for me on ios safari

    https://cdn.discordapp.com/attachments/940663374377783388/1109936527611535490/IMG_2282.png▾

  • s

    SuperVisor_16

    05/21/2023, 8:11 PM
    For me works okay
  • s

    SuperVisor_16

    05/21/2023, 8:11 PM
    Same
  • e

    Erisa | Support Engineer

    05/21/2023, 8:11 PM
    ERR_NAME_NOT_RESOLVED would imply its failing at the dns level, so maybe the network is intercepting/blocking it?
  • a

    altryne

    05/21/2023, 8:12 PM
    That's my first assumption, but then I checked on both wifi and 4g, with the same result
  • a

    altryne

    05/21/2023, 8:12 PM
    Thanks for testing 🙏 , looks like a local iphone issue, I will keep exploring options
  • R2 Analytics
    z

    Znuff

    05/21/2023, 8:33 PM
    Are there some docs on how to get some statistics from R2?
    c
    • 2
    • 2
  • n

    Noah Kennedy | Oxy

    05/21/2023, 10:25 PM
    I'm currently attempting to post to an R2 bucket via rust's
    reqwest
    library, and I keep getting served errors like
    Date provided in 'date' header (Sun, 21 May 2023 22:07:22 GMT) didn't parse successfully
    . What date format does R2 expect? This matches the format seen on the S3 docs. Alternatively, is this just a misleading error, and another issue is causing me to see failures?
  • k

    kian

    05/21/2023, 11:12 PM
    I've never seen that error personally - is this being returned in the XML body from R2?
  • n

    Noah Kennedy | Oxy

    05/21/2023, 11:14 PM
    yes
  • k

    kian

    05/21/2023, 11:16 PM
    TIL
  • k

    kian

    05/21/2023, 11:17 PM
    Sending a
    Date
    header with
    Sun, 21 May 2023 23:16:00 GMT
    seems to work for me right now - copy/pasting yours gives me a
    RequestTimeTooSkewed
    error as expected.
  • k

    kian

    05/21/2023, 11:17 PM
    Is this with `rust-s3`/`aws-sdk-rs`/`s3`/`whatever` or doing the SigV4 yourself w/
    reqwest
    ?
  • n

    Noah Kennedy | Oxy

    05/21/2023, 11:18 PM
    Copy code
    rust
                    let upload_res = self
                        .http
                        .post(store_uri)
                        .bearer_auth(&self.config.store.key)
                        .header("x-amz-content-sha256", checksum)
                        .header(
                            "Date",
                            chrono::Utc::now()
                                .format("%a, %d %b %Y %H:%M:%S GMT")
                                .to_string(),
                        )
                        .body(upload)
                        .send()
                        .await;
  • i

    Isaac McFadyen | YYZ01

    05/21/2023, 11:18 PM
    rustoto
    (I hope not it's deprecated )
  • n

    Noah Kennedy | Oxy

    05/21/2023, 11:18 PM
    doing it myself
  • n

    Noah Kennedy | Oxy

    05/21/2023, 11:18 PM
    with reqwest
  • k

    kian

    05/21/2023, 11:18 PM
    Is
    store_uri
    a presigned URL?
  • n

    Noah Kennedy | Oxy

    05/21/2023, 11:19 PM
    it is of the form
    https://<ID>.r2.cloudflarestorage.com/<name>
  • k

    kian

    05/21/2023, 11:20 PM
    If it isn't signed ahead of time (i.e with
    x-amz-signature
    and the like in the query params) then I'd expect this to fail as there's no signing - just not with that error
  • k

    kian

    05/21/2023, 11:20 PM
  • n

    Noah Kennedy | Oxy

    05/21/2023, 11:21 PM
    Not super familiar with R2/S3, what should I be doing in general that I am not?
  • k

    kian

    05/21/2023, 11:23 PM
    The
    id.r2.cloudflarestorage.com
    endpoint expects the request to be signed with SigV4 () - you can sign that ahead of time () for a specific bucket, key, operation and with an expiry but generally that's for when you're providing it to users and whatnot.
  • k

    kian

    05/21/2023, 11:23 PM
    You're just getting a red herring error due to the request not being signed, I get it myself if I remove SigV4 now
  • k

    kian

    05/21/2023, 11:25 PM
    https://crates.io/crates/aws-sigv4 (from
    aws-sdk-rs
    ) will accept a request struct and generate it for you, otherwise there's the SDKs that'll manage the upload entirely or signers where you DIY it rather than passing it a request.
  • k

    kian

    05/21/2023, 11:26 PM
    R2 is generally, as far as the S3 API goes, pretty much the same as S3's docs for a given operation. Some things aren't supported () and it also supports some functionality that S3 doesn't ().
  • k

    kian

    05/21/2023, 11:27 PM

    https://cdn.discordapp.com/attachments/940663374377783388/1109985803964256337/image.png▾

  • i

    Isaac McFadyen | YYZ01

    05/21/2023, 11:27 PM
    Haha yeah I know
  • i

    Isaac McFadyen | YYZ01

    05/21/2023, 11:27 PM
    My message was unclear.
  • i

    Isaac McFadyen | YYZ01

    05/21/2023, 11:27 PM
    "I hope not - it's deprecated"
1...103610371038...1050Latest