Intermittent connection issues with influx

Since using InfluxDB shell version: 1.7.8 I am seeing intermittent connection refused. How do I resolve the errors.
ERR: Post http://localhost:8086/query dial tcp 10.255.174.179:8086: connect: connection refused

Hello @bizomb,
Welcome!
Can you please share your request?
Thank you.

When running influx i get connection refused intermittently. It has been restarted and reinstalled but still occurs.