Cannot change anything in Vera interface (WriteUserData failed)

Hello,

My vera lite (firmware v. 1.5.408) doesn’t let me change anything anymore (Creating/changing scenes, devices…etc)
I checked the log and got the below errors. It seems user_data cannot be overwritten for some unknown reason.

UserData::WriteUserData failed File Size: 10741 save size 10864 <0x2b55f680> 03 11/26/12 13:41:01.055 JobHandler_LuaUPnP::Reload: ModifyUserData Critical 1 m_bCriticalOnly 0 dirty data 0 <0x2b55f680> 06 11/26/12 13:41:01.058 Device_Variable::m_szValue_set device: 1 service: urn:micasaverde-com:serviceId:ZWaveNetwork1 variable: NetStatusID was: 1 now: 2 #hooks: 0 upnp: 0 v:0xfde028/NONE duplicate:0 <0x2b55f680> 06 11/26/12 13:41:01.058 Device_Variable::m_szValue_set device: 1 service: urn:micasaverde-com:serviceId:ZWaveNetwork1 variable: NetStatusText was: OK now: Resetting ZWave Network #hooks: 0 upnp: 0 v:0xfe2dd8/NONE duplicate:0 <0x2b55f680> 01 11/26/12 13:41:01.287 UserData::WriteUserData failed File Size: 10763 save size 0 <0x2ae2b000>

Any help is appreciated :slight_smile:

Roy.

Out of curiosity, what does df show? Could you have a full file system?

  • Garrett

Plenty of space I guess…

Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 4352 4352 0 100% /rom tmpfs 31240 3256 27984 10% /tmp tmpfs 512 0 512 0% /dev /dev/mtdblock7 11264 8076 3188 72% /overlay overlayfs:/overlay 11264 8076 3188 72% / /dev/mtdblock8 4352 4352 0 100% /mios

I suspect some kind of file system corruption as user_data.json.lzo keeps disappearing.

Anyone knows how to detect and fix file system corruption on Vera ?

Usually when that’s going on with Vera, you’ll see a bunch of crud shown in the output from running “[tt]logread[/tt]”.

I burned out a Vera2 unit about 12-18months back with that problem. I don’t recall the specific errors in the log, but it’ll be obvious since they’re all about IO problems with certain devices.

No suspected entries from logread.

I monitored the /etc/cmh directory and it seems user_data.json.lzo.new is the file being updated while user_data.json.lzo keeps disappearing, even after I recreate it from user_data.json.lzo.new.

the other files user_data.json.lzo1…5 stay the same.

New Update:

I restored the backup file into a brand new Veralite and got the same errors. I think we can rule out the file system corruption possibility… I opened a ticked yesterday with MCV Support. Waiting for their input.

Roy.

Problem solved.

It looks like I had too many plugins running consuming too much memory. Although free showed there was still around 3k available but apparently that wasn’t enough for the LuaUPnP engine to function properly.

I tweaked the plugin so it consumes less memory (each instance consumed around 250k !!) by loading needed libraries using require() on demand and then releasing them (I use socket.http)

so the code would look like this :

[code]function httprequest(url, postMsg)
– Loading the http package
package.loaded.http = nil
local http=require(‘socket.http’)
http.TIMEOUT = 1

local r,c = http.request(url, postMsg)

--unloading the package
package.loaded.http = nil

collectgarbage("collect")

return r,c

end
[/code]

The memory consumed by require() was not fully released (no idea why) but now each instance of the plugin is consuming considerably less memory.

Roy.

Any chance you could help me with my problem that I’m having? I have got the same issue that you have described above but I don’t understand what you did to fix it.

Thanks,
-Ben

The problem was caused by plugins I created that were consuming more memory than Veralite could handle.

I restored from an old working backup to gain control over Vera again, then I enhanced the plugins to consume less memory.

If you don’t have an old backup, you can delete the plugin files that are causing the problem from /etc/cmh-ludl/ and restart .

How to I find out which plugins are consuming too much memory?
Thanks!

The lua function collectgarbage(“count”) returns the total memory in use by Lua (in Kbytes) ( http://www.lua.org/manual/5.2/manual.html#pdf-collectgarbage ).

You can insert it at various points in the plugin code to log the amount of memory used.