Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckUpdatesAsync: No such host is known. #299

Open
ricaun opened this issue Oct 7, 2024 · 14 comments
Open

CheckUpdatesAsync: No such host is known. #299

ricaun opened this issue Oct 7, 2024 · 14 comments
Labels
by design Some behavior that is intended and not an issue

Comments

@ricaun
Copy link
Contributor

ricaun commented Oct 7, 2024

RevitLookup version

2025.0.10

Steps to reproduce

I have some strange logs when my Revit open, I guess start happen after the HostedLifecycleService update.

2024-10-07 15:53:09 [ERR] RevitLookup.Services.SoftwareUpdateService: Checking updates fail. Possible GitHub request limit exceeded
System.Net.Http.HttpRequestException: No such host is known. (api.github.com:443)
 ---> System.Net.Sockets.SocketException (11001): No such host is known.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at RevitLookup.Services.SoftwareUpdateService.FetchGithubRepositoryAsync()
   at RevitLookup.Services.SoftwareUpdateService.CheckUpdatesAsync()

Does not break anything is just annoying to receive random logs when my Revit open.

There are some way to disable the log in the RevitLookup?

@ricaun ricaun added bug 🐛 An unexpected issue that highlights incorrect behavior unverified ⌛ Needs more investigation to conclude it's an actual bug labels Oct 7, 2024
@Nice3point
Copy link
Collaborator

You have exceeded your request limit on GitHub, the log says so. There is no way to turn off the logs yet, but we will remove this exception from the journal

@Nice3point Nice3point added by design Some behavior that is intended and not an issue and removed bug 🐛 An unexpected issue that highlights incorrect behavior unverified ⌛ Needs more investigation to conclude it's an actual bug labels Oct 7, 2024
@ricaun
Copy link
Contributor Author

ricaun commented Oct 7, 2024

You have exceeded your request limit on GitHub,

I think you are wrong, the exception says 'No such host is known. (api.github.com:443)', maybe for a moment my machine goes offline.

The exceptions is logged in the journal? Nice!

@Nice3point
Copy link
Collaborator

Nice3point commented Oct 7, 2024

Yes, RevitLookup logs important errors to the journal and some messages to the Console. This is useful when users are having issues and require help: https://github.com/jeremytammik/RevitLookup/releases/tag/2025.0.2

No such host is known - dotnet/runtime#54547
Answer: the OS truly not being able to resolve DNS

@ricaun
Copy link
Contributor Author

ricaun commented Oct 7, 2024

Yes, RevitLookup logs important errors to the journal and some messages to the Console. This is useful when users are having issues and require help: https://github.com/jeremytammik/RevitLookup/releases/tag/2025.0.2

Would be possible to change the LogEventLevel to disable messages to go in the Console/Debug?

private static Logger CreateDefaultLogger()
{
return new LoggerConfiguration()
.WriteTo.Console(LogEventLevel.Information, LogTemplate)
.WriteTo.Debug(LogEventLevel.Debug, LogTemplate)
.WriteTo.RevitJournal(Context.UiApplication, restrictedToMinimumLevel: LogEventLevel.Error, outputTemplate: LogTemplate)
.MinimumLevel.Debug()
.CreateLogger();
}

@ricaun
Copy link
Contributor Author

ricaun commented Oct 7, 2024

I noticed the Event Monitor is sending messages in the Debug.

2024-10-07 19:49:56 [DBG] RevitLookup.Core.EventMonitor:  - missing target
2024-10-07 19:49:56 [DBG] RevitLookup.Core.EventMonitor: RevitLookup EventMonitor: Autodesk.Revit.UI.TextBoxCommandHandler.CanExecuteChanged
2024-10-07 19:49:56 [DBG] RevitLookup.Core.EventMonitor:  - missing target
2024-10-07 19:49:56 [DBG] RevitLookup.Core.EventMonitor: RevitLookup EventMonitor: Autodesk.Revit.UI.TextBox.EnterPressed
...

@Nice3point
Copy link
Collaborator

Would be possible to change the LogEventLevel to disable messages to go in the Console/Debug?

What reason do we have to disable logging?

I noticed the Event Monitor is sending messages in the Debug.

If you get such messages, you have probably compiled the project for Debug mode. This is not a recommended way because it is several times worse in performance and contains more logs. Use Release version

@ricaun
Copy link
Contributor Author

ricaun commented Oct 8, 2024

What reason do we have to disable logging?

I don't need that information in the console.

If you get such messages, you have probably compiled the project for Debug mode.

I'm using the last version downloaded from the main release. When I open the Event Monitor.

image

In the release the DEBUG define should be disable, but Serilog have the configuration toMinimumLevel.Debug,

I remember one time I changed to Warning when testing some code to remove the logs.

https://github.com/ricaun/RevitLookup/blob/3ba526e30ba54ae3a0fd23f2317cc44455042652/source/RevitLookup/Config/LoggerConfigurator.cs#L26

The only place that use LogDebug is inside the EventMonitor.

@Nice3point
Copy link
Collaborator

I don't need that information in the console.

Personal preference cannot be a reason to remove any functionality

In the release the DEBUG define should be disable, but Serilog have the configuration toMinimumLevel.Debug,

If you run VS in Debug mode, then yes, you will see them because Debug.WriteLine has Condition attribute only for Debug mode. Logs are written only when you open EventMonitor, and you will not notice them when debugging your own plugins

@ricaun
Copy link
Contributor Author

ricaun commented Oct 8, 2024

Personal preference cannot be a reason to remove any functionality

I'm not asking to remove, I'm a big fan of option to disable/change the log level like a configuration for that.

If you run VS in Debug mode, then yes, you will see them because Debug.WriteLine has Condition attribute only for Debug mode.

You are wrong, that debug log is written regardless of the Debug mode, my application catch that in a normal Revit run.
image

@Nice3point
Copy link
Collaborator

The output to the Console has a minimum level - Information. Apparently your add-in collects logs not only from Console but also from Debug source.

Check screenshot, the Console output does not contain any entries from RevitLookup:
изображение

@ricaun
Copy link
Contributor Author

ricaun commented Oct 8, 2024

Yes is collecting from Console and Debug/Trace.

In your case I suppose should show in the Debug Output, the log is hard-code to MinimumLevel.Debug.

Maybe should be Warning in the release version.

@ricaun
Copy link
Contributor Author

ricaun commented Oct 8, 2024

The LoggingLevelSwitch could be used the change the log level on runtime.

Here some reference: https://nblumhardt.com/2014/10/dynamically-changing-the-serilog-level/

@ricaun
Copy link
Contributor Author

ricaun commented Oct 8, 2024

The LoggingLevelSwitch works 😊
https://github.com/ricaun/RevitLookup/tree/dev-loglevel

image

@ricaun
Copy link
Contributor Author

ricaun commented Oct 8, 2024

I create a PR, to add that setting: #300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
by design Some behavior that is intended and not an issue
Projects
None yet
Development

No branches or pull requests

2 participants