aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/S3_Access_fails_on_windows.mdwn
blob: fba0c335d3b9fe3e478eec5e60843103e0167c13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
### Please describe the problem.

Attempting to do *anything* with an S3 reomote using git-annex on windows fails with error code 10093 (i.e. WSA_NOT_INITIALISED). 

### What steps will reproduce the problem?

Assuming you have a disabled S3 remote called "the-cloud" (e.g. a fresh clone)
[[!format sh """
C:\annex> git annex enableremote "the-cloud"
enableremote the-cloud gpg: WARNING: using insecure memory!
gpg: please see http://www.gnupg.org/documentation/faqs.html for more information
(checking bucket...) (creating bucket in ap-southeast-2...) git-annex-old: FailedConnectionException2 "my-bucket-name.s3-ap-southeast-2.amazonaws.com" 80 False getAddrInfo: does not exist (error 10093)
"""]]

### What version of git-annex are you using? On what operating system?

git-annex 5.20150113-gcf247cf on windows 8.1

### Please provide any additional information below.

This error is caused by the Winsock library not being initialised before a socket operation is attempted. The patch below fixes the issue, and it should be a no-op on non-Windows platforms.

[[!format patch """
diff --git a/git-annex.hs b/git-annex.hs
index cdaa754..0eed9db 100644
--- a/git-annex.hs
+++ b/git-annex.hs
@@ -21,8 +21,10 @@ import Utility.UserInfo
 import Utility.Env
 #endif

+import Network.Socket (withSocketsDo)
+
 main :: IO ()
-main = do
+main = withSocketsDo $ do
        ps <- getArgs
        run ps =<< getProgName
   where
"""]]