Try the fastest and simplest way to install ONLYOFFICE

Command service - error 1

Command service - error 1

Postby dcolaco » Fri Mar 31, 2017 12:03 pm

Hi,

I'm triyng to send a "forcesave" command through CommandService.ashx, i'm using Document Server version 4.2 so data is passed as POST as below:

(Sent Data)
{"c":"forcesave","key":"-556689021"}

Problem is the response:
(Received data)
{
"error": 1
}

The result is not the same as explained here "https://api.onlyoffice.com/editors/command", but i understand this is the code for "Document key is missing or no document with such key could be found."

I am using for the "key" the value of [id] column in [doc_changes] table (also present in callbacks) so i dont unsderstand why the document is not found.

Can u help?
dcolaco
 
Posts: 12
Joined: Wed Mar 01, 2017 10:14 am

Re: Command service - error 1

Postby Maxim » Mon Apr 03, 2017 7:03 am

Hello dcolaco!
forcesave - force saving the document being edited without closing it (the document editing might be continued after this command, so this will not be the final saved document version);

So you cannot use the command if the file has been closed already. Forcesave command Is intended for the file which is editing now. In Community Edition, for example, when user closed the browser's tab community server executes within 10 seconds the saving process of the file but if you want to save the file while editing process you should use "forcesave" command. As the result you'll get CODE 1 error because there is no such key in system or the file is not open and cannot be saved while editing.
Maxim
 
Posts: 1162
Joined: Tue Oct 11, 2016 2:34 pm

Re: Command service - error 1

Postby dcolaco » Tue Apr 04, 2017 4:57 pm

I changed the request to GET and now i get error 3 "internal server error"

how can i debug or view the log for this error?
dcolaco
 
Posts: 12
Joined: Wed Mar 01, 2017 10:14 am

Re: Command service - error 1

Postby Maxim » Wed Apr 05, 2017 11:47 am

Hello dcolaco!
Why did you change command "forcesave" to command "GET"?
Specify please what a goal do you pursuit? What is the task you want to realize?
Maxim
 
Posts: 1162
Joined: Tue Oct 11, 2016 2:34 pm

Re: Command service - error 1

Postby dcolaco » Wed Apr 05, 2017 4:01 pm

Why did you change command "forcesave" to command "GET"?
Becouse if i sent the request as POST the result would be "error : 1 - Document not found" wich is incorrent, i confirmed that the editor is open and editing and exist records in doc_changes for the document, also tried with random id and result is the same.
Sending as GET, if i send the correct id i get "error 3 - internal server error", if i change it on porpuse to a wrong id the result is "error : 1 - Document not found", wich is correct.

Specify please what a goal do you pursuit? What is the task you want to realize?
1 - Trying to use the "forcesave" command, can't wait 10 seconds to confirm user the save was sucessfull
2 - trying to find out WHY i get internal server error and debug it
dcolaco
 
Posts: 12
Joined: Wed Mar 01, 2017 10:14 am


Return to Documents

Who is online

Users browsing this forum: No registered users and 1 guest

cron