influxdb-python icon indicating copy to clipboard operation
influxdb-python copied to clipboard

intermediate '[Errno 1] Operation not permitted'

Open AvnerCohen opened this issue 6 years ago • 7 comments

influxdb/client.py in send_packet at line 772

self.udp_socket.sendto(data, (self._host, self.udp_port))

Seeing this exception poping up every few hundreds of call. Using version 3.0.0 of the lib on a CentOS machine, any ideas or directions?

AvnerCohen avatar Dec 14 '17 10:12 AvnerCohen

Can you upgrade to the latest release and see if the problem persists?

On Dec 14, 2017 5:01 AM, "Avner Cohen" [email protected] wrote:

influxdb/client.py in send_packet at line 772

self.udp_socket.sendto(data, (self._host, self.udp_port))

Seeing this exception poping up every few hundreds of call. Using version 3.0.0 of the lib on a CentOS machine, any ideas or directions?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/influxdata/influxdb-python/issues/546, or mute the thread https://github.com/notifications/unsubscribe-auth/AGYxLWDgpLKMECXOqN1_orqlWnNY8vncks5tAPHegaJpZM4RBz6r .

xginn8 avatar Dec 15 '17 02:12 xginn8

Got the exact same error after upgrading to 5.0.0. This is not constant, and probably 99% of requests go just fine. Happy to provide additional data as needed.

AvnerCohen avatar Dec 18 '17 11:12 AvnerCohen

Is it possible two processes are racing and one is holding the port open causing this error? How are you calling the write?

xginn8 avatar Dec 21 '17 01:12 xginn8

Thanks for trying to help on this, much appreciated.

We are using a very basic setup of:

influx_client = InfluxDBClient(server_name, http_port, username, password, database, use_udp=True, udp_port=udp_port)
self.influx_client.write_points([...])

To send data, via udp.

We are running python 2.7.13 and the write() is invoked from a server with multiple celery workers, I imagine there is a potential for multiple requests on the same time.. Is there an easy way to test this direction?

AvnerCohen avatar Dec 21 '17 06:12 AvnerCohen

This happens to us too. We are using influxdb==5.2.1, Python 3.6, using UDP socket_listener in Telegraf.

Every hour we consistently getting 4~8 such errors, our app is making ~ 300 stats reporting requests each hour.

s-petrunin avatar Feb 15 '19 17:02 s-petrunin

This likely happened b.c. this lib do not catch socket related errors during sending stats, like other libs do, example: https://github.com/jsocol/pystatsd/blob/master/statsd/client/udp.py#L45

May be it's a good think, but it's not obvious for the clients of the library that it may throw an exception, even though it's UDP.

s-petrunin avatar Feb 15 '19 19:02 s-petrunin

Thanks @s-petrunin, would you prefer that we add a try/catch to https://github.com/influxdata/influxdb-python/blob/cdc2c665808f2cf572973029f81b9a0175b43277/influxdb/client.py#L1168

sebito91 avatar Apr 13 '20 01:04 sebito91