Twonky Server database issues & fix

cpt_paranoia wrote:

Thanks for the help shutting down Twonky & restarting cleanly.  Looks simple enough, essentially making the entire directory invisible.  I’ll give that a go, since Twonky is utterly **bleep** at the moment.

 

No problem.

 

Maybe I’ve too long designing embedded systems (the last 30 years), and may be expecting too much of software.  You’re probably arguing that Linux isn’t a real-time operating sytem, so cannot respond in time to a power-down interrupt in time to kill all processes before the power really dies.  But devices like TiVo and Humax are also based on Linux, and seem to cope with power outages without incident (a good thing too, seeing how many times the Humax froze and had to be hard re-booted until I upgraded the firmware recently…).  I see no essential difference between a NAS and an HDD recorder/player.

 

No OS even embedded ones can intercept and/or react in the event of total power lost where backup power is unavailable. Those devices you quoted doesn’t have the same role of managing large db entries with your amount of medias. But the same will happen to them, eg. while recording then it freezed or encountered power lost, the recording will be corrupted. 

Okay, tried your recommendation.

As I suspected, having shut down media streaming from the Dashboard, twonky wasn’t running, so I got:

MyCloud:/CacheVolume# service twonky stop
PID file /var/run/mediaserver.pid not found, stopping server anyway…
twonkystarter: no process found

At least I think that means twonky wasn’t running…

Directory obscured and twonky restarted from the Dashboard, and I hear the NAS beavering away in the background.

Fingers crossed it behaves from now on…  It’s looking promising.  Thanks again.

The MyCloud box looks to be a nice little Linux machine.  I can see myself playing with this rather than using Cygwin on the PC…  It has AWK installed, which is a mainstay of my my unix productivity tool hacking for all manner of design & analysis tasks…  I know it’s rather old skool, and I should probably be using Python, but I’m used to it now after 20 years…  Oh, it’s got Python, too…  Shame it doesn’t have the PostScript tools ps2pdf, etc.

In cygwin use gawk:

C:\Users\Nazar>echo "a b c" | gawk '{print $2}'
b

ps2pdf is not available but you still can install via ghostscript though you’ll need to compile them with 64k page size memory patch for wdmycloud firmware v4 onwards. See my signature for how-to details if you’re interested…

Point taken on the large databases.  All the more reason for a ‘kill everything and start again’ button; ‘Rebuild’ didn’t seem to do that.

Anyway, back to the clean restart…

Everything was going smoothly.  Then I started to change the various parameters back to what I wanted: sharing directories, rescan interval, and, finally, the compilation directory names.  The latter required a server restart.  The log file is now showing the

02:14:08:827 [Error] - LOG_SYSTEM: upnp_multiuser_load : load user-db from twonky.users: failed
02:14:08:828 [Error] - LOG_SYSTEM: Error: 2 No such file or directory

error again.  It looks like the user ID string is being changed for some reason (it’s not me doing it):

UserID Please Do NOT change it manually

userid=[deleted]

Comparing two .ini files, the first 16 characters of this userid change.  The last 16 characters are the same.  So, for all our discussion of reslience ot power outages, it’s looking like that isn’t the problem after all…  So, if the user-db is based on this name, it won’t be able to find it when the server restarts, since the name has changed.

Should I be able to change the parameters whilst the scan is in progress? I can see no way of stopping the scan and leaving the Twonky UI up and running.

I’ll clean up again and try the various settings changes a bit more systematically, and I’ll force a server restart at each change, and check the logfile.  But not tonight; it’s way past my bedtime…

You need to restart for changes in the conf to take effect. At anytime during the scan you can stop them by any means, eg. sigterm or better service twonky stop.

Don’t worry, I’ve been using AWK under cygwin for years.  Can’t remember whether it’s mapped to nawk or gawk…

Anyway, getting back to the misbehaving Twonky server.

I don’t want to use Linux admin commands if I can help it (other than wiping the service clean), as I’d like to see what the problem is with the consumer user interface that seems to be causing the problem.

So I’ve spent the last hour or so repeatedly killing, cleaning & restarting the Twonky server, whilst changing one option at a time, saving the changes, and restarting the server each time.

Sadly, I don’t seem to have come to any useful conclusion.  I’m beginning to suspect that Twonky throws a fit at some random point, entirely independent of my changes.  It got to the point where all I did was enable logging, leave it for a while, then restart, to find it immediately gave a number of errors.

00:05:03:714 [Startup] - LOG_SYSTEM: server_main_impl : ***Starting TwonkyServer (Product Name:Twonky, Version:7.2.9, Build-date:Sep 15 2014)***
00:05:03:715 [Startup] - LOG_SYSTEM: server_main_impl : using logfile /CacheVolume/twonkymedia/twonkymedia-log.txt
00:05:03:715 [Startup] - LOG_SYSTEM: server_main_impl : Executable file: /usr/local/twonkymedia-7/twonkyserver
00:05:03:715 [Startup] - LOG_SYSTEM: server_main_impl : Command Line Parameters: 9
00:05:03:715 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 1:-D
00:05:03:715 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 2:-ip
00:05:03:715 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 3:192.168.1.69
00:05:03:715 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 4:-httpport
00:05:03:716 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 5:9000
00:05:03:716 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 6:-appdata
00:05:03:716 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 7:/CacheVolume/twonkymedia
00:05:03:716 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 8:-logfile
00:05:03:716 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 9:/CacheVolume/twonkymedia/twonkymedia-log.txt
00:05:03:767 [Startup] - LOG_SYSTEM: upnp_ini_file_check_for_old_inis : exisiting ini file /usr/local/twonkymedia-7/twonkyserver-default.ini copied to /CacheVolume/twonkymedia/twonkyserver.ini
00:05:03:767 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : reading ini settings from /CacheVolume/twonkymedia/twonkyserver.ini
00:05:03:767 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : contentbase = /shares
00:05:03:767 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : contentdir = +A|/Public
00:05:03:767 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : followlinks = 0
00:05:03:768 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : scantime = -1
00:05:03:768 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : friendlyname = %HOSTNAME%
00:05:03:768 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : ignoredir = AppleDouble,AppleDB,AppleDesktop,TemporaryItems,.fseventsd,.Spotlight-V100,.Trashes,.Trash,RECYCLED,RECYCLER,RECYCLE.BIN,Software,_WDPROT,.wdmc,.wdphotos
00:05:03:768 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : mediafusionserverurl =  
00:05:03:768 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : profileserviceurl =  
00:05:03:768 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : autoupdateurl =  
00:05:03:768 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : disablelocalssdp = 1
00:05:03:768 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : streambuffer = 131072
00:05:03:769 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : nicrestart = 1
00:05:03:769 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : uploadenabled = 1
00:05:03:769 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : servermanagedmusicdir = /shares/Public/Shared Music
00:05:03:769 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : servermanagedpicturedir = /shares/Public/Shared Pictures
00:05:03:769 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : servermanagedvideodir = /shares/Public/Shared Videos
00:05:03:769 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : disableduplicateremoval = 1
00:05:03:769 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : disablemytwonky = 1
00:05:03:769 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : enablereporting = 0
00:05:03:770 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : includefolder = 1
00:05:03:770 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : disabletimeseek = 1
00:05:03:770 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : uploadmusicdir = /shares/Public/Shared Music
00:05:03:770 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : uploadpicturedir = /shares/Public/Shared Pictures
00:05:03:770 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : uploadvideodir = /shares/Public/Shared Videos
00:05:03:770 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : autoshare_upload_dirs = 0
00:05:03:770 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : scannerioprio = idle:low
00:13:36:079 [Error] - LOG_EVENTING: handleConnections : Received error in unsubscribe (3) response 404 from http://127.0.0.1:9000
00:13:36:130 [Error] - LOG_EVENTING: Error: 115 Operation now in progress

00:13:36:624 [Error] - LOG_DB: filedb_item_add : called without upnp_dbx_init
00:13:36:624 [Error] - LOG_DB: Error: 2 No such file or directory

00:13:41:837 [Startup] - LOG_SYSTEM: server_main_impl : ***Starting TwonkyServer (Product Name:Twonky, Version:7.2.9, Build-date:Sep 15 2014)***
00:13:41:837 [Startup] - LOG_SYSTEM: server_main_impl : using logfile /CacheVolume/twonkymedia/twonkymedia-log.txt
00:13:41:837 [Startup] - LOG_SYSTEM: server_main_impl : Executable file: /usr/local/twonkymedia-7/twonkyserver
00:13:41:837 [Startup] - LOG_SYSTEM: server_main_impl : Command Line Parameters: 9
00:13:41:837 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 1:-D
00:13:41:837 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 2:-ip
00:13:41:837 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 3:192.168.1.69
00:13:41:837 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 4:-httpport
00:13:41:838 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 5:9000
00:13:41:838 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 6:-appdata
00:13:41:838 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 7:/CacheVolume/twonkymedia
00:13:41:838 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 8:-logfile
00:13:41:838 [Startup] - LOG_SYSTEM: server_main_impl : cmdline 9:/CacheVolume/twonkymedia/twonkymedia-log.txt
00:13:41:928 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : reading ini settings from /CacheVolume/twonkymedia/twonkyserver.ini
00:13:41:940 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : friendlyname = %HOSTNAME%
00:13:41:940 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : ip = 192.168.1.69
00:13:41:940 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : nicrestart = 1
00:13:42:971 [Error] - LOG_SYSTEM: upnp_multiuser_load : load user-db from twonky.users: failed
00:13:42:971 [Error] - LOG_SYSTEM: Error: 2 No such file or directory

I note in particular the errors as soon as it stops before re-starting (I think):

00:13:36:079 [Error] - LOG_EVENTING: handleConnections : Received error in unsubscribe (3) response 404 from http://127.0.0.1:9000
00:13:36:130 [Error] - LOG_EVENTING: Error: 115 Operation now in progress

00:13:36:624 [Error] - LOG_DB: filedb_item_add : called without upnp_dbx_init
00:13:36:624 [Error] - LOG_DB: Error: 2 No such file or directory

and then the error after it starts up again:

00:13:41:940 [Startup] - LOG_SYSTEM: upnp_ini_file_read_properties_impl : nicrestart = 1
00:13:42:971 [Error] - LOG_SYSTEM: upnp_multiuser_load : load user-db from twonky.users: failed
00:13:42:971 [Error] - LOG_SYSTEM: Error: 2 No such file or directory

It looks like it’s having a problem with the database (in that is simply isn’t building one, which is why I can’t see it…)  Where is the database usually stored?

If I look in the /CacheVolume/twonkymedia/db directory, all I see are .wpl files; there’s no .db file.

The only .db file found on twonkymedia is the twonky-locations-70.db file.

There IS a large 1.tms.dat file in twonkymedia/db  I guess that’s the database, then…  It’s 12M and growing…

I confess I’m getting tempted to work up to a full factory restore and restore all the data from my backup disks, and take the hit on the restore time and minor loss of data since the last backup.

I note that the Dashboard/Utilities isn’t offering to run either set of diagnostics; they’re both greyed out, and re-booting didn’t change this.  This doesn’t sound right…

if you do a restore I would start with a system only restore, no data/share lose, evrything else reset

if you want a factory restore to the quick instead of full. Same thing except the full write multiple patterns everywhare on the disk to prevent recovery, good if you sell a drive, externly slow to complete

if you do a restore I would start with a system only restore, no data/share lose, evrything else reset

I started with a Reboot.  No improvement.  As the MyCloud came back up, and loaded the saved configuration file, it started spitting out a vast swathe of red errors (so many I couldn’t be bothered to note all the details, but essentially whinging about not finding some [unspecified] ‘connection’).  Closing and re-starting the UI seemed to shut them up, and eventually it came back up looking fairly sane.

I ran the Quick Diagnostics, and that reported no problem.

I escalated to System Only Restore.  Doesn’t look like there’s any improvement, but I’ll try a Twonky shutdown/clean/restart cycle.  I’m not holding out much hope.  It does a scan, finds lots of media, but none of it can be played, but then forgets it all and reports it can only see two songs and a few pictures.  Re-starting gives errors, but reports it is finding media.

Reading around the forum, I get the impression that it’s pointless asking questions of WD: they don’t seem to do customer support.  Is that a fair assessment?

Okay, I’ve clean-started Twonky.  And this time, I’m actually able to play MP3 files.  I’ll see how long that lasts…

set parameters

     Setup/Servername = ParanoiaTwonky
     Sharing/Shared Folders (browse to selection)
         /Public/Shared Music        All
         /Public/Shared Pictures    Photos
         /Public/Shared Videos      Videos
     Advanced
         Compilation Folders        Various Artists
         Rescan Interval                 1440 minutes
         Ignore Directories             add:
             MediaMonkey,OtherMusic,FailedRip,metadata,scripts,artwork,Playlists,old_processing,
     [auto-restart due to changes]

[edit] 2015/02/24: I shouldn’t have put my media in the ‘Shared Media’ folders; these appear to be intended for Twonky to store media it copies from other libraries when working on ‘AutoCopy Aggregation’ mode.  The trouble is that these appear the first time the MyCloud is turned on, so it looks like that’s where your supposed to put your media: you’re not…

Using the following folders to store my media seems to make it work properly:

         /Public/Music        All
         /Public/Pictures    Photos
         /Public/Videos      Videos

[/edit]

Ah well, that was a brief working interlude…  The tracks that I was able to play before the auto-restart are no longer playable; it either crashes MediaMonkeyAndroid, or else the poor thing just skips through the tracks as unavailable.

If there’s anything obviously troublesome in the settings I’ve used, please shout.  All were accepted without comment.

I was discussing animal conditioning with a colleague at lunctime, and I realised I am being conditioned to continue struggling with this thing; every now and then, it throws me a bone, briefly, and then snatches it away from me.  The rational thing would probably be to write it off as a heap of junk, and move on.  But I’m stubborn, and don’t like being beaten by technology.

Having reviewed my ‘computer stuff logfile’, I note that I’ve never successfully played music from Twonky (so today’s brief window was a first, and the problems are probably nothing to do with the unscheduled power cycle).  I’ve been trying to get MediaMonkey’s DLNA server running wwithout the MM UI client, but without any luck.  So I thought I’d try Twonky…  I’m sensing a pattern here.

Still no error in the logfile, though, so maybe I’ll keep my fingers crossed that it sorts itself out when it’s finished scanning.

Whilst it’s scanning, I took a look in the /CacheVolume/twonkymedia/db directory.

There are lots of .wpl files, and, looking at a few, I notice that they’re derived from .m3u files left behind by my ripping process.  I can make MediaMonkey ignore these when it scans for media.

Is there a way of making Twonky ignore them, or do I need to delete them, as I suspect that it may be confusing the scanner, making it think create soft links to files mentioned in the .m3u files (that aren’t usually there, because they’ve been format converted and re-named).  I leave the .m3u files behind when ripping with EAC, as a record of the rip process.  But if they’re upsetting or confusing Twonky, I’m happy to delete or move them all into a sub-directory I can then exclude from Twonky searches.

I used Kinksy on the PC to browse the Twonky server.  Here are the properties of one file:

Type                  object.item.audioItem.musicTrack
Title                   Track01
Album               Learn French Disc 1
Artist                  Linguaphone
Genre                Unknown
Release Year   2012
Original Track No.    1
Duration           2:55
Size                   14MB
Mime Type        audio/x-flac
Protocol Info    http-get:*:audio/x-flac:*
Uri                      http://192.168.1.69:9000/disk/NON-DLNA-OP01-FLAGS01700000/O0$1$8I39937.flac
Artwork Uri        http://192.168.1.69:9000/disk/DLNA-PNJPEG_TN-OP01-CI1-FLAGS00d00000/defaultalbumart/a_u_d_i_o.jpg/O0$1$8I39937.jpg?scale=160x160

Hmm URI ‘NON-DLNA-…flac’?

Well, after a few server restarts, it looks like I’m no longer getting an error, so whatever it was that was causing that seems to have been fixed by the System Restore.

Shame that Twonky seems to have reverted to its behaviour before all this started, which is not serving media.

I guess it’s time to give up with Twonky and try yet another DLNA server.  MiniDLNA here we come.  Wish me luck…

I think the final proof that things aren’t well with my Twonky is to go to its own media browser, in the top right of the web UI.

If I select any music, it comes back as file not found.  If I browse photos, I see thumbnails but, again, it comes back as “404 file not found The requested URL was not found on this server” when I double-click on the thumbnail.

Not good.

I thought I might try to get some support from Twonky.  So I clicked on the ‘help center’ button on the Twonky UI.

“Sorry, the community that you’re looking for has been retired and is no longer available. If you need help, please contact the company you’re looking for directly.”

Hmmm…

So I clicked on the twonky.com link:

http://twonky.com/

Looks like they just want me to buy more stuff.

So I googled ‘twonky user manual’, and the first hit was

http://twonky.com/help/

Hmmm… why isn’t this page visible from twonky.com…?

I clicked on the ‘Twonky FAQ’ button

http://twonkyforum.com/questions/popular

“The requested URL /questions/popular was not found on this server.”

Hmmm…

I clicked on the ‘Known Issues’ button

http://twonkyforum.com/problems/active

“The requested URL /problems/active was not found on this server.”

I clicked on the ‘Support’ button.

A pop-up appeared, 'Powered by GetSatisfaction"

This has a title “To post or comment, please sign in”.  I briefly saw something flash up that looked like a login page, but then the pop-up reverted to a lot of what looks like Javascript diagnostics…

Just to make sure I was looking at the rgiht page, I clicked on the ‘Twonky Server’ at the top of the page

http://twonky.com/store-old/

Only to get another Error 404 PNF message…

I clicked on the ‘Visit Twonky Support Community’ button

http://twonkyforum.com/

Hooray!  Some actual content at last…

Browsing through the Twonky Server section, I found this:

http://twonkyforum.com/viewtopic.php?f=2&t=11746

Could it be that all this trouble is because, for some reason, the ‘Media Streaming’ option had been turned off in the Dashboard/Shares page…?  Would it not be a good idea to check this setting if a user enables media streaming on the Settings/Media page…?  This thread also suggests that there’s a conflict between the WD Dashboard and the Twonky UI, so that settings changed under the Twonky UI are trashed by the WD Dashboard.  This seems less than optimal, too.  I might follow the advice to disable the WS script that trashes the Twonky settings. Or just never restart Twonky from the WD Dashboard.

I’ll let it finish the scan, and see whether it allows me to see and use the media.  I’ll report back.

As for manuals, well, there’s one for Twonky V6:

http://www.mswhs.com/2010/07/twonkyserver-6-0-user-guide/

Does this seem an appropriate level of support for a product (from Twonky or WD)?  I certainly don’t think so.  At the very minimum, there ought to be a downloadable user manual.  Actually, I thought that was mandated by US law; manuals for products sold in the US must be available online (not that I’m in the US, but it has been quite helpful in the past…).

1 Like

Well, it looks like I now have a working Twonky Server, and it was those Twonky forum threads provided the answer.  I still have some tweaks to do, such as finding out why it is finding picutres in my Shared Music directory, even though I’ve told it to only look for music there (i.e. I don’t want album art appearing in ‘Photos’).

Essentially, I had three problems:

  1. Unscheduled power down caused some issue with the services provided by MyCloud, so Twonky kept generating errors.  A System Restore fixed this problem.  A saved Configuration file helps with System Restore.

  2. For some reason, I had Media Streaming disabled on the Public share. Twonky started up looking for media on the Public share, catalogued it, but then wasn’t allowed to access it for playback.  I suspect it also realised that it wasn’t allowed access, and cleared its database.

  3. There’s a conflict between the WD and Twonky UI control interfaces over which of them is ‘in charge’ of the which directories are to be searched.  Thus, turning Twonky off and on via the WD Dashboard resets the search back to default.  This can be prevented by disabling the WD script that modifies the twonkyserver.ini file: see the Twonky forum thread in the post above for details.

Many thanks to Nazar78 for taking the time to respond.

Well, after some considerable experimentation and frustration at getting Twonky to look for different media types in each of the different shared Media folders, I’ve come to a fairly unsurprising conclusion.

The MyCloud _ insists _ on creating the following folders for shared media:

/Public/Shared Music

/Public/Shared Pictures

/Public/Shared Videos

[edit] 2015/02/24: Actually, it’s Twonky that creates these folders.

I shouldn’t have put my media in the ‘Shared Media’ folders; these appear to be intended for Twonky to store media it copies from other libraries when working on ‘AutoCopy Aggregation’ mode.  The trouble is that these appear the first time the MyCloud is turned on, so it looks like that’s where your supposed to put your media: you’re not…

Using the following folders to store my media seems to make it work properly:

         /Public/Music        All
         /Public/Pictures    Photos
         /Public/Videos      Videos

[/edit] 

If you rename them, it re-creates them whenever it re-starts*.  This annoyed me when I first got the MyCloud.  But, whilst I generally like to be in control of what my filesystems are called, I gave in, and accepted this enforced structure.

However, I note the space in the path name.  Now, the NAS is a Linux box.  And Twonky runs under Linux.  And Unix of all flavours is well known for its dislike of spaces in pathnames.  So I began to expect that this space was the root cause of all the problems I was having.

My experience of setting Twonky’s shares to search for media as follows:

/Public/Shared Music - Music only

/Public/Shared Pictures - Photos only

/Public/Shared Videos - Videos only

was that it would go off and create the database, but if you tried to stream any of that media, it refused, and eventually, the list of content dropped back to zero.  Something was confused, and it could not be corrected without an SSH login & deletion of the entire /CacheVolume/twonkymedia directory.  I wrote a script to save the .ini, delete the directory, make a new one and copy the saved .ini back.  Yes; I was doing it that often whilst experimenting…

So I created another folder to test this theory:

/Public/Shared_Videos

I put a few videos in it, and set Twonky to search it for videos.

Bingo!  No more problems!

So I’ve now renamed the folders to remove the pointless 'Shared ’ part (since it’s on ‘/Public’, it’s obviously shared…), and fully expect Twonky to behave from now on.

It’s searching /Public/Music at the moment, and I’m still able to stream media.

Frankly, it’s a schoolboy error to create folders with pathnames containing spaces on a linux system, without protecting them with quotes.  But then, so is failing to back up twonkyserver.ini before a firmware upgrade, and restore it after the upgrade, before restarting Twonky.  But that’s exactly what the MyCloud firmware upgrade process does…  I may seek out the upgrade script and try to bend it to my will (i.e. do the right thing and save/restore the Twonky ini file).  I’ve turned off automatic updates in the meantime.

* Ha! I just went back to /Public to create empty /Shared Media folders to keep MyCloud happy.  Only to find that it had already recreated its beloved folders…  I’ll just have to accept that it leaves unwanted droppings on MY filesystem.

My conclusion to this episode?  This:

[edit 2015/02/24]

Some better explanation of how Twonky works is probably needed, to stop people putting their media where it seems ‘sensible’.  See my FAQ link in the edit of the first post.

[/edit]

This is something WD needs to address in a future Firmware upgrade. I run linux based software at work that has been ported to Windows … and no Filename or Directory can have spaces within their naming convention, we always use an “_” underscore. WD has to be aware of this … wouldn’t you think? :confounded:

Linux/unix do allow spaces in names, they need to be quoted and a difficult to use and NOT recommended

they can actually contain most charcters even control characters. I have had a few cases over the years where I have had to delete by inode number as I couldn’t delete the file from a terminal session. no idea how the user created the files

This is something WD needs to address in a future Firmware upgrade. 

I fear that this is unlikely to happen.  There are now so many systems out there with the default media directories:

Public/Shared Music

Public/Shard Pictures

Pulbic/Shared Videos

that changing those default names to include underscores would cause chaos on a firmware upgrade…

The best we can hope for is that WD do a proper integration job on Twonky, and stop the conflict between the Dashboard UI and Twonky UI, so that users can actually use the increased versatility of the Twonky UI without having their settings trashed by MyCloud.  I spotted last night that WD have snuck in a caveat on their Twonky server help page:

http://wdc.custhelp.com/app/answers/detail/a_id/3299/~/how-to-access-the-twonky-media-server-on-a-wd…

Actually, a simpler alternative might be to stop enforcing the Public folder names, but recommend them as (rather stupid) defaults, and allow the user to choose their own names.  Rather like I’ve done by removing the 'Shared ’ prefix from my media folders.

For completeness, my findings on the many ways in which MyCloud trashes Twonky are as follows:

i) Stopping and restarting media streaming via the Dashboard destroys any settings made via Twonky UI

ii) MyCloud firmware upgrade destroys any settings made via Twonky UI

iii) MyCloud firmware upgrade probably changes one or two ‘magic numbers’ in the Twonky config file, so saving and restoring a Twonky config around a firmware upgrade will cause Twonky to give Error -2, and not work

iv) System Restore appears to disable media serving on Shares, so, even if Twonky restarts and catalogues your media, it finds it cannot play it, and deletes it from its database.  This appears as the database building normally, and then dropping back to empty when it’s finished…

v) the default media folder names are incompatible with non-trivial database searches (those spaces stop you selecting anything other than ‘search /Public for all media types’)

Ideally, a proper integration would look for an existing Twonky config file, and do any necessary inline edits to it to support new MyCloud firmware.  And it wouldn’t trash the config file when media streaming is stopped and restarted under the dashboard.  This latter can be prevented by stopping the script that overwrites the Twonky config file:

cd /usr/local/sbin
mv writeTwonkyContentDir.sh writeTwonkyContentDir.sh.old

You’ll need to SSH in to MyCloud Linux shell do this.

It wouldn’t be that hard for this script to check for the existence of a Twonky config file, and leave it alone when restarting media sharing (I might go an edit it to do just that… only for it to be trashed again by a firmware upgrade).

Twonky isn’t integrated into MyCloud; it’s just sitting on top of it, struggling for survival…  WD Support tried to refer me to the twonky.com website, apparently blissfully unware of my observations of 11-20-2014 08:35 PM (i.e. the website provides no support for Twonky).  The fact that WD don’t provide an up-to-date manual for the version of Twonky shipped in WD’s product is also very poor; they seem to be saying “not our problem, mate; Twonky is nothing to do with us”.  Whereas I think it is their problem, since it’s a feature of their product, prominently advertised on the MyCloud packaging.

1 Like