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

Facing error with postpointsAsync #114

Open
hymanallan opened this issue Oct 17, 2023 · 2 comments
Open

Facing error with postpointsAsync #114

hymanallan opened this issue Oct 17, 2023 · 2 comments

Comments

@hymanallan
Copy link

Seeing below error with reporting datapoints to influxdb -
The infuxdbservice is up and running on port 8086 on my server

System.AggregateException: One or more errors occurred. ---> AdysTech.InfluxDB.Client.Net.ServiceUnavailableException: InfluxDB service is not available ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it [::1]:8086
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at AdysTech.InfluxDB.Client.Net.InfluxDBClient.d__16.MoveNext()
--- End of inner exception stack trace ---

@hymanallan
Copy link
Author

here's the lines of code
public static async Task ReportDatapointsAsync(List dataPoints)
{
using (var client = new InfluxDBClient(ConnectionString))
{
if (!await client.PostPointsAsync(DatabaseName, dataPoints))
{
Logger.Instance.Log(LogLevel.Warning, "Error uploading data");
}
}
}

@mvadu
Copy link
Contributor

mvadu commented Oct 19, 2023

@hymanallan the error target machine actively refused it [::1]:8086 usually means the server process (in this case InfluxDB) is not listening on all interfaces. How is the InfluxDB process started, and how is ConnectionString is defined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants