Hub error 500

My windows servers are always on so I just used a good old fashioned dos batchfile with wget.exe

Andy

1 Like

Funnily enough, I don’t use RM at all.

Probably 95% of apps on my hubs are custom.
Before now I never had a lockup on any of my hubs unless I was messing with code.

Andy

1 Like

Has any of these instances of error 500 followed by hub "amnesia" been reported to Hubitat Support, and if yes, what was the response?

Sure. Keep in mind that this is exported from my Windows instance of NR so any nodes that reference file location would need to follow Linux formatting (assuming you are using a Linux distro for you NR). Basically flip the slashes as necessary and put the actual folders you plan to store the backups in.

[
    {
        "id": "31f80583.137ffa",
        "type": "file",
        "z": "1a25485a.160c68",
        "name": "Save File",
        "filename": "",
        "appendNewline": false,
        "createDir": true,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 660,
        "y": 40,
        "wires": [
            [
                "fcae276c.cfdc28"
            ]
        ]
    },
    {
        "id": "c916945e.2a3d68",
        "type": "inject",
        "z": "1a25485a.160c68",
        "name": "Dev Hub Daily 4:00AM",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "",
        "crontab": "00 04 * * *",
        "once": false,
        "onceDelay": 0.1,
        "x": 150,
        "y": 40,
        "wires": [
            [
                "67731afb.2979e4"
            ]
        ]
    },
    {
        "id": "67731afb.2979e4",
        "type": "http request",
        "z": "1a25485a.160c68",
        "name": "Get backup",
        "method": "GET",
        "ret": "bin",
        "paytoqs": false,
        "url": "http://192.168.7.1.111/hub/backupDB?fileName=latest",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 350,
        "y": 40,
        "wires": [
            [
                "8eadb6f5.01e168"
            ]
        ]
    },
    {
        "id": "8eadb6f5.01e168",
        "type": "string",
        "z": "1a25485a.160c68",
        "name": "Get filename",
        "methods": [
            {
                "name": "strip",
                "params": [
                    {
                        "type": "str",
                        "value": "attachment; filename="
                    }
                ]
            },
            {
                "name": "prepend",
                "params": [
                    {
                        "type": "str",
                        "value": "\\\\nodered\\\\backups\\\\dev\\\\"
                    }
                ]
            }
        ],
        "prop": "headers.content-disposition",
        "propout": "filename",
        "object": "msg",
        "objectout": "msg",
        "x": 510,
        "y": 40,
        "wires": [
            [
                "31f80583.137ffa"
            ]
        ]
    },
    {
        "id": "fcae276c.cfdc28",
        "type": "fs-ops-dir",
        "z": "1a25485a.160c68",
        "name": "# of Backups",
        "path": "\\nodered\\backups\\dev\\",
        "pathType": "str",
        "filter": "*",
        "filterType": "str",
        "dir": "files",
        "dirType": "msg",
        "x": 130,
        "y": 120,
        "wires": [
            [
                "6a93c3f4.90cd5c"
            ]
        ]
    },
    {
        "id": "6fc01da3.081d04",
        "type": "fs-ops-delete",
        "z": "1a25485a.160c68",
        "name": "Del Oldest BckUp",
        "path": "\\nodered\\backups\\dev\\",
        "pathType": "str",
        "filename": "files[0]",
        "filenameType": "msg",
        "x": 470,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "6a93c3f4.90cd5c",
        "type": "switch",
        "z": "1a25485a.160c68",
        "name": "15 File Limit",
        "property": "files.length",
        "propertyType": "msg",
        "rules": [
            {
                "t": "gte",
                "v": "15",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 290,
        "y": 120,
        "wires": [
            [
                "6fc01da3.081d04"
            ]
        ]
    }
]

@cuboy29, I forgot to add that you would need these nodes installed as well:
node-red-contrib-fs-ops
node-red-contrib-string

1 Like

I think I might just create an http device to check from one hub to another.
That way, if one goes off another one can send me a msg.
I can’t use ping because most of the time you can still ping the hub.
This would only work if you have more than one hub though.

Andy

Here is a nice way of monitoring the hub performance with Node-Red, just in case you feel advantageous of diving into Node-Red

It can send you alerts via pushover. I do something very similar and it has proven helpful in tracking things down, my flow is just not that elaborate.

2 Likes

Yup. Bobby took a look at my db and said it was in bad shape and that I should rebuild it. That is done by doing a soft reset and a restore of the last backup

Also, all of my apps had a little (gc) in the title (using ascii characters). I used this to identify anything I wrote easily. It was pointed out that these characters in the title could be a contributing factor. I have removed them all and cleaned it up and am monitoring it now.

98% of my apps/drivers are custom written/rewritten by myself. I don't get any hub lockups/slowdowns except in the morning when its doing its maintenance and I notice it when I happen to be letting my dog out.

The 500 error was a db issue.

1 Like

I actually do this procedure on a quarterly basis to all of my hubs. It is pretty quick and I figured it might be a good maintenance cycle. No, the Hubitat team has not recommended anything like this but my experience with databases is that some type of maintenance is usually required...

Do we know what the soft reset actually does and are there any drawbacks of any kind?

I have not seen any drawbacks. All my historical data came back fine and all devices were still linked to the system.

I do believe it is doing something. I had an issue that the hub slowed down when I was browsing "old" system events. It would get stuck loading the pages.
After a softReset and the restore, that issue went away and all my old data was still there.

1 Like

Thanks.. I got it working.

I recently went from a single hub with 200 Zwave, Zigbee, telnet, and HTTP devices to 3 hubs where I have Zwave on one, Zigbee on another, and a coordinator with LAN and HTTP plus all devices from child hubs. I rebuilt most rules in 3.0 and was able to remove quite a few because of the conditional actions. No issues so far, knock on wood.

I just got this error on mine and I can’t use my Hubitat anymore. I’m not a database guru or network admin or Windows server admin. I came from SmartThings. This is a huge problem for me. If I don’t have back ups and habitat can’t make its own back ups(?). I guess I’m just screwed and have to start everything all over again. I’ll just go back to SmartThings and update my Amazon review accordingly.

Contact support, you will get an answer faster. User based forums aren't the quickest way to get back running again on a total failure. You really need to engage with support for that, as in these instances every case is unique.

I hope they are able to sort you out!

1 Like

There is an automatic DB backup done at 03:00 everyday. Your device information, I believe is held on the zwave/zigbee stick. Your are probably not in as bad a situation as you think.
Definitely raise a ticket to support though.
Tagging @bobbyD

Everything was wiped on reboot. Super pissed. This is the last thing that a customer should experience. Very amateur.

I see my last auto backup is from several days ago. I lost a lot of work. Maybe the restore will recover everything. How would I know. More importantly my security and automation was totally dead. I travel every week and would never have known or been able to fix remotely. I work in IT. I'd have big problems if my product acted like this.

This is why you should click this BEFORE any updates.
bu

Again, contact support to verify there are no other options.

I will say, though, that there seem to have been a lot more Error 500 issues lately. Has me a little concerned (although in the meantime I've been making daily-ish manual backups just to be 'safer').

Can anyone from Hubitat comment on this phenomenon? @chuck.schwer @bravenel @patrick ?

1 Like

Got all 3 hubs with them this morning after updating to 119 last night, one was completely dead, upon rebooting all was gone, now the restore backup has been running for about 45 minutes.....ya a bit concerning to say the least. Not restoring the other 2 until that one is fixed.

1 Like

I updated all 3 of my hubs to 119 yesterday, and all 3 are still working. I know that doesn't help you in the least - it is just an additional data point.

1 Like