Aws::MTurk::Errors::RequestError: The HIT with ID … already exists












0















Amazon Mechanical Turk gives me the following error when I invoke a call to CreateHITWithHITType using the Ruby SDK:



Aws::MTurk::Errors::RequestError: The HIT with ID "3HJ..." already exists. (154...)


I don't understand why I am getting this error.



It seems I'm getting this error because I am calling CreateHITWithHITType with a unique request token, which I have used in the past -- when I omit the token or use a token which has never been used before, my code creates the HIT successfully. However, this is confusing to me because it has been over 24 hours (closer to 30 days) since I last used that unique request token, and according to the Amazon Mechanical Turk documentation for CreateHITWithHITType (and the relevant Ruby SDK documentation), unique request tokens expire after 24 hours:




UniqueRequestToken: A unique identifier for this request. Allows you to retry the call on
error without creating duplicate HITs. This is useful in cases such as
network timeouts where it is unclear whether or not the call succeeded
on the server. If the HIT already exists in the system from a previous
call using the same UniqueRequestToken, subsequent calls will return a
AWS.MechanicalTurk.HitAlreadyExists error with a message containing
the HITId.



Type: String



Constraints: must not be longer than 64 characters in length. It is
your responsibility to ensure uniqueness of the token. The unique
token expires after 24 hours. Subsequent calls using the same
UniqueRequestToken made after the 24 hour limit could create duplicate
HITs.




Is the documentation incorrect? Or is there something I misunderstand about unique request tokens?










share|improve this question



























    0















    Amazon Mechanical Turk gives me the following error when I invoke a call to CreateHITWithHITType using the Ruby SDK:



    Aws::MTurk::Errors::RequestError: The HIT with ID "3HJ..." already exists. (154...)


    I don't understand why I am getting this error.



    It seems I'm getting this error because I am calling CreateHITWithHITType with a unique request token, which I have used in the past -- when I omit the token or use a token which has never been used before, my code creates the HIT successfully. However, this is confusing to me because it has been over 24 hours (closer to 30 days) since I last used that unique request token, and according to the Amazon Mechanical Turk documentation for CreateHITWithHITType (and the relevant Ruby SDK documentation), unique request tokens expire after 24 hours:




    UniqueRequestToken: A unique identifier for this request. Allows you to retry the call on
    error without creating duplicate HITs. This is useful in cases such as
    network timeouts where it is unclear whether or not the call succeeded
    on the server. If the HIT already exists in the system from a previous
    call using the same UniqueRequestToken, subsequent calls will return a
    AWS.MechanicalTurk.HitAlreadyExists error with a message containing
    the HITId.



    Type: String



    Constraints: must not be longer than 64 characters in length. It is
    your responsibility to ensure uniqueness of the token. The unique
    token expires after 24 hours. Subsequent calls using the same
    UniqueRequestToken made after the 24 hour limit could create duplicate
    HITs.




    Is the documentation incorrect? Or is there something I misunderstand about unique request tokens?










    share|improve this question

























      0












      0








      0








      Amazon Mechanical Turk gives me the following error when I invoke a call to CreateHITWithHITType using the Ruby SDK:



      Aws::MTurk::Errors::RequestError: The HIT with ID "3HJ..." already exists. (154...)


      I don't understand why I am getting this error.



      It seems I'm getting this error because I am calling CreateHITWithHITType with a unique request token, which I have used in the past -- when I omit the token or use a token which has never been used before, my code creates the HIT successfully. However, this is confusing to me because it has been over 24 hours (closer to 30 days) since I last used that unique request token, and according to the Amazon Mechanical Turk documentation for CreateHITWithHITType (and the relevant Ruby SDK documentation), unique request tokens expire after 24 hours:




      UniqueRequestToken: A unique identifier for this request. Allows you to retry the call on
      error without creating duplicate HITs. This is useful in cases such as
      network timeouts where it is unclear whether or not the call succeeded
      on the server. If the HIT already exists in the system from a previous
      call using the same UniqueRequestToken, subsequent calls will return a
      AWS.MechanicalTurk.HitAlreadyExists error with a message containing
      the HITId.



      Type: String



      Constraints: must not be longer than 64 characters in length. It is
      your responsibility to ensure uniqueness of the token. The unique
      token expires after 24 hours. Subsequent calls using the same
      UniqueRequestToken made after the 24 hour limit could create duplicate
      HITs.




      Is the documentation incorrect? Or is there something I misunderstand about unique request tokens?










      share|improve this question














      Amazon Mechanical Turk gives me the following error when I invoke a call to CreateHITWithHITType using the Ruby SDK:



      Aws::MTurk::Errors::RequestError: The HIT with ID "3HJ..." already exists. (154...)


      I don't understand why I am getting this error.



      It seems I'm getting this error because I am calling CreateHITWithHITType with a unique request token, which I have used in the past -- when I omit the token or use a token which has never been used before, my code creates the HIT successfully. However, this is confusing to me because it has been over 24 hours (closer to 30 days) since I last used that unique request token, and according to the Amazon Mechanical Turk documentation for CreateHITWithHITType (and the relevant Ruby SDK documentation), unique request tokens expire after 24 hours:




      UniqueRequestToken: A unique identifier for this request. Allows you to retry the call on
      error without creating duplicate HITs. This is useful in cases such as
      network timeouts where it is unclear whether or not the call succeeded
      on the server. If the HIT already exists in the system from a previous
      call using the same UniqueRequestToken, subsequent calls will return a
      AWS.MechanicalTurk.HitAlreadyExists error with a message containing
      the HITId.



      Type: String



      Constraints: must not be longer than 64 characters in length. It is
      your responsibility to ensure uniqueness of the token. The unique
      token expires after 24 hours. Subsequent calls using the same
      UniqueRequestToken made after the 24 hour limit could create duplicate
      HITs.




      Is the documentation incorrect? Or is there something I misunderstand about unique request tokens?







      amazon-web-services mechanicalturk






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 2 at 22:47









      Ceasar BautistaCeasar Bautista

      8,81494362




      8,81494362
























          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54014168%2fawsmturkerrorsrequesterror-the-hit-with-id-already-exists%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54014168%2fawsmturkerrorsrequesterror-the-hit-with-id-already-exists%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          Npm cannot find a required file even through it is in the searched directory

          How to fix TextFormField cause rebuild widget in Flutter