8 Replies Latest reply on Feb 11, 2015 4:55 AM by ztenerowicz

    Deleting file in jive results with "unexpected error page" after deletion from ESP

    kamilwylegala

      Hello,

       

      I work on my external storage provider using Jive NodeJS SDK. I have some problem with deleting file in Jive using my instance of ESP.

       

      Flow:

       

      1. Upload file with Jive using ESP (works well, from ESP goes response with status 200)

      2. Delete file with Jive using ESP (on the ESP side everything works well) then I receive reloaded page with "An unexpected error has occurred" and nothing else.

       

      I am sure that response which goes to the Jive from ESP has 204 status code (the same result is with 200) after deletion.

       

      Please tell my how exactly response should look like to avoid this error.

       

      EDIT:

       

      I noticed that when we try to delete whole place (for example group) which contains files then deleting works fine. For example group contains two files then after deleting this group I can see in logs of our application that there are two request for delete. But when I have some place with files and I decide to delete one file from this place then I receive error message as above.

       

      BTW: Please remove spam comment in this topic from WillieDMattos...

       

      Cheers,

      Kamil.

        • Re: Deleting file in jive results with "unexpected error page" after deletion from ESP
          ztenerowicz

          Also, the same External Storage Provider code used to work before. It would send an empty 200 and work just fine.

           

          The problem was observed on https://jivedemo-egnyte.jiveon.com/

            • Re: Deleting file in jive results with "unexpected error page" after deletion from ESP
              Ryan Rutan

              So one thing I would note.  If you are not an Administrator, then you will need to implement the trash/Untrash resources in your responses, such that the file is not actually deleted.  If the authorizing user for the ESF isn't a full admin, then the they will get an error when trying to delete the file, as deleting is only an Admin operation.  Trash is allowed for all user users, which moves the file out of scope, but is recoverable.    Please confirm if you have the trash/untrash resources implemented and if so, then we can bring in the ESF team for consultation.  If not, then let's implement those resources.

               

              If you are using the example, this is where you would add the trash/unTrash resources:

              jive-sdk/storage_service.js at master · jivesoftware/jive-sdk · GitHub

              and add the service definitions here:

              jive-sdk/explicit_routes.js at master · jivesoftware/jive-sdk · GitHub

              and then add trash/untrash methods in your service exports:

              jive-sdk/storage_service.js at master · jivesoftware/jive-sdk · GitHub

               

              see: External Storage Framework - Developer Resources for the untrash/trash details

                • Re: Deleting file in jive results with "unexpected error page" after deletion from ESP
                  ztenerowicz

                  Thank you for pointing out the trash feature. It was hard to find in the documentation. Implementing trash got the integration stable again.

                   

                  Nevertheless, latest documentation says about trashFile: "This resource is optional. If not returned, DELETE self would be called when users choose to delete documents in Jive." and when this happens, we return 204 or 200 as we did before and current version of Jive on our demo instance crashes after getting the successful response. This doesn't seem right. IMHO you should either document trashing as mandatory, or make deleting work as before.


                  As a support request, this is closed.

                  [edit]

                  ...not.


                  With trashing implemented, when we click "delete" on a file (as an admin) after it was deleted (trashed) by the owner, Jive doesn't make a request to our ESP at all and doesn't delete the file.

                  Steps to reproduce:

                  1 as a regular user: create a file and delete it

                  2 make sure it's not visible to the regular user anymore

                  3 switch to admin user

                  4 click "delete" and confirm that you want to delete the document

                  5 page is reloaded but nothing happens


                    • Re: Deleting file in jive results with "unexpected error page" after deletion from ESP
                      Ryan Rutan

                      Moshe Bixenshpaner - Could you please step in here, and assist?  Expected behavior, or possibly a known issue?

                      • Re: Deleting file in jive results with "unexpected error page" after deletion from ESP
                        With trashing implemented, when we click "delete" on a file (as an admin) after it was deleted (trashed) by the owner, Jive doesn't make a request to our ESP at all and doesn't delete the file.

                        Sounds like two parts here:

                         

                        a) when the hard delete (which is what we call this functionality on the core side, versus a 'soft delete' which only removes it from the UI but doesn't delete it from the core DB) occurs, you need a notification to be sent to the external storage provider and that isn't happening / doesn't appear to be happening right now.  Is that true?

                         

                        b) additionally, the file isn't actually hard deleted at all.

                         

                        Could you repeat this process and send us the sbs.log files along with the jive-httpd-access.log files that span the time of the requests that you're making? My guess is that there's some kind of error in the logs that might help us move this case along.

                         

                        Thanks!

                         

                        AJ

                          • Re: Deleting file in jive results with "unexpected error page" after deletion from ESP

                            whoops... sounds like you're testing this out on a cloud instance... I just checked the logs to see if I could find something that looked related, I did find this:

                             

                             

                            2015-01-21 14:09:54,238 [http-nio-0.0.0.0-9200-exec-27] [-1:ANONYMOUS:REGULAR] ERROR com.jivesoftware.community.integration.storage.api.ExStorageBaseAPI - Failed to read ExStorageError from response

                            com.google.gson.JsonParseException: Failed parsing JSON source: java.io.InputStreamReader@2684bc36 to Json

                                    at com.google.gson.JsonParser.parse(JsonParser.java:59)

                                    at com.google.gson.Gson.fromJson(Gson.java:443)

                                    at com.google.gson.Gson.fromJson(Gson.java:419)

                                    at com.jivesoftware.community.integration.storage.extensions.GsonReadingStrategy.readFromResponse(GsonReadingStrategy.java:38)

                                    at com.jivesoftware.community.integration.storage.api.ExStorageBaseAPI.getExStorageError(ExStorageBaseAPI.java:455)

                                    at com.jivesoftware.community.integration.storage.api.ExStorageBaseAPI.processHttpErrors(ExStorageBaseAPI.java:405)

                                    at com.jivesoftware.community.integration.storage.api.ExStorageBaseAPI.callRestAPI(ExStorageBaseAPI.java:329)

                                    at com.jivesoftware.community.integration.storage.api.ExStorageBaseAPI.wrapAndCallRestAPI(ExStorageBaseAPI.java:311)

                                    at com.jivesoftware.community.integration.storage.api.ExStorageBaseAPI.wrapAndCallRestAPI(ExStorageBaseAPI.java:301)

                                    at com.jivesoftware.community.integration.storage.api.ExStorageBaseAPI.deleteComment(ExStorageBaseAPI.java:163)

                                    at com.jivesoftware.community.integration.storage.comments.impl.ExStorageCommentManagerImpl.callDeleteComment(ExStorageCommentManagerImpl.java:461)

                                    at com.jivesoftware.community.integration.storage.comments.impl.ExStorageCommentManagerImpl.tryDeleteComment(ExStorageCommentManagerImpl.java:446)

                                    at com.jivesoftware.community.integration.storage.comments.impl.ExStorageCommentManagerImpl.syncDeletedComment_aroundBody6(ExStorageCommentManagerImpl.java:406)

                                    at com.jivesoftware.community.integration.storage.comments.impl.ExStorageCommentManagerImpl$AjcClosure7.run(ExStorageCommentManagerImpl.java:1)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:59)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect$AbstractTransactionAspect$1.proceedWithInvocation(AbstractTransactionAspect.aj:65)

                                    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96c(AbstractTransactionAspect.aj:63)

                                    at com.jivesoftware.community.integration.storage.comments.impl.ExStorageCommentManagerImpl.syncDeletedComment(ExStorageCommentManagerImpl.java:394)

                                    at com.jivesoftware.community.integration.storage.comments.impl.ExStorageCommentManagerImpersonationProxy.syncDeletedComment(ExStorageCommentManagerImpersonationProxy.java:84)

                                    at com.jivesoftware.community.integration.storage.listeners.ExStorageCommentEventListener.handle_aroundBody0(ExStorageCommentEventListener.java:45)

                                    at com.jivesoftware.community.integration.storage.listeners.ExStorageCommentEventListener$AjcClosure1.run(ExStorageCommentEventListener.java:1)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:59)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect$AbstractTransactionAspect$1.proceedWithInvocation(AbstractTransactionAspect.aj:65)

                                    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96c(AbstractTransactionAspect.aj:63)

                                    at com.jivesoftware.community.integration.storage.listeners.ExStorageCommentEventListener.handle(ExStorageCommentEventListener.java:31)

                                    at com.jivesoftware.community.integration.storage.listeners.ExStorageCommentEventListener.handle(ExStorageCommentEventListener.java:1)

                                    at com.jivesoftware.base.event.v2.EventDispatchHelper.dispatchEventInline(EventDispatchHelper.java:227)

                                    at com.jivesoftware.base.event.v2.NonBlockingEventDispatcherImpl.fireInline(NonBlockingEventDispatcherImpl.java:131)

                                    at com.jivesoftware.community.comments.impl.DbCommentManager.fireCommentDeletingEvent(DbCommentManager.java:804)

                                    at com.jivesoftware.community.comments.impl.DbCommentManager.deleteComment_aroundBody52(DbCommentManager.java:743)

                                    at com.jivesoftware.community.comments.impl.DbCommentManager$AjcClosure53.run(DbCommentManager.java:1)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:59)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect$AbstractTransactionAspect$1.proceedWithInvocation(AbstractTransactionAspect.aj:65)

                                    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96c(AbstractTransactionAspect.aj:63)

                                    at com.jivesoftware.community.comments.impl.DbCommentManager.deleteComment(DbCommentManager.java:727)

                                    at com.jivesoftware.community.comments.impl.DbCommentManager.deleteAllComments_aroundBody54(DbCommentManager.java:840)

                                    at com.jivesoftware.community.comments.impl.DbCommentManager$AjcClosure55.run(DbCommentManager.java:1)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:59)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect$AbstractTransactionAspect$1.proceedWithInvocation(AbstractTransactionAspect.aj:65)

                                    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96c(AbstractTransactionAspect.aj:63)

                                    at com.jivesoftware.community.comments.impl.DbCommentManager.deleteAllComments(DbCommentManager.java:833)

                                    at com.jivesoftware.community.impl.comment.CommentManagerDeleteContentListener.handle(CommentManagerDeleteContentListener.java:91)

                                    at com.jivesoftware.base.event.v2.EventDispatchHelper.dispatchEventInline(EventDispatchHelper.java:231)

                                    at com.jivesoftware.base.event.v2.NonBlockingEventDispatcherImpl.fireInline(NonBlockingEventDispatcherImpl.java:131)

                                    at com.jivesoftware.community.impl.DbDocumentManager.fireDocumentDeletingEvent(DbDocumentManager.java:596)

                                    at com.jivesoftware.community.impl.DbDocumentManager.deleteDocument_aroundBody8(DbDocumentManager.java:560)

                                    at com.jivesoftware.community.impl.DbDocumentManager$AjcClosure9.run(DbDocumentManager.java:1)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:59)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect$AbstractTransactionAspect$1.proceedWithInvocation(AbstractTransactionAspect.aj:65)

                                    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96c(AbstractTransactionAspect.aj:63)

                                    at com.jivesoftware.community.impl.DbDocumentManager.deleteDocument(DbDocumentManager.java:536)

                                    at com.jivesoftware.community.integration.storage.file.impl.ExStorageFileManagerImpl.deleteDocumentFromESP_aroundBody4(ExStorageFileManagerImpl.java:759)

                                    at com.jivesoftware.community.integration.storage.file.impl.ExStorageFileManagerImpl$AjcClosure5.run(ExStorageFileManagerImpl.java:1)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:59)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect$AbstractTransactionAspect$1.proceedWithInvocation(AbstractTransactionAspect.aj:65)

                                    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)

                                    at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96c(AbstractTransactionAspect.aj:63)

                                    at com.jivesoftware.community.integration.storage.file.impl.ExStorageFileManagerImpl.deleteDocumentFromESP(ExStorageFileManagerImpl.java:754)

                                    at com.jivesoftware.community.integration.storage.file.impl.ExStorageFileManagerImpersonationProxy.deleteDocumentFromESP(ExStorageFileManagerImpersonationProxy.java:107)

                                    at com.jivesoftware.api.core.v3.providers.storage.ExStorageFileProvider.deleteFile(ExStorageFileProvider.java:87)

                                    at com.jivesoftware.api.core.v3.services.storage.ExStorageFileService.removeFile(ExStorageFileService.java:48)

                            so it kind of looks like we're calling back to you (the ESP) for each comment on this document and that for one (all?) of the comments, we're getting an error / not getting back something that's JSON that we can read and so the entire document delete / trash / remove process dies.  Could you check your side to see what's happening when we attempt to delete the comment on that document?

                             

                            AJ