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

"Basic Example" in docs fails when using chunkedFile; works when using hashedFile #596

Closed
mmport80 opened this issue Aug 21, 2020 · 4 comments
Milestone

Comments

@mmport80
Copy link

I received an error (below) when running the basic example. Using hashedFile instead works fine.

ServiceError] {
  service    = S3
  status     = 403 Forbidden
  code       = SignatureDoesNotMatch
  message    = Just The request signature we calculated does not match the signature you provided. Check your key and signing method.
  request-id = Just DD9AFEDDAB839A1C
}
@notquiteamonad
Copy link

Could this be related to #594?

@endgame endgame added this to the 2.0 RC 1 milestone Sep 27, 2021
@endgame endgame changed the title "Basic Example" Problem "Basic Example" in docs fails when using chunkedFile; works when using hashedFile Sep 27, 2021
@endgame
Copy link
Collaborator

endgame commented Sep 27, 2021

#547 may have fixed this; need to check.

@ketzacoatl
Copy link

@endgame can we add a needs-testing or similar tag to the issues like this that need testing before closing?

@endgame
Copy link
Collaborator

endgame commented Oct 12, 2021

I'm calling this fixed because I just uploaded a 2.8GB file using chunkedBody. It used the following sample code:

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}

module Main where

import Control.Exception
import Control.Lens
import Control.Monad.IO.Class
import qualified Data.Conduit.Combinators as C
import Data.Generics.Product
import Network.AWS
import Network.AWS.S3
import Network.HTTP.Client
import System.IO

main :: IO ()
main = do
  let r = NorthVirginia
  lgr <- newLogger Trace stdout
  env <- newEnv Discover <&> set (field @"envLogger") lgr . set (field @"envRegion") r
  res <- runResourceT $ do
    body <- chunkedFile defaultChunkSize "/path/to/bigfile.dat"
    send env $ newPutObject "bucketName" "bigfile.dat" body
  print res

@endgame endgame closed this as completed Oct 12, 2021
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

4 participants