Closed christophgasser closed 1 year ago
Hi Christoph,
I published a new version that logs the response message. Can you please upgrade to v3.1.1 on Edge and set the Logging Level to Verbose. Then when the addon crashes, you should see the message in the logs, copy and paste it here.
Best regards, David
How to install 3.1.1? For "Lupusec2Mqtt Edge" I can only see 3.1.0 which I have installed now.
For that version with "Vervose" I get this:
[21:20:37 FTL] Host terminated unexpectedly System.NullReferenceException: Object reference not set to an instance of an object. at Lupusec2Mqtt.Mqtt.Homeassistant.Devices.CoverFactory.GenerateDevicesAsync() in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Mqtt/Homeassistant/Devices/CoverFactory.cs:line 18 at Lupusec2Mqtt.MainLoop.GetDevices() in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/MainLoop.cs:line 130 at Lupusec2Mqtt.MainLoop.StartAsync(CancellationToken stoppingToken) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/MainLoop.cs:line 44 at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) at Lupusec2Mqtt.Program.Main(String[] args) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Program.cs:line 34
BR C
If I read the log correct there is an issue with the CoverFactory.cs . I do not have any covers connected with my XT2. because of that maybe one of this properties is empty: _lupusecService.SensorList2.Sensors
BR C
Yes it is in the CoverFactory that the problem happens. CoverFactory is only the component that is responsible to create Cover objects if there are, in you case it is unfortunately in the part where it gathers the information about the devices that are registered on the Lupusec that crashes, this part is also called when no Covers are present (mainly to now that there are no covers present and it has nothing to generate).
I will have a look in the provided log file. What version of the Lupusec you have? XT1 / XT2 (Plus)..?
it is a XT2 Plus.
C
I have checked your log file, but it does not contain a log of the response body of /action/deviceGet (the one that crashes).
I think that the log in the HA Addon UI is too short and you have to get it directly from the console. Can you connect to the console of your HA installation and do:
docker ps
Then search for the line that represents the lupusec2mqtt addon container. Copy the container id and do a:
docker logs [containerId]
Then provide me the results of the complete log please.
BR, David
Im am running HA on a virtual machine. OS 9.5 / COre 2023.3.1 I have no docker available. Running "docker ps" brings just "command not found".
Any other way to get the logs you need?
BR Christoph
Just for completeness: I am connected to HA via SSH using Putty usign user "root". BR C
Ok I think you are SSHing into the running HA container but you have to SSH into your virtual machine (That's where your HA container is running on docker and also the addon containers are running there)
OK. Done that. "docker info" is working fine. but "docker ps" is not allowed. available commands available for docker are: info and registries.
Probably you have to sudo the command
sudo docker ps
No. Already tried that. "Error while executing rootCmd: unknown command "sudo" for "ha"
Ok I think you are now in the HA CLI. There you have to execute:
login
Then you are in the "real" linux shell. Then you can try docker ps.
Thank you. Got the log in a file. Just have to find a way to get it from that machine. I have no WPUT available as it seems. Any idea how to get the file of that machine?
Is scp available? (ssh copy)
Yes, it is. I then need an SCP server, right?
I am now connected to the server using SCP. But my tmp folder in SCP is empty. But this is the folder I have put my log file into.
I guess these are the files of the docker container I can see. do you know how I can get the log file into the container?
You can use docker cp commanf to do this.
which container is the correct one? hassio_supervisor?
I think it is the one named homeassistant. (image name starts with qemux86...)
Or it could be ssh or cli, I am not sure.
It was the SSH container. lupus.log
Thank you for your kind support!
No problem, you're welcome. I will analyse the log and come back to you.
I published just now a new version 3.1.2 that you can check out to see if it resolves the problem.
Working fine now. That fixed it. Thank you!!!
I did the update to 3.1 and now the add-on is crashing with that error message:
Homeassistant config file path is /data/options.json [17:41:52 INF] Lupusec2Mqtt is starting up... [17:41:55 ERR] Error calling POST https://x.x.x.x/action/deviceGet: Request: Method: POST, RequestUri: 'https://10.16.11.11/action/deviceGet', Version: 1.1, Content:, Headers:
{
Accept: application/json
Authorization: Basic
X-Token:
}
System.Text.DecoderFallbackException: Unable to translate bytes [81] at index 835 from specified code page to Unicode.
at System.Text.DecoderExceptionFallbackBuffer.Throw(Byte[] bytesUnknown, Int32 index)
at System.Text.DecoderExceptionFallbackBuffer.Fallback(Byte[] bytesUnknown, Int32 index)
at System.Text.Encoding.GetCharsWithFallback(ReadOnlySpan
1 bytes, Int32 originalBytesLength, Span
1 chars, Int32 originalCharsLength, DecoderNLS decoder) at System.Text.UTF8Encoding.GetCharsWithFallback(ReadOnlySpan1 bytes, Int32 originalBytesLength, Span
1 chars, Int32 originalCharsLength, DecoderNLS decoder) at System.Text.Encoding.GetCharsWithFallback(Byte pOriginalBytes, Int32 originalByteCount, Char pOriginalChars, Int32 originalCharCount, Int32 bytesConsumedSoFar, Int32 charsWrittenSoFar, DecoderNLS decoder) at System.Text.Encoding.GetChars(Byte pBytes, Int32 byteCount, Char pChars, Int32 charCount, DecoderNLS decoder) at System.Text.DecoderNLS.GetChars(Byte bytes, Int32 byteCount, Char chars, Int32 charCount, Boolean flush) at System.Text.DecoderNLS.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex, Boolean flush) at System.IO.StreamReader.ReadBuffer(Span1 userBuffer, Boolean& readToUserBuffer) at System.IO.StreamReader.ReadSpan(Span
1 buffer) at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count) at Newtonsoft.Json.JsonTextReader.ParsePostValue(Boolean ignoreComments) at Newtonsoft.Json.JsonTextReader.Read() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, Encoding effectiveEncoding, IFormatterLogger formatterLogger) at System.Net.Http.Formatting.JsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, Encoding effectiveEncoding, IFormatterLogger formatterLogger) at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger) at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStreamAsync(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger) --- End of stack trace from previous location --- at System.Net.Http.HttpContentExtensions.ReadAsAsyncCore[T](HttpContent content, Type type, IFormatterLogger formatterLogger, MediaTypeFormatter formatter, CancellationToken cancellationToken) at Lupusec2Mqtt.Lupusec.LupusecService.SendRequest[T](HttpRequestMessage request, LogLevel logLevel) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Lupusec/LupusecService.cs:line 148 [17:41:55 FTL] Host terminated unexpectedly System.NullReferenceException: Object reference not set to an instance of an object. at Lupusec2Mqtt.Mqtt.Homeassistant.Devices.CoverFactory.GenerateDevicesAsync() in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Mqtt/Homeassistant/Devices/CoverFactory.cs:line 18 at Lupusec2Mqtt.MainLoop.GetDevices() in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/MainLoop.cs:line 130 at Lupusec2Mqtt.MainLoop.StartAsync(CancellationToken stoppingToken) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/MainLoop.cs:line 44 at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) at Lupusec2Mqtt.Program.Main(String[] args) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Program.cs:line 34I also uninstalled the add-on and installed it again. Problem persits. Any idea how to solve that?
BR C