Added a comment
authorjpds <jpds@web>
Tue, 24 Jan 2023 15:55:36 +0000 (15:55 +0000)
committeradmin <admin@branchable.com>
Tue, 24 Jan 2023 15:55:36 +0000 (15:55 +0000)
doc/bugs/S3_remote_errors_with_garage_endpoint/comment_4_f17018fbc7a8205a3ef0bdea74069fb9._comment [new file with mode: 0644]

diff --git a/doc/bugs/S3_remote_errors_with_garage_endpoint/comment_4_f17018fbc7a8205a3ef0bdea74069fb9._comment b/doc/bugs/S3_remote_errors_with_garage_endpoint/comment_4_f17018fbc7a8205a3ef0bdea74069fb9._comment
new file mode 100644 (file)
index 0000000..4a3bdc1
--- /dev/null
@@ -0,0 +1,53 @@
+[[!comment format=mdwn
+ username="jpds"
+ avatar="http://cdn.libravatar.org/avatar/24d746ec6a7726b162c12ecceb3ee267"
+ subject="comment 4"
+ date="2023-01-24T15:55:36Z"
+ content="""
+I think this can all be removed as only the 'region' should be in the `S3.*` calls:
+
+```
+diff --git a/Remote/S3.hs b/Remote/S3.hs
+index f5014202e..d017378a8 100644
+--- a/Remote/S3.hs
++++ b/Remote/S3.hs
+@@ -913,14 +913,7 @@ s3Configuration c = cfg
+                Nothing -> S3.s3RequestStyle cfg
+        }
+   where
+-       h = fromJust $ getRemoteConfigValue hostField c
+        datacenter = fromJust $ getRemoteConfigValue datacenterField c
+-       -- When the default S3 host is configured, connect directly to
+-       -- the S3 endpoint for the configured datacenter.
+-       -- When another host is configured, it's used as-is.
+-       endpoint
+-               | h == AWS.s3DefaultHost = AWS.s3HostName $ T.pack datacenter
+-               | otherwise = T.encodeUtf8 $ T.pack h
+        port = case getRemoteConfigValue portField c of
+                Just s ->
+                        case reads s of
+@@ -948,8 +941,8 @@ s3Configuration c = cfg
+                        | otherwise -> AWS.HTTP
+        cfg = case getRemoteConfigValue signatureField c of
+                Just (SignatureVersion 4) ->
+-                       S3.s3v4 proto endpoint False S3.SignWithEffort
+-               _ -> S3.s3 proto endpoint False
++                       S3.s3v4 proto datacenter False S3.SignWithEffort
++               _ -> S3.s3 proto datacenter False
+
+ data S3Info = S3Info
+        { bucket :: S3.Bucket
+```
+
+But now I get this as an error and I do not know why:
+
+```
+initremote garage (checking bucket...) (creating bucket in garage...)
+git-annex: getRemoteConfigValue datacenter found value of unexpected type [Char]. This is a bug in git-annex!
+CallStack (from HasCallStack):
+  error, called at ./Annex/SpecialRemote/Config.hs:179:28 in main:Annex.SpecialRemote.Config
+  getRemoteConfigValue, called at ./Remote/S3.hs:916:33 in main:Remote.S3
+failed
+initremote: 1 failed
+```
+"""]]