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

Exception thrown when tiring to extend hit time #1817

Closed
Ovadia-B opened this issue Nov 27, 2018 · 5 comments
Closed

Exception thrown when tiring to extend hit time #1817

Ovadia-B opened this issue Nov 27, 2018 · 5 comments
Assignees
Labels
guidance Question that needs advice or information.

Comments

@Ovadia-B
Copy link

I am extending hit expiration with UpdateExpirationForHIT while most of the time the requests are successful there are some requests that are failing.

I tried to log out the time of expireAt value and it is correct.

Extending expiration for HIT 3TRB893CSJTWCHXTCX7HTJTD8VJG7X,
Now: Thu Nov 22 10:19:33 UTC 2018,
Expire At: Thu Nov 22 11:19:33 UTC 2018

There is one hour between the time now and the time of expiry, but the service throws this exception:

com.amazonaws.services.mturk.model.AmazonMTurkException: The value 11 is invalid for ExpirationIncrementInSeconds. Valid values range from 60 to 31536000. (1542881973916) (Service: AmazonMTurk; Status Code: 400; Error Code: ParameterValidationError; Request ID: af1802ad-3ebf-4e59-9284-859f875db476)

@debora-ito debora-ito added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Nov 27, 2018
@debora-ito debora-ito self-assigned this Nov 27, 2018
@debora-ito
Copy link
Member

Can you provide sample code that reproduces the problem?

@Ovadia-B
Copy link
Author

Ovadia-B commented Nov 28, 2018

Sure, here is the relevant code snippet:

Date expireAt = new Date(Instant.now().plus(reward.getLifetime(), ChronoUnit.SECONDS).getEpochSecond() * 1000);

logger.info("Extending expiration for HIT {}, Now: {}, Expire At: {}",
                hitId,
                new Date(Instant.now().getEpochSecond() * 1000),
                expireAt);

 mturk.updateExpirationForHIT(new UpdateExpirationForHITRequest()
                .withHITId(hitId)
                .withExpireAt(expireAt));

When reward.getLifetime() is 3600

@debora-ito
Copy link
Member

I was able to reproduce it when the new expiration date is before the current expiration date - in this case, I got the message The value -2752 is invalid for ExpirationIncrementInSeconds. Apparently, the updateExpirationForHIT() only works with increments of the current expiration date, with the minimum of 60 seconds.

Is it possible that's the case?
In your example, the new expiration date is only 11 seconds after the current expiration date.

I didn't find anything in the Mechanical Turk API documentation mentioning this rule, it only says that if the expiration date is in the past the HIT will be immediately expired. So I'll go ahead and open an internal ticket asking the Mechanical Turk team to address the issue.

@debora-ito debora-ito added guidance Question that needs advice or information. waiting-reply and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Nov 29, 2018
@Ovadia-B
Copy link
Author

Ovadia-B commented Dec 2, 2018

Thanks for your findings, I think this case can happen, I will try to check the expiration time before extending it, hope this will resolve this issue.

I will update if this issue still occurring after the fix.

@debora-ito
Copy link
Member

Good! So I'll go ahead and close this, but feel free to reopen if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants