You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Aleksandra Nowak <al...@man.poznan.pl> on 2016/11/23 11:08:57 UTC

put operation is not repeatable

Hi,

I use jclouds to communicate with Openstack Swift (authentication is 
provided by Keystone).

Every once in a while I get this exception:

Cannot retry after server error, command is not replayable: 
[method=org.jclouds.openstack.swift.SwiftKeystoneClient.public abstract 
java.lang.String 
org.jclouds.openstack.swift.CommonSwiftClient.putObject(java.lang.String,org.jclouds.openstack.swift.domain.SwiftObject)...

Server rejected operation connecting to PUT http://swift... (full 
exception here: http://pastebin.com/WVtc0U3f)

Here is the code which I run to upload objects: http://pastebin.com/GKr1CaSQ


After the error the application can be "fixed" by a restart or by 
executing a GET request to an existing object. I figured that this 
happens because the key from Keystone expires before the PUT command is 
executed. And while GET method is requesting a new key from Keystone, 
PUT is not. And I confirmed it using ngrep on Keystone port. During PUT 
there is no communication to Keystone, but during GET I can see that it 
requested key renewal:

http://pastebin.com/Wi2xzWZ9

I turned on jclouds logging on TRACE level. Here is the log when I try 
PUT method: http://pastebin.com/RxRBTXDH and here is log for GET first: 
http://pastebin.com/WhvG4Wy9

So, it looks like PUT method is not repeatable/replayable for 
InputStream. Can somebody tell me why? Or point to a point in 
documentation where it is described?

Is there a why to upload InputStream to Swift in a repeatable way? My 
could is wrapped by a REST call which uses Multipart, so I really would 
like to use InputStream. Or is it any other way to renew the key?

Thanks in advance!
Kind regards,
Aleksandra




Re: put operation is not repeatable

Posted by Andrew Gaul <ga...@apache.org>.
Object stores sometimes have transient failures due to network issues or
node unavailability.  Your used an InputStream payload in
http://pastebin.com/GKr1CaSQ which is not replayable because it can only
produce data, not reset to the beginning of the stream.  Instead you
should consider a ByteSource payload which you can create via
ByteSource.wrap(byte[]) or Files.asByteSource(File).  jclouds will
automatically retry with ByteSource payload; otherwise your application
needs to implement retry logic for InputStream payload.

On Wed, Nov 23, 2016 at 12:08:57PM +0100, Aleksandra Nowak wrote:
> Hi,
> 
> I use jclouds to communicate with Openstack Swift (authentication is
> provided by Keystone).
> 
> Every once in a while I get this exception:
> 
> Cannot retry after server error, command is not replayable:
> [method=org.jclouds.openstack.swift.SwiftKeystoneClient.public
> abstract java.lang.String org.jclouds.openstack.swift.CommonSwiftClient.putObject(java.lang.String,org.jclouds.openstack.swift.domain.SwiftObject)...
> 
> Server rejected operation connecting to PUT http://swift... (full
> exception here: http://pastebin.com/WVtc0U3f)
> 
> Here is the code which I run to upload objects: http://pastebin.com/GKr1CaSQ
> 
> 
> After the error the application can be "fixed" by a restart or by
> executing a GET request to an existing object. I figured that this
> happens because the key from Keystone expires before the PUT command
> is executed. And while GET method is requesting a new key from
> Keystone, PUT is not. And I confirmed it using ngrep on Keystone
> port. During PUT there is no communication to Keystone, but during
> GET I can see that it requested key renewal:
> 
> http://pastebin.com/Wi2xzWZ9
> 
> I turned on jclouds logging on TRACE level. Here is the log when I
> try PUT method: http://pastebin.com/RxRBTXDH and here is log for GET
> first: http://pastebin.com/WhvG4Wy9
> 
> So, it looks like PUT method is not repeatable/replayable for
> InputStream. Can somebody tell me why? Or point to a point in
> documentation where it is described?
> 
> Is there a why to upload InputStream to Swift in a repeatable way?
> My could is wrapped by a REST call which uses Multipart, so I really
> would like to use InputStream. Or is it any other way to renew the
> key?
> 
> Thanks in advance!
> Kind regards,
> Aleksandra
> 
> 
> 

-- 
Andrew Gaul
http://gaul.org/

Re: put operation is not repeatable

Posted by Aleksandra Nowak <al...@man.poznan.pl>.
Hi,

I use 1.9.2.

I've just took a look at 2.0 but it will require to rewrite the code I 
use to communicate with Swift. As far as I understand with the new API I 
cannot use BlobStoreContext.

Is there a way to fix it in 1.9.2?

Best,

Aleksandra

W dniu 23.11.2016 o 23:28, Zack Shoylev pisze:
> There were some bugfixes in 2.0.0 that can potentially fix your problem based on exactly what is failing. Have you tried that?
> ________________________________________
> From: Aleksandra Nowak <al...@man.poznan.pl>
> Sent: Wednesday, November 23, 2016 5:08 AM
> To: user@jclouds.apache.org
> Subject: put operation is not repeatable
>
> Hi,
>
> I use jclouds to communicate with Openstack Swift (authentication is
> provided by Keystone).
>
> Every once in a while I get this exception:
>
> Cannot retry after server error, command is not replayable:
> [method=org.jclouds.openstack.swift.SwiftKeystoneClient.public abstract
> java.lang.String
> org.jclouds.openstack.swift.CommonSwiftClient.putObject(java.lang.String,org.jclouds.openstack.swift.domain.SwiftObject)...
>
> Server rejected operation connecting to PUT http://swift... (full
> exception here: http://pastebin.com/WVtc0U3f)
>
> Here is the code which I run to upload objects: http://pastebin.com/GKr1CaSQ
>
>
> After the error the application can be "fixed" by a restart or by
> executing a GET request to an existing object. I figured that this
> happens because the key from Keystone expires before the PUT command is
> executed. And while GET method is requesting a new key from Keystone,
> PUT is not. And I confirmed it using ngrep on Keystone port. During PUT
> there is no communication to Keystone, but during GET I can see that it
> requested key renewal:
>
> http://pastebin.com/Wi2xzWZ9
>
> I turned on jclouds logging on TRACE level. Here is the log when I try
> PUT method: http://pastebin.com/RxRBTXDH and here is log for GET first:
> http://pastebin.com/WhvG4Wy9
>
> So, it looks like PUT method is not repeatable/replayable for
> InputStream. Can somebody tell me why? Or point to a point in
> documentation where it is described?
>
> Is there a why to upload InputStream to Swift in a repeatable way? My
> could is wrapped by a REST call which uses Multipart, so I really would
> like to use InputStream. Or is it any other way to renew the key?
>
> Thanks in advance!
> Kind regards,
> Aleksandra
>
>
>


Re: put operation is not repeatable

Posted by Zack Shoylev <za...@RACKSPACE.COM>.
There were some bugfixes in 2.0.0 that can potentially fix your problem based on exactly what is failing. Have you tried that?
________________________________________
From: Aleksandra Nowak <al...@man.poznan.pl>
Sent: Wednesday, November 23, 2016 5:08 AM
To: user@jclouds.apache.org
Subject: put operation is not repeatable

Hi,

I use jclouds to communicate with Openstack Swift (authentication is
provided by Keystone).

Every once in a while I get this exception:

Cannot retry after server error, command is not replayable:
[method=org.jclouds.openstack.swift.SwiftKeystoneClient.public abstract
java.lang.String
org.jclouds.openstack.swift.CommonSwiftClient.putObject(java.lang.String,org.jclouds.openstack.swift.domain.SwiftObject)...

Server rejected operation connecting to PUT http://swift... (full
exception here: http://pastebin.com/WVtc0U3f)

Here is the code which I run to upload objects: http://pastebin.com/GKr1CaSQ


After the error the application can be "fixed" by a restart or by
executing a GET request to an existing object. I figured that this
happens because the key from Keystone expires before the PUT command is
executed. And while GET method is requesting a new key from Keystone,
PUT is not. And I confirmed it using ngrep on Keystone port. During PUT
there is no communication to Keystone, but during GET I can see that it
requested key renewal:

http://pastebin.com/Wi2xzWZ9

I turned on jclouds logging on TRACE level. Here is the log when I try
PUT method: http://pastebin.com/RxRBTXDH and here is log for GET first:
http://pastebin.com/WhvG4Wy9

So, it looks like PUT method is not repeatable/replayable for
InputStream. Can somebody tell me why? Or point to a point in
documentation where it is described?

Is there a why to upload InputStream to Swift in a repeatable way? My
could is wrapped by a REST call which uses Multipart, so I really would
like to use InputStream. Or is it any other way to renew the key?

Thanks in advance!
Kind regards,
Aleksandra