2017-04-05 71 views
0

我正在嘗試使用gcsfuse裝入谷歌存儲桶。我能夠安裝它,但是當我嘗試使用touch來測試文件內部的文件時,出現輸入/輸出錯誤消息。gcsfuse touch:無法觸摸'test2/test.txt':輸入/輸出錯誤

下面的命令顯示沒有錯誤試圖在所有

[email protected]:~$ sudo gcsfuse -o rw -o allow_other -file-mode=777 -dir-mode=777 --foreground --debug_gcs --debug_http --debug_fuse --debug_invariants company-name-deployment-test test2 

命令給出的結果

Using mount point: /home/my_name/test2 
Opening GCS connection... 

WARNING: gcsfuse invoked as root. This will cause all files to be owned by 
root. If this is not what you intended, invoke gcsfuse as the user that will 
be interacting with the file system. 

Opening bucket... 
gcs: Req    0x0: <- ListObjects() 
http: ========== REQUEST: 
GET http://www.googleapis.com/storage/v1/b/company-name-deployment-test/o?maxResults=1&projection=full HTTP/1.1 
Host: www.googleapis.com 
User-Agent: gcsfuse/0.0 
Authorization: Bearer ya29.EmQkBGU8LBXoLOWE6bt7QU7Ulg9k6_ALV9shBuGILqzZxEf4mE0xXIVuelOscxJiXwLpvNAPO23oNT3oqE1YT8KJxmvcGlhv1XwAV3jOqO2-2NMeB9w1pLreGGXNLMBcxG7NoUIX 
Accept-Encoding: gzip 

http: ========== RESPONSE: 
HTTP/2.0 200 OK 
Content-Length: 31 
Cache-Control: private, max-age=0, must-revalidate, no-transform 
Content-Type: application/json; charset=UTF-8 
Date: Wed, 05 Apr 2017 14:53:47 GMT 
Expires: Wed, 05 Apr 2017 14:53:47 GMT 
Server: UploadServer 
Vary: Origin 
Vary: X-Origin 
X-Guploader-Uploadid: AEnB2Uo_mWOeNeVYEKUDSUgXG5l6OW3rdBghHeFlfzUjDMGMSl4934ZLq57ujokZuJoSAefKXIlqZTjURPcx_HTq0obPy94PgQ 

{ 
"kind": "storage#objects" 
} 
http: ==================== 
gcs: Req    0x0: -> ListObjects() (80.50838ms): OK 
Mounting file system... 
fuse_debug: Op 0x00000001  connection.go:395] <- init 
fuse_debug: Op 0x00000001  connection.go:474] -> OK() 
File system has been successfully mounted. 

試圖觸摸連接到谷歌雲能夠爲:

touch test2/test.txt 
touch: cannot touch ‘test2/test.txt’: Input/output error 

由於我的憑據似乎從調試輸出沒問題還有什麼可能造成的這個輸入/輸出錯誤信息?

閱讀Jacobsa的評論後,我意識到我沒有得到所有的我,我可以打開第二個ssh連接一旦系統被安裝到運行我的命令,而這仍然並試圖觸摸文件中的信息產生:

fuse_debug: Op 0x00000003  connection.go:395] <- LookUpInode (parent 1, name "test.txt") 
gcs: Req    0x1: <- StatObject("test.txt") 
gcs: Req    0x2: <- StatObject("test.txt/") 
http: ========== REQUEST: 
GET http://www.googleapis.com/storage/v1/b/tembo-deployment-test/o/test.txt?projection=full HTTP/1.1 
Host: www.googleapis.com 
User-Agent: gcsfuse/0.0 
Authorization: Bearer ya29.EmQmBNtnKIPWQvvhLiCU-178OTVIA44gXrXRzQaNb5tBTfRpusKgmgmF83FR6QCI1Cg6jACSkZ3iCWyqarhS7WSuPfMUih0gZpKXGSdSg4fQ6VbFQnj7ru24k4erRUTVdR04NrcH 
Accept-Encoding: gzip 

http: ========== REQUEST: 
GET http://www.googleapis.com/storage/v1/b/tembo-deployment-test/o/test.txt%2F?projection=full HTTP/1.1 
Host: www.googleapis.com 
User-Agent: gcsfuse/0.0 
Authorization: Bearer ya29.EmQmBNtnKIPWQvvhLiCU-178OTVIA44gXrXRzQaNb5tBTfRpusKgmgmF83FR6QCI1Cg6jACSkZ3iCWyqarhS7WSuPfMUih0gZpKXGSdSg4fQ6VbFQnj7ru24k4erRUTVdR04NrcH 
Accept-Encoding: gzip 

http: ========== RESPONSE: 
HTTP/2.0 404 Not Found 
Content-Length: 165 
Cache-Control: private, max-age=0 
Content-Type: application/json; charset=UTF-8 
Date: Fri, 07 Apr 2017 15:29:07 GMT 
Expires: Fri, 07 Apr 2017 15:29:07 GMT 
Server: UploadServer 
Vary: Origin 
Vary: X-Origin 
X-Guploader-Uploadid: AEnB2Uo2tVrtHfLuSn2RDpYqO3bgg6gEPL1fjOO2wdBgKGGyNzKHVQXlEoh4ObOx0YH1soFOQijWzXuewbAtMBdNcSxmeHzuGg 

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "notFound", 
    "message": "Not Found" 
    } 
    ], 
    "code": 404, 
    "message": "Not Found" 
} 
} 
http: ==================== 
gcs: Req    0x2: -> StatObject("test.txt/") (54.298126ms): gcs.NotFoundError: googleapi: Error 404: Not Found, notFound 
http: ========== RESPONSE: 
HTTP/2.0 404 Not Found 
Content-Length: 165 
Cache-Control: private, max-age=0 
Content-Type: application/json; charset=UTF-8 
Date: Fri, 07 Apr 2017 15:29:07 GMT 
Expires: Fri, 07 Apr 2017 15:29:07 GMT 
Server: UploadServer 
Vary: Origin 
Vary: X-Origin 
X-Guploader-Uploadid: AEnB2UrAcoLYqm97VH1sDql_CLiVM3_q0EXW_gy1VaxmWJOLksZkcIV78WRFN-Y9hkWmDKN1LJfSz767jkWAhomwoaLqwlFeyw 

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "notFound", 
    "message": "Not Found" 
    } 
    ], 
    "code": 404, 
    "message": "Not Found" 
} 
} 
http: ==================== 
gcs: Req    0x1: -> StatObject("test.txt") (57.69261ms): gcs.NotFoundError: googleapi: Error 404: Not Found, notFound 
fuse_debug: Op 0x00000003  connection.go:476] -> Error: "no such file or directory" 
fuse_debug: Op 0x00000004  connection.go:395] <- CreateFile (parent 1, name "test.txt") 
gcs: Req    0x3: <- CreateObject("test.txt") 
http: ========== REQUEST: 
POST http://www.googleapis.com/upload/storage/v1/b/tembo-deployment-test/o?ifGenerationMatch=0&projection=full&uploadType=resumable HTTP/1.1 
Host: www.googleapis.com 
User-Agent: gcsfuse/0.0 
Content-Length: 156 
Authorization: Bearer ya29.EmQmBNtnKIPWQvvhLiCU-178OTVIA44gXrXRzQaNb5tBTfRpusKgmgmF83FR6QCI1Cg6jACSkZ3iCWyqarhS7WSuPfMUih0gZpKXGSdSg4fQ6VbFQnj7ru24k4erRUTVdR04NrcH 
Content-Type: application/json 
X-Upload-Content-Type: text/plain; charset=utf-8 
Accept-Encoding: gzip 

{"bucket":"tembo-deployment-test","contentType":"text/plain; charset=utf-8","metadata":{"gcsfuse_mtime":"2017-04-07T15:29:07.544167408Z"},"name":"test.txt"} 
http: ========== RESPONSE: 
HTTP/2.0 403 Forbidden 
Content-Length: 208 
Content-Type: application/json; charset=UTF-8 
Date: Fri, 07 Apr 2017 15:29:07 GMT 
Server: UploadServer 
Vary: Origin 
Vary: X-Origin 
Www-Authenticate: Bearer realm="https://accounts.google.com/", error=insufficient_scope, scope="https://www.googleapis.com/auth/cloud-platform" 
X-Guploader-Uploadid: AEnB2UpoWv_gpFyC_fxo8wV5bFBRUX9DLTWEzmNcymxDjERaaml3m-hv4BBmt_kErbFCYj8SYEwka0rkvomWyz1DbusJr-giLw 

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "insufficientPermissions", 
    "message": "Insufficient Permission" 
    } 
    ], 
    "code": 403, 
    "message": "Insufficient Permission" 
} 
} 
http: ==================== 
gcs: Req    0x3: -> CreateObject("test.txt") (14.054889ms): googleapi: Error 403: Insufficient Permission, insufficientPermissions 
fuse_debug: Op 0x00000004  connection.go:476] -> Error: "CreateChildFile: googleapi: Error 403: Insufficient Permission, insufficientPermissions" 
fuse: 2017/04/07 15:29:07.567837 *fuseops.CreateFileOp error: CreateChildFile: googleapi: Error 403: Insufficient Permission, insufficientPermissions 
fuse_debug: Op 0x00000005  connection.go:395] <- LookUpInode (parent 1, name "test.txt") 
gcs: Req    0x4: <- StatObject("test.txt") 
http: ========== REQUEST: 
GET http://www.googleapis.com/storage/v1/b/tembo-deployment-test/o/test.txt?projection=full HTTP/1.1 
Host: www.googleapis.com 
User-Agent: gcsfuse/0.0 
Authorization: Bearer ya29.EmQmBNtnKIPWQvvhLiCU-178OTVIA44gXrXRzQaNb5tBTfRpusKgmgmF83FR6QCI1Cg6jACSkZ3iCWyqarhS7WSuPfMUih0gZpKXGSdSg4fQ6VbFQnj7ru24k4erRUTVdR04NrcH 
Accept-Encoding: gzip 

http: ========== RESPONSE: 
HTTP/2.0 404 Not Found 
Content-Length: 165 
Cache-Control: private, max-age=0 
Content-Type: application/json; charset=UTF-8 
Date: Fri, 07 Apr 2017 15:29:07 GMT 
Expires: Fri, 07 Apr 2017 15:29:07 GMT 
Server: UploadServer 
Vary: Origin 
Vary: X-Origin 
X-Guploader-Uploadid: AEnB2UqxK0wYlDTOf4vT2j_X40E57dJJqEZf8YQL67c_x_3bURpf0xJVJIJuPpc17k0jHUiOAbk4JasDqZd9uD-NK0XNFODJXQ 

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "notFound", 
    "message": "Not Found" 
    } 
    ], 
    "code": 404, 
    "message": "Not Found" 
} 
} 
http: ==================== 
gcs: Req    0x4: -> StatObject("test.txt") (98.990226ms): gcs.NotFoundError: googleapi: Error 404: Not Found, notFound 
fuse_debug: Op 0x00000005  connection.go:476] -> Error: "no such file or directory" 

所以我需要授予我連接的帳戶的權限。

+0

看來你錯過了gcsfuse輸出的重要部分;你只有在文件系統被掛載之前才發佈。遇到實際錯誤時應該輸出。無論如何,這可能與以root身份進行安裝有關 - 你可能不應該這樣做。 – jacobsa

+0

(此外,'--debug_gcs',特別是'--debug_http'不可能在這裏給你任何幫助,只是排除重要輸出。) – jacobsa

+0

之後沒有輸出。它掛在那裏,所以我關閉它看到沒有錯誤消息像其他職位,其中有消息。 我想從這裏我應該ssh到機器在一個單獨的終端,並嘗試觸摸打開它掛的地方,而不是在沒有調試標誌運行之前嘗試實際輸入。謝謝。 – lathomas64

回答

0

運行後$ gcsfuse nmjcloud_jar_test /gcp/gcsfuse/mount --key-file="/home/niaomingjian/gcpconfig/My First Project-6f9cff47c4f0.json", $ touch /gcp/gcsfuse/mount/test.txt在我的測試環境中成功創建了test.txt文件。