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

CdnId seems to work, CdnKey not #17

Closed
mjtorn opened this issue Oct 4, 2020 · 1 comment
Closed

CdnId seems to work, CdnKey not #17

mjtorn opened this issue Oct 4, 2020 · 1 comment

Comments

@mjtorn
Copy link
Contributor

mjtorn commented Oct 4, 2020

Hi!

I have chronic problems downloading attachments with the Whisperfish dev version.

There are both network-style timeout errors and 403 return codes.

My MO for rescue is to always run Whisperfish with logging on, hoping real hard all the
relevant information is being logged (that has not always been the case).

The steps to create a rescue script are here https://gitlab.com/rubdos/whisperfish/-/blob/rescue-operations/doc/rescue-instructions.rst

Once I've mangled the log file into a bash script, fingers crossed, attachments are downloaded.

The only file, now that the CdnId and the CdnKey are introduced is the single CdnId one,
no CdnKey is downloaded, it only returns 403.

My hypothesis would be that these are not interchangeable. It would make sense that 403 is
returned instead of 404, to not leak whether or not files exist in the endpoint.

Is there something to my hypothesis? How would I go about decoding the string keys into
integer identifiers?

Thanks!

@rubdos
Copy link
Member

rubdos commented Oct 4, 2020

That means that f84fdeb was incomplete. Got it reproduced now too, thanks for the report.

[2020-10-04T07:49:49Z DEBUG libsignal_service_actix::push_service] AwcPushService::get_stream response:
    ClientResponse HTTP/1.1 403 Forbidden
      headers:
        "x-amz-cf-id": "po5g4p1tIHbNSoS9MD74JwDmVoNE4SEeN22KWERA0pMVw2n-sR2oPg=="
        "x-cache": "Error from cloudfront"
        "x-amz-cf-pop": "FRA50-C1"
        "date": "Sun, 04 Oct 2020 07:49:48 GMT"
        "content-type": "application/xml"
        "server": "AmazonS3"
        "via": "1.1 80c1ad5f9352d00b95a9da73eb6b6be5.cloudfront.net (CloudFront)"
        "connection": "keep-alive"
        "transfer-encoding": "chunked"
[2020-10-04T07:49:49Z ERROR harbour_whisperfish::worker::client] Error fetching attachment for message with ID `14968` AttachmentPointer { content_type: Some("image/jpeg"), key: Some(REDACTED]), size: Some(280222), thumbnail: None, digest: Some([14, 160, 109, 198, 63, 200, 250, 180, 149, 138, 227, 29, 106, 69, 153, 94, 176, 230, 31, 160, 100, 19, 210, 136, 71, 166, 59, 30, 156, 174, 250, 17]), file_name: None, flags: None, width: Some(1029), height: Some(1920), caption: None, blur_hash: Some(REDACTED), upload_timestamp: Some(1601797786058), cdn_number: Some(2), attachment_identifier: Some(CdnKey("4aCM5NdjY5gX9f6bA05g")) }: Unauthorized

       0: backtrace::backtrace::trace
       1: backtrace::capture::Backtrace::new_unresolved
       2: failure::backtrace::internal::InternalBacktrace::new
       3: <failure::backtrace::Backtrace as core::default::Default>::default
       4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       5: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
       6: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
       7: tokio::runtime::task::harness::Harness<T,S>::poll
       8: tokio::task::local::LocalSet::tick
       9: tokio::macros::scoped_tls::ScopedKey<T>::set
      10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
      11: tokio::macros::scoped_tls::ScopedKey<T>::set
      12: tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on
      13: tokio::runtime::context::enter
      14: tokio::runtime::handle::Handle::enter
      15: harbour_whisperfish::main
      16: std::rt::lang_start::{{closure}}
      17: std::rt::lang_start_internal::{{closure}}
                 at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/rt.rs:52:13
          std::panicking::try::do_call
                 at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/panicking.rs:348:40
          std::panicking::try
                 at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/panicking.rs:325:15
          std::panic::catch_unwind
                 at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/panic.rs:394:14
          std::rt::lang_start_internal
                 at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/rt.rs:51:25
      18: main
      19: __libc_start_main

@rubdos rubdos closed this as completed in 09457db Oct 4, 2020
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

No branches or pull requests

2 participants