Deleting a Schema - Error when recreating same Document
  • Hi,

    for some test runs I created unit tests which setup my database run the tests and cleanup afterwards.

    For now it was stable and cleaning up the documents by deleting the schemas was sufficient, but as I'm now working with dependencies in between the documents I also pass the documentKey when creating the entries to make sure the tests start with the same conditions.

    Unfortunately the process of SaveSchema->SaveDocument [key, schema] -> RunTests -> DeleteSchema doesn't seem to take me back to a consistent database state. 

    As a result trying to create a document with the same documentKey after deleting and recreating a schema always returns

    response =     {

            metadata =         {

                errorCode = "INTERNAL_ERROR";

                errorDetail = "An internal error occurred. If this behavior persists, please contact Apstrata customer support.";

                requestId = "86c5b841-c4e3-4ea7-a943-1f064971ec39";

                status = failure;

                statusCode = 500;



    Regards Daniel

  • Hi Daniel,

    I think that you need to leave a short interval of time (20-30 seconds) between the execution of two consecutive tests that remove all documents by deleting their schema.

    Please try it and keep me posted. If the behavior still persists, we will investigate it deeper.

  • Hi Karim,

    that was my first thought and I can reproduce the behaviour in the Manage App section too. Been 7 minutes now and still get the same error. Not an issue I need to solve now but maybe you should know.

  • Daniel, could you please send parts of the code of your tests that implement the aforementioned logic?
    Thank you
  • You can reproduce this behaviour using the Manage App section.

    - Create schema
    - Create document with this schema and set documentKey ( e.g. AAA will do )
    - Delete the schema ( document AAA will be gone as expected )
    - Create document with key AAA ( don't even need to set the schema )


    INTERNAL_ERROR: An internal error occurred. If this behaviour persists, please contact Apstrata customer support.

    just tried it again 24h later still getting the same error. My code follows the same procedure. For now I changed it and I delete the documents before removing the schema and it works fine.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!