DESKTOP EDITION CLOUD EDITION SERVER EDITION GUIDES FORUM

Error when Manager is being used and automatically backed up


#1

I am using last desktop version for Windows (18.4.1) but I am getting the following error:

<div style="overflow-x: scroll; font-family: monospace; background-color: #ffffee; border-radius: 10px; border: 1px solid red; padding: 50px; position: absolute; top: 100px; left: 100px; right: 100px; font-size: 16px"><div style="font-size: 32px; font-weight: bold">Internal Error</div><pre>18.4.1 (Desktop)</pre><pre style="color: #ccc"><b>/form-delete?Key=a4eccf8d-868f-430f-a558-3b67a39614e9&FileID=dbc637e1-2613-411d-a93a-4cfbe8dfe881</b></pre><pre style="color: #ccc"><b>SQLite.SQLiteException: ReadOnly

   bij SQLite.SQLiteCommand.ExecuteNonQuery()
   bij SQLite.SQLiteConnection.Execute(String query, Object[] args)
   bij SQLite.SQLiteConnection.Delete[T](Object primaryKey)
   bij Manager.ApplicationData.Remove(Guid entityId, Guid objectId)
   bij ManagerServer.HttpHandlers.FormDelete.Post()
   bij HttpFramework.HttpApplication.ProcessRequest(HttpRequest request, HttpResponse response)
   bij ManagerServer.HttpApplication.ProcessRequest(HttpRequest request, HttpResponse response)</b></pre>
<!--
512 bytes of padding to suppress Internet Explorer's "Friendly error messages"

Several frequently-seen status codes have "friendly" error messages 
that Internet Explorer 5.x displays and that effectively mask the 
actual text message that the server sends.
However, these "friendly" error messages are only displayed if the 
response that is sent to the client is less than or equal to a 
specified threshold.
For example, to see the exact text of an HTTP 500 response, 
the content length must be greater than 512 bytes.
--></div>

The modification I was doing in Manager is than not made. How to handle this?


#2

What were you trying to modify ?
Describe the steps being taken which lead up to the error message ?
Does the error message appear every time you make this type of modification ?


#3

At this moment I am modifying a Purchase Invoice by making a New Attachment to it. It now gives me the error:

SQLiteException: ReadOnly

and so I cannot modify it.

The previous error I mentioned was when I wanted to delete a bank transaction I just made in Manager, because I worked ‘the wrong way’: I first want to make a new Purchase Invoice and then by Spend money -> New Bank Transaction make a connection with my bank transactions.


#4

It looks like it has to do with my Manager Database being on Dropbox and Dropbox first wants to synchronize it, so it flags the file as being Read Only.

But: deleting the last Bank Transaction still gives the same error!


#5

if you are sure its because of Dropbox sync, why not store your business data locally and sync the folder to Dropbox?
also, try a different browser.


#6

Yes, you are right, but syncing with Dropbox is done by putting the file in the local Dropbox map and Dropbox does the rest.
Also, I am not sure it has to do with Dropbox, as I use Manager this way for a longer period without this trouble.


#7

@lubos

It has (again) to do with my automatic backup of files (see: Error since files resides on Dropbox). I am modifying something in Manager, but the backup is still in progress and this temporarily flags the *.manager file as being read-only, so Manager itself gives an error:

SQLiteException: ReadOnly

So either Manager itself should mark the *.manager file as read-only when doing modifications, or I must exclude the Manager files from being back upped.


#8

Manager cannot know what Dropbox is doing. And it cannot make its own data files read-only while it is in the process of writing to them. So you are going to have to modify your personal backup scheme.


#9

This is something I need to resolve. If Dropbox locks the database for writing, then Manager can’t make any changes to its database.

One solution, Manager could perhaps keep retrying for up to 5 seconds before giving up. I assume most of the time Dropbox wouldn’t require more than a second or two to sync. This would avoid read-only errors.


#10

OK, try the latest version (18.4.26). There is now 5 second timeout.


#11

Installed the last version, but still get the error:

<div style="overflow-x: scroll; font-family: monospace; background-color: #ffffee; border-radius: 10px; border: 1px solid red; padding: 50px; position: absolute; top: 100px; left: 100px; right: 100px; font-size: 16px"><div style="font-size: 32px; font-weight: bold">Internal Error</div><pre>18.4.26 (Desktop)</pre><pre style="color: #ccc"><b>/sales-invoice-form?Referrer=8568b67a-5f89-4ca4-b86f-54c699ccd29c&Key=9ea71982-244c-4c76-8b94-3e4d9f39f269&FileID=dbc637e1-2613-411d-a93a-4cfbe8dfe881</b></pre><pre style="color: #ccc"><b>SQLite.SQLiteException: ReadOnly
   bij SQLite.PreparedSqlLiteInsertCommand.ExecuteNonQuery(Object[] source)
   bij SQLite.SQLiteConnection.Insert(Object obj, String extra, Type objType)
   bij Manager.ApplicationData.PutMany(Guid entityId, IRow[] rows)
   bij Manager.ApplicationData.PutMany(Guid entityId, Object[] objects)
   bij Manager.ApplicationData.Put(Guid entityId, Object o)
   bij ManagerServer.HttpHandlers.Form`1.Post()
   bij HttpFramework.HttpApplication.ProcessRequest(HttpRequest request, HttpResponse response)
   bij ManagerServer.HttpApplication.ProcessRequest(HttpRequest request, HttpResponse response)</b></pre>
</div>

The *.manager file I am using is 35 MB big (on account of the scans of bills it incorporates in the file), so this takes some time to backup. And I think it has to do with my backup program (Memeo Backup Premium) instead of the files being on Dropbox or OneDrive. I think the backup program flags the file as being temporarily read-only while Manager writes directly any modification to the *.manager file.
I did do the workaround by excluding *.manager files from the backup program (not now of course, as I want to see how things work).


#12

And that is at the crux of the issue, your backup programme - as Dropbox and OneDrive will not attempt to sync any data file until it is available. In another words, the data file has priority over Dropbox or OneDrive, whereas, your backup programme (Memeo) seems to want priority over the data file.

Dropbox displays - Can’t sync “data file” (access denied)
If the data file becomes idle, then it will sync.


#13

Well, it shouldn’t. 35 MB is nothing. I’ve seen Manager database over 2 GB although I didn’t experiment whether Dropbox is able to continuously backup such a large file without Manager choking on readonly errors.

In any case, the backup program should upload differences only. Not the whole file and 5 seconds should be enough time for that. The issue is figuring out what parts have changed but that shouldn’t take long even for large file considering modern SSD drives can read 1.5 GB per second. So 5 seconds is plenty of time.

I suspect something else is happening but I’d need to install this particular backup program and try to reproduce this issue.


#14

I can include or exclude Manager files from being back upped by Memeo and I instantly see the result when I exclude these files: in Manager there is no problem; everything works fine then.


#15

I would have thought that if the file is open in Manager, that the backup software would not attempt to back it up but would wait until the file is closed.

If it backs up the file after every change, then you will end up with a lot of backups most of which are unnecessary. I use the backup bundled with Windows and this seems to work well.


#16

I suspect the problem arises because the data file is never “open” except at the moment a transaction is created or updated. That’s why there is no Save function in Manager. The application itself stores no information. But as soon as Create or Update is clicked, the database is updated.


#17

@lubos I am of the opinion that it is the job of Dropbox and other backup programs to support backing up locked files i.e. when the files are in use. I don’t think it should be your responsibility to get Manager to work when another program locks the database. Dropbox and memeo should not be locking any files regardless.

@Roeland I would suggest contacting your backup people Memeo and asking about this. Backup software should have the ability to sync only the changes (you should not be backing up the whole file every time) and secondly, the backup software should not be locking any files at all. Most backup programs support backing up locked files (files in use) and do this through VSS or some other method.

In short, the problem is not Manager, it is your backup software that is the issue and memeo need to fix the issue their end.


#18

Manager could lock the file when it’s open. The issue is some people never close the program so their Manager data would be permanently inaccessible to backup program.

Sure, Manager could take it a bit further and lock the database while it’s used and automatically release the lock on file after inactivity but not sure I want to go this direction.


#19

My point is that backup software is supposed to be able to backup locked files. Sql server databases running on servers for example are always locked as servers run 24/7. Yet backup software has the ability to backup these locked files.

A backup software should never actually lock a file to do a backup. That should never happen.

My opinion is that the problem is with the backup software, not with manager.


#20

I’m not entirely sure what SQL server is doing but if SQL database file is locked by backup program and SQL server can still process writes, then it must be queuing them somewhere else. SQLite has this feature too. They call it “Write-Ahead Logging” or “WAL”.

The only issue with “WAL” is that you lose simplicity because your data will be (mostly) stored across two files instead of one.