Logic Machine Forum
Problem with socket.http - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Problem with socket.http (/showthread.php?tid=4731)



Problem with socket.http - baggins - 24.04.2023

I have a script running to enter data in an influx database. This script suddenly stopped working. I copied part of the script for testing and I have the impression there is something wrong with the socket.http library.
I reduced the script to the following:
Code:
require 'ltn12'
require('socket.http')

socket.http.TIMEOUT = 15

This generates an error: attempt to index field 'http' (a nil value). This code is in the original script which has been running for years.

At the same time a third party software has started giving the error:

attempt to call field 'tcp' ( a nil value).

i have already rebooted the system.

What could be wrong here?

Thanks.


RE: Problem with socket.http - admin - 24.04.2023

Maybe the SD card is corrupted and some files are damaged.


RE: Problem with socket.http - baggins - 24.04.2023

(24.04.2023, 09:40)admin Wrote: Maybe the SD card is corrupted and some files are damaged.

What is the correct procedure to restore? I suppose that cloning the SD card (which I have already done in the past to recover from a read only card) will not work.
Firmware is 20160714.
Additional problem is the third part software for which I do not have the software to reinstall...


RE: Problem with socket.http - admin - 24.04.2023

In case you have cloned image you can use it to prepare a new card. Then you can try copying all files from the third partition of the old card to the new. Or restore a backup if you have it.


RE: Problem with socket.http - baggins - 25.04.2023

(24.04.2023, 15:25)admin Wrote: In case you have cloned image you can use it to prepare a new card. Then you can try copying all files from the third partition of the old card to the new. Or restore a backup if you have it.

Back in business.

One question however:
I first flashed a new SD card with the cloned image that I still had from the previous issue with the read-only card in 2021. After boot the system worked OK but of course with 2021 data.
I then restored a backup that I took this morning before replacing the SD card. Upon reboot I had the same error as previously. I then restored a backup from the day before the issue came up. This time the system worked correctly.

What is exactly restored when restoring a backup? If there was anything wrong with the libraries, I would have expected that that would have been fixed with the cloned card and that restoring the backup would have no effect on that?

As always, thanks for your excellent support.


RE: Problem with socket.http - admin - 25.04.2023

System libraries are not added to the backup. Maybe there is something in common functions or a user library that is set to load automatically that causes the issue.