• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
updating OneDrive from device
#1
I have a fleet of these things running Android/Win10/Win11 on 3.8.13 (latest, if I mis-numbered it), with about 300 songs, 4 databases and most files in .cho format. I have trouble updating the OneDrive database from Win10. I either have to (a) delete all the OneDrive files in the destination folder; or (b) just delete the database and the hash file ... but this results in deleting and re-uploading all of the files to OneDrive anyway. Sync the other direction to all the client computers seems to mostly work fine. I try to do all syncs "server to client" and avoid making changes in the client. (I was not very successful with two-way sync. Also, I'm only updating the default database to OneDrive, not the three others -- not sure what will happen if I update all four databases).

I have not seen a list of non-permitted characters (sorry if I missed it). I suspect the problem may be in my folder or file naming.

I inherited a database that had file/folder names including "#" and other non-alpha numeric characters. I have tried to remove them (though some escape my attention.) I also have used some naming conventions, such as "Proud Mary - b*" and "Proud Mary - cho". Both of these were intended to distinguish from other "Proud Mary" files previously put in the system by another user. I used * and then later cho to indicate the file is in chordpro format. 

The other thing I have done on occasion when making a "new" song is to start with the file name and name it such as "proud_mary_cho.cho".

So, if the problem is non-allowed characters, possibly one or more of these is the problem: # * - _

Anyone know?

At present, if I enter a new song in my server and "sync to cloud" -> OneDrive, the transfer will stop when it hits the first new song. If I delete the database and hash file from OneDrive, then the sync works ok, but it proceeds by re-uploading each file. This is slower than a true "update" and OneDrive treats the process as deleting each file.

I first approached this by deleting everything my MobileSheets folder on OneDrive, and then I found it was less trouble to simply delete the database and hash file.

Kudos on how well MobileSheets works -- I set up a fleet (10 to 12) of mostly identical two-in-one laptops (they fold back to a tablet). It works well even with "sharing" the master OneDrive with other OneDrives (we are running on multiple MobileSheets licenses). As set up, the songs display the same on each tablet and I turn everyone's page from the Server tablet knowing that I'm not leaving anyone on the wrong page. I even set these up to boot directly into running MobileSheets, so I can tell the musicians to just keep their hands off the touchscreen (lol) and let me manage it.
Reply
#2
I do think using # is problematic. In fact, MobileSheets looks for instances of # and replaces them with (!PND!) so that no errors occur with Microsoft's API. When downloading files, I then turn (!PND!) back into #. So it's best to avoid # if possible. * is also problematic as that character is not allowed for file paths or names on any of the operating systems I believe. Dashes and underscores are perfectly fine. Can you try removing the pound signs and asterisks, and see if that resolves the upload/sync issues? As a side note, I'm working on modifying the code to make it a little more resilient to failures if this has anything to do with connection errors.

As a side note, if you want to share the sync folder with mike@zubersoft.com, I can try a sync to my PC to see if I encounter the same problems you've described where it stops when it hits the first new song.

Mike
Reply
#3
(09-01-2023, 10:55 AM)Zubersoft Wrote: I do think using # is problematic. 

Thanks for prompt reply. I spent some time removing #, still doesn't work. I am guessing there is some legacy entry somewhere causing a conflict. I took a look with an sql browser. I didn't see anything weird in the Song table data, but there are a lot of tables ...

My only downside is that to update OneDrive, I have to delete the db and hash files -- but then it proceeds to upload all of the 245 files.

I am also working on synchronizing various libraries, which is a whole different layer of issues.

Question: Let's assume I have all of the actual song files correctly synchronized via OneDrive -- such as if I actually set MobileSheets storage to a OneDrive location. If I were to copy the master "mobilesheets.db" (default) database from it's correct location to the corresponding correct location on the second computer would MobileSheets load and function correctly with the copied database? Or more to the point, if I were to copy all of the library databases, including librarytwo.db, librarythree.db, etc., would my various libraries now load on the client with the most current information?

If not, are there additional files I would need to copy to create a mirror image on the second computer?

errata: I don't know why this is happening, but in the library song list on the master, both the artist and the composer are displayed below the song title. However, for some reason, the composer is not displaying on the client computer. So, for instance, on the master computer, Yellow Submarine shows "Beatles - John Lennon, Paul McCartney. But, the client computer now shows "Beatles - Revolver" (I have "Revolver entered in the Album field). Yet when I look at the fields via "Edit" the data is correctly in the fields.

This is true even where I have the {composer:} field filled out in the .cho file (which typically imports to the fields ...)
Reply
#4
If you use the default storage location, and copy all of the contents of that storage location folder to the other devices, it will duplicate everything and the library should work fine. There will be an error at startup if you copy the xml files, because the path to the folder will be different on each device, but you can then just select the option to use the default storage location. If you copy just the song files/folders and mobilesheets.db, that should work perfectly fine without the previously mentioned error at startup. You wouldn't rely on the sync feature anymore if you do this - you'd just upload/download files, or use a third party file sync application. 

As far as your second question, go to Settings->Library Settings->Song Title Formatting. The format for the caption field must be different on each device. You can choose what fields are displayed for both the title and caption.

As a side note, if you want to share a library backup file and/or the sync folder with me, I'm happy to investigate this more, but without that, I will have no way of providing more information for you on why the sync is failing.

Mike
Reply
#5
(09-04-2023, 06:26 AM)Zubersoft Wrote: If you use the default storage location ...
Thanks, this is good information. I do appreciate your offer to take a look at my files.  What email would I share to?

No, actually I do not use the default location, because I want easy access to the song files from other applications. But, of course, the library.db files stay in the default location.

I think one option for me (to solve the OneDrive update synchronization) would be to rebuild the entire default database, but I already have a gazillion hours in this project (setting up multiple computers, rewriting a lot of pdfs into cho files, etc.) So, at present I can make it work, it's just "not elegant" -- because it unnecessarily uploads all of the unchanged song folders and song files.

For the additional libraries, I made sub-folders in OneDrive, but this results in saving multiple copies of the songs that are also in the main set of files.  So, a solution that involves just copying the library.db files would be more efficient. It also would allow me to utilize my NextCloud system instead of OneDrive.

So, I am going to see if I can implement library.db copying system. Then, if the storage location is in OneDrive, the song folders/files are always synchronized and all I have to do is copy the libraries. 

I tried copying mobilesheets.db to OneDrive, but without the hash file, the synchronization system does not "see" the db file.

I'll let you know how I do on this.

Now if I could only figure out how to make MobileSheets run on Linux ...
Smile
Reply
#6
I think I have this working, although I still have some tablets to implement (and to experiment with an Android script for the Android tablets). My "tablet" Windows -computers boot into an onscreen running instance of MobileSheets, and as MobileSheets starts via a batch (.bat) file, I simply added "copy" commands to the startup batch file. "copy \Y [source location] [Zubersoft destination location] (The underlying assumption is that each computer is utilizing the same OneDrive folder as the storage location, so that individual folders/files are also automatically updating.)

This may be helpful for someone:

(1) For Windows to start PasswordLess, the PasswordLess setting must be changed in the registry. (Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device\DevicePasswordLessBuildVersion) -- set to 0 (zero).

(2) Select the user to start automatically with Windows key +R -> netplwiz

(3) find the shortcut file to MobileSheets in the Apps folder. Win+R -> shell:AppsFolder. copy the shortcut to the desktop. What I do then, just so I know where to find it ... rename to "mobilesheets" (the actual name will the be "mobilesheets.lnk". I move this shortcut to a folder I create c:\utils\links.

(4) I make a .bat file, "mobi.bat" that contains the command c:\utils\links\mobilesheets.lnk ... I also now put the copy commands into this bat file

(5) I move mobi.bat to the startup folder: win+R->shell:startup

Now the computer will startup without needing a password, copy the latest library.db files and start MobileSheets. (Needless to say, these are computers that have no other purpose other than to run MobileSheets -- there is no other data on the computer and the computer uses a Microsoft/OneDrive account created solely for these laptops. (Cost was somewhat manageable because I purchased a fleet of used 2-in-1 computer/tablets from eBay).

The resulting bat file looks something like this:

copy /Y C:\Users\bdb\OneDrive\mobilesheets_yoga2\aaa-dbfs\library1.db C:\Users\bdb\AppData\Local\Packages\41730Zubersoft.MobileSheets_ys1c8ct2g6ypr\LocalState
copy /Y C:\Users\bdb\OneDrive\mobilesheets_yoga2\aaa-dbfs\library2.db C:\Users\bdb\AppData\Local\Packages\41730Zubersoft.MobileSheets_ys1c8ct2g6ypr\LocalState
copy /Y C:\Users\bdb\OneDrive\mobilesheets_yoga2\aaa-dbfs\library3.db C:\Users\bdb\AppData\Local\Packages\41730Zubersoft.MobileSheets_ys1c8ct2g6ypr\LocalState
copy /Y C:\Users\bdb\OneDrive\mobilesheets_yoga2\aaa-dbfs\mobilesheets.db C:\Users\bdb\AppData\Local\Packages\41730Zubersoft.MobileSheets_ys1c8ct2g6ypr\LocalState
c:\utils\links\mobi.lnk

You will see that I created a folder "aaa-dbfs" in my server OneDrive/mobilesheets folder. When I start the server version of MobileSheets, I run a "reverse" bat file that copies the latest library.db files INTO the OneDrive aaa-dbfs file.

I do not let any of the client computer/tablets alter or input any of the songs or song data. (Well, in theory. If I do this by setting the storage location to the OneDrive mobilesheets directory, the files are not "read only" putting my server mobilesheets folders and songs at risk of inadvertent modification.  I will have to figure out what to do about this, especially as the server OneDrive folder is actually shared from the client OneDrive to the server OneDrive and not the other way around.  I may have to change that so I can make the shared folders read only.)

I will do a further post if I run into issues with this iteration of my fleet of MobileSheets computer/tablets.

end
Reply
#7
That all sounds like it should work nicely. As far as Linux, one of my goals is to switch the Windows version from UWP to Avalonia. If I'm able to complete this work, then I would (in theory) be able to release a Linux version, but I'm not making any commitments or promises in regards to this. I just wanted to mention as it may be possible in the future.

Mike
Reply
#8
(09-04-2023, 04:33 PM)Zubersoft Wrote: That all sounds like it should work nicely. As far as Linux, one of my goals is to switch the Windows version from UWP to Avalonia. If I'm able to complete this work, then I would (in theory) be able to release a Linux version, but I'm not making any commitments or promises in regards to this. I just wanted to mention as it may be possible in the future.

Mike

Thanks, Mike! Linux would be a pleasant surprise, but I'm sure Linux users are a tiny portion of the user base, so there is no pressure on that score ... I used to use some other software that was only available in iTablet world, which was really inconvenient (and for me, ran on a really old unit that could not be upgraded past antiquated versions.) Now I'm able to run your Mobilesheets on antiquated windows-based 2-in-1s  off of eBay, and that is working out really well. Much larger screen than any of my tablets -- and a major advantage is that I was able to use identical computers so that the displays all match for server-client page changes. (It is also a major plus to be ALSO able to sync to Android and iPad ...)

Yes, it did turn out that I had edited my server to display artist/composer on the library list page ... but did not do so on the clients. Initially, there were very few songs entered with this data, so I failed to notice.
Reply
#9
Still fighting with this problem, the only way I can update OneDrive from my server laptop is to delete mobilesheets-hashcodes.txt from the OneDrive folder, and then all of the songs are re-copied.

I am also having a problem with numerous backup files being created in OneDrive. This did not happen earlier and I don't know if it is from MobileSheets or from OneDrive. So, if I update "song.cho", I will end up with "song.cho" and "song-computer1.cho", "song-computer2.cho", etc. I do to want these, they take up a lot of OneDrive ... and are difficult to eliminate since I have my songs in individual folders. (So, I have switched to the no-folders mode going forward.)

Anyway, here is the crash log I get:
11:10:16 AM - Downloading mobilesheets_hashcodes.txt
11:10:16 AM - Downloading mobilesheets.db
11:10:17 AM - Initializing database
11:10:26 AM - Comparing song Addams Family - score

<snip - entire song list, and the new song:>

11:10:33 AM - Comparing song If It Hadn't Been For Love - Em
11:10:41 AM - Failed to get or create folder mobilesheets_yoga2.Error:

Status Code: BadRequest
Microsoft.Graph.ServiceException: Code: invalidRequest
Message: ObjectHandle is Invalid
Inner error:
Code: invalidResourceId
AdditionalData:
date: 2024-06-20T18:10:33
request-id: ac31161d-6737-4166-99a6-ee7bad90f8d0
client-request-id: ac31161d-6737-4166-99a6-ee7bad90f8d0
ClientRequestId: ac31161d-6737-4166-99a6-ee7bad90f8d0

at Microsoft.Graph.HttpProvider.<SendAsync>d__18.MoveNext() + 0x405
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__40.MoveNext() + 0x44f
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at Microsoft.Graph.BaseRequest.<SendAsync>d__34`1.MoveNext() + 0x183
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at MobileSheetsPro.UI.Cloud.OneDriveService.<MkDir>d__32.MoveNext() + 0x1a3
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() + 0xf
at MobileSheetsPro.UI.Cloud.OneDriveFileProvider.<MkDir>d__10.MoveNext() + 0x112
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() + 0xf
at MobileSheetsPro.CloudHandler.<GetOrCreateFolder>d__46.MoveNext() + 0x7f5
Reply
#10
I have no idea why you are ending up with song-computer1.cho and song-computer2.cho. That makes no sense to me unless it's some weird behavior with OneDrive. I certainly don't append "computer" to the file name in MobileSheets itself. As far as the error, MobileSheets can't access the mobilesheets_yoga2 folder. I'm not sure if that is due to a connection error partway through, or if it's some kind of access issue with the folder itself (or a weird API error). If you want me to investigate this further, the fastest thing is for you to share a library backup file (Settings->Backup and Restore->Backup Library) with mike@zubersoft.com and also share access to the sync folder so I can try synchronizing to it. I will then see if I encounter the same problem. If so, I'll have a way to look into the issue. Is this with a personal onedrive account or a business onedrive account? I'll have to have you share access with a different account depending on that.

Thanks,
Mike
Reply




Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.