跳到主要內容

關於gsutil crcmod error問題

在stackoverflow上回報後,很快地收到了Mike的回覆:https://stackoverflow.com/questions/23368191/compute-engine-use-gsutil-to-download-tgz-file-has-crcmod-error

The object you're trying to download is a composite object (https://developers.google.com/storage/docs/composite-objects), which basically means it was uploaded in parallel chunks. gsutil automatically does this when uploading objects larger than 150M (a configurable threshold), to provide better performance.
Composite objects only have a crc32c checksum (no MD5), so in order to validate data integrity when downloading composite objects, gsutil needs to perform a crc32c checksum. Unfortunately, the libraries distributed with Python don't include a compiled crc32c implementation, so unless you install a compiled crc32c, gsutil will use a non-compiled Python implementation of crc32c that's quite slow. That warning is printed to let you know there's a way to fix that performance problem: Please run:
gsutil help crcmod
and follow the instructions there for installing a compiled crc32c. It's pretty easy to do it, and worth the effort.
One other note: I strongly recommend against setting check_hashes = never in your boto config file. That will disable integrity checking, which means it's possible your download could get corrupted and you wouldn't know it. You want data integrity checking enabled to ensure you're working with correct data.
Mike

此部分的問題歸因於crc32c這個套件未安裝 
透過"gsutil help crcmod"指令可以列表出各種系統的安裝方式
這點google還滿貼心的 :D

留言

這個網誌中的熱門文章

透過Google Apps Script結合Google Form做即時郵件通知

體驗過Google Apps Script的功能後,也發現他結合GmailApps的模組 GmailApps的應用可以用在表單填寫完成後,做發信的通知 例如您開立了一個訂購的表單,為了要在第一時間通知商家有訂單進入 就可以直接呼叫Gmail做發信的通知,讓手持Smart Phone的我們可以很快的知道生意上門了! 下面規劃三個function,其中: onCommit():為form commit時候觸發的function,需要掛載於form commit trigger上 jsonArrToTable():目的將json array解析成為一個Table getLastRowTable():目的將整個table的回傳過濾為剩下第一筆(表頭,含有Form的欄位說明)與最後一筆(原則上就是剛剛送出的那一筆表單) 完整程式碼如下: function onCommit(){   var sheet = SpreadsheetApp.getActiveSheet();   var rows = sheet.getDataRange();   var numRows = rows.getNumRows();   var values = rows.getValues();   var content = getLastRowTable(values);   var htmlBody = "Hi Admin: <br/><br/>有訂單拉,檢查一下吧! <br/><br/>" + content + '<br/><br/>Send by Google Apps';   GmailApp.sendEmail(     " your-email-address@gmail.com ",      "Order Confirm Notice",      htmlBody,      {from: ' from-email-...

Share a chrome plugin for manage google cloud platform

好玩意兒報報.... 同事的新作,把Google Project List在Chrome Plugin中! 對一次管理多個專案的人來說,真得超方便的拉! 下載: https://chrome.google.com/webstore/detail/gdclauncher/bicgkglnnilldakpenngnblekooejnpg 使用說明: 1. Use browser url bar to quick search: Type "gdcl" in browser Press "TAB" to start search Type the project id key word then select the search result... 2. Using quick launch bar... You can search by keyword or click project name to go to the project or gae link to go to gae or go to billing page....

Apps Script連線MySQL或CloudSQL

Apps Script中連線資料庫也是使用jdbc connection string的方式來連結 感覺起來這邊似乎背後是透過GAE(畢竟也是Java Base的)來連線...(純猜的...) 下面先看看透過Apps Script來連線一般MySQL資料庫的方法: function testMySQL(){   var conn = Jdbc.getConnection('jdbc:mysql:// DB_IP_ADDRESS : DB_PORT / DB_NAME ', ' USERNAME ', ' PASSWORD ');     var stmt = conn.createStatement();   stmt.setMaxRows(100);   var start = new Date();   var sql = "select * from customers";   var rs = stmt.executeQuery(sql);   Logger.log('SQL:' + sql);   while(rs.next()){     Logger.log('['+new Date().toString() + ']' + rs.getString(1) + '::' + rs.getString(2) );   } } 上面範例中connection string的部份,DB_IP_ADDRESS為資料庫的IP位置,DB_PORT為資料庫的連線埠號,記得也把USERNAME與PASSWORD也改一下唷∼ 連線建立完成後,後面的操作也與Java版本相仿 透過建立statement之後,使用statment實體執行sql語句 最後透過result set將值fetch出來... 而Google的Cloud SQL也一樣可以在Apps Script中進行操作 操作之前,先了解一些資訊.... 在新的API Console中,我們可以找到Instance ID,這個值之後...