diff --git a/cabal-cache.cabal b/cabal-cache.cabal
--- a/cabal-cache.cabal
+++ b/cabal-cache.cabal
@@ -1,7 +1,7 @@
 cabal-version:          2.2
 
 name:                   cabal-cache
-version:                1.0.0.11
+version:                1.0.0.12
 synopsis:               CI Assistant for Haskell projects
 description:            CI Assistant for Haskell projects.  Implements package caching.
 homepage:               https://github.com/haskell-works/cabal-cache
diff --git a/src/App/Commands/SyncToArchive.hs b/src/App/Commands/SyncToArchive.hs
--- a/src/App/Commands/SyncToArchive.hs
+++ b/src/App/Commands/SyncToArchive.hs
@@ -106,8 +106,12 @@
             let archiveFile         = versionedArchiveUri </> T.pack archiveFileBasename
             let scopedArchiveFile   = versionedArchiveUri </> T.pack storePathHash </> T.pack archiveFileBasename
             let packageStorePath    = storePath </> Z.packageDir pInfo
-            archiveFileExists <- runResourceT $ IO.resourceExists envAws scopedArchiveFile
 
+            -- either write "normal" package, or a user-specific one if the package cannot be shared
+            let targetFile = if canShare planData (Z.packageId pInfo) then archiveFile else scopedArchiveFile
+
+            archiveFileExists <- runResourceT $ IO.resourceExists envAws targetFile
+
             unless archiveFileExists $ do
               packageStorePathExists <- doesDirectoryExist packageStorePath
 
@@ -116,8 +120,6 @@
                 liftIO $ IO.createDirectoryIfMissing True workingStorePackagePath
 
                 let rp2 = Z.relativePaths storePath pInfo
-                -- either write "normal" package, or a user-specific one if the package cannot be shared
-                let targetFile = if canShare planData (Z.packageId pInfo) then archiveFile else scopedArchiveFile
 
                 CIO.putStrLn $ "Creating " <> toText targetFile
 
