HubiGraph LongTerm Storage Error

Looks like the append file method is where that exception is being thrown... No solution at this stage...

In the file:

Thanks.
Unfortunately all this cloud malarkey means nothing to me.
Now gibberish, I'm an expert. :wink:

2 Likes

I'm thinking some debug.log statements inside the try block may show something.... A couple more minutes I might have something to try... Before I go to bed...

In the meantime, if you can locate the "hubigraph long term storage" driver in your drivers code section of the hub, that will help.

1 Like

As a starting point this may help....

Note - I am suggesting you add to the code some additional logging. In case this produces a large amount of logs, make sure you are in a position to monitor the logs and reverse the change if needed.

Navigate to the Drivers Code page of your HE hub
Locate the long term storage driver for Hubigraphs
Left-click on the driver to open it in the editor
Press Ctrl+F to initiate a text search, pasting in the text "appendFile", or just scroll to this method, line 729
Scroll to the "try" statement, line 749 and paste in the log.debug statements I have included below:

try {
        httpGet(params) { resp ->
           //File exists and is good
            file_data = resp.getData();
			log.debug("appendFile: File Data  = ${file_data}");
            jsonSlurper = new JsonSlurper();
            
            parse_data = convertToMap(jsonSlurper.parseText("${file_data}"));
            log.debug("appendFile: Parsed Data  = ${parse_data}");
            parse_data = pruneData(parse_data, storage);
			log.debug("appendFile: Pruned Data  = ${parse_data}");
            //Get the most Current Data
            then = parse_data[parse_data.size()-1].date;

Save the changes

I can't tell exactly what triggers this, but can only assume there is either a regular schedule inside Hubigraphs or it is triggered when events are recorded, either way, monitor the logs page for the HE hub to see what these logs produce.

The logs that appear before the error and what they contain will hopefully provide insight into where exactly the issue is occurring and some more information as to what is causing the issue.

Simon

Thanks for the help. Really appreciate it.
Also I realise you are the other side of the world and it is late.
GO TO BED. :sleeping_bed:

Just a quick update though.
Did as you suggested and the original error appears and then disappears and leave this.

1 Like

Bed is boring... :wink:

Hmm, interesting.... Looks like the file could be empty or not found.... perhaps another log may be useful... and then you can follow up on whether the file actually exists....

On the line before the "try", add:

log.debug("appendFile: uri = ${uri}");

The file is there and actually contains data.
The data within the file is from when the file was defined so as you suspected it is appending data to the file that is the issue.

When I try again the new error log appears and disappears but it is showing the uri of the file it is trying to write to and it is correct.

http://192.168.0.33:8080/local/HubiGraph_LTS_1069_temperature.json

image

Weird... I would have thought the "File Data" log would have included the text from the file.... That said, I'm pretty sure there is some cleansing of the data either as it goes into the logs or as it is displayed, but not to the point that nothing is displayed...

Perhaps I will need to sleep on it, or someone else can offer some more suggestions...

1 Like

Last suggestion I would make is to try changing:

file_data = resp.getData();

to

file_data = resp.getData()[0];

Now getting.

Summary

Yeah, I probably messed that up now that I look at it...

I'm starting to think it could be something else...

@gopher.ny - I know you said there have been no changes recently that are likely to have affected @bobbles 's issue, but is there any chance that a html page could be being returned from the http request for the json file being stored by Hubigraphs? Bit of a long bow I know, but the fact that the file doesn't include a < but that is showing up in the error, leads me to think something like this could be happening....

Sure... UI security or a 500 error would do that. Can you PM me the hub id? I'll take a look at the engineering logs on the hub.

2 Likes

That would be one for you @bobbles

1 Like

Done. Thanks @gopher.ny

Now go to :sleeping_bed: @sburke781

1 Like

Yes, now I can sleep more easily... :grin:

2 Likes

Hi @sburke781
Looks like the issue was hub security being enabled.
Disabling hub security followed by a reboot has resolved the issue.
Looks like the security update in 2.2.9 is not compatable with Hubigraphs in its present form.
Thanks for your assistance. Much appreciated. :+1:

2 Likes

Wonder if something like:

try {
        httpGet(params) { resp ->
           //File exists and is good
            file_data = resp.getData();
            if(file_data.substring(0,1) == "<") file_data = file_data.substring(1)
...

would allow it to work with security enabled.

Thanks for the info.
Just gave it a try and it still fails.
I'm not overly fussed to be honest.
I'm happy to leave my hubs with security disabled.
Thanks again.

1 Like

Are you talking about hub login security?

Yes. Security enabled under Settings -> Hub Logon Security