Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php and nodejs aws-client doen't copy object properly copied file become 0 Byte #148

Closed
rr-paras-patel opened this issue Mar 4, 2014 · 5 comments

Comments

@rr-paras-patel
Copy link

LeoFS Version :

[System config]
                System version : 1.0.0-pre3
                    Cluster Id : cluster_1
                         DC Id : dc_1
                Total replicas : 2
           # of successes of R : 1
           # of successes of W : 1
           # of successes of D : 1
 # of DC-awareness replicas    : 0
 # of Rack-awareness replicas  : 0
                     ring size : 2^128
             Current ring hash : 9a2581a2
                Prev ring hash : 9a2581a2
[Node(s) state]
-------+--------------------------+--------------+----------------+----------------+----------------------------
 type  |           node           |    state     |  current ring  |   prev ring    |          updated at         
-------+--------------------------+--------------+----------------+----------------+----------------------------
  S    | [email protected]      | running      | 9a2581a2       | 9a2581a2       | 2014-03-04 10:45:32 +0900
  S    | [email protected]      | running      | 9a2581a2       | 9a2581a2       | 2014-03-04 10:45:32 +0900
  S    | [email protected]      | running      | 9a2581a2       | 9a2581a2       | 2014-03-04 10:45:33 +0900
  S    | [email protected]      | running      | 9a2581a2       | 9a2581a2       | 2014-03-04 10:45:33 +0900

System :

$uname -a
Linux localhost.localdomain 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
CentOS 6.3

$php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

I would like to give example of php client object copy method :
Assumption :
bucket-name : test
file exist on bucket : README

$result = $client->copyObject(array( "Bucket" => "test", "CopySource" => "/test/README", "Key" => "README.copy",));

Request Header object :

Host: test.localhost:8081
User-Agent: aws-sdk-php2/2.5.3 Guzzle/3.8.1 curl/7.19.7 PHP/5.3.3
x-amz-copy-source: /test/README
Date: Tue, 04 Mar 2014 08:08:21 +0000
Authorization: AWS 05236:q747YzZHx8zJd7+jDKXXzPsCxV0=
Content-Length: 0

i tried with all possible option for CopySource parameter :
e.g.
"CopySource" : "/test/README"
"CopySource" : "test/README"
"CopySource" : "README"
but new copied file size is 0 byte.
NO Error log in gateway, storage or on terminal no exception or warning seems.

@yosukehara
Copy link
Member

Thank you for your report. We'll check this issue soon.

@yosukehara yosukehara added this to the 1.0.0 milestone Mar 4, 2014
@mocchira
Copy link
Member

mocchira commented Mar 6, 2014

Since LeoFS have expected to exist a x-amz-metadata-directive header(but aws spec is allowed no existing this header), if this header didn't exist, LeoFS handled the http request as a normal PUT with no http body.
So we will fix ASAP.

@mocchira
Copy link
Member

mocchira commented Mar 6, 2014

Hi @Paras2009
This issue have been fixed on develop branch at leo_gateway repo.
So could you confirm if this issue is fixed?

    # build LeoFS with the fixed version 
    cd ${leofs_repo_root}
    make deps
    (cd deps/leo_commons;git checkout develop;)
    (cd deps/leo_object_storage;git checkout develop;)
    (cd deps/leo_gateway;git checkout develop;)
    make
    make release

@mocchira mocchira self-assigned this Mar 6, 2014
@rr-paras-patel
Copy link
Author

Thank you mocchira san I have confirmed this issue for nodejs and php client it is working fine now ...

@mocchira
Copy link
Member

mocchira commented Mar 7, 2014

@Paras2009 THX!
This fix will be included on v1.0.0.

@mocchira mocchira closed this as completed Mar 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants