Run: open server: listen: listen tcp 127.0.0.1:8088: bind: address already in use

     $ influx
    Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp [::1]:8086: connect: connection refused
    Please check your connection settings and ensure 'influxd' is running.

Used System Version
Raspberry Pi 3 B+
model name : ARMv7 Processor rev 4 (v7l)
OS Version
PRETTY_NAME=“Raspbian GNU/Linux 9 (stretch)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“9”
VERSION=“9 (stretch)”
VERSION_CODENAME=stretch
ID=raspbian

Which process name does “netstat -lptn” (as root) show you is listening on
port 8088?

Does it show you that anything at all is listening on port 8086?

Antony.

No Listen port (8086)

#netstat -lptn
shows only
tcp 0 0 127.0.0.1:8088 0.0.0.0:* LISTEN 3755/influxd

So, that is pretty clear-cut. You already have a running influxd process
listening on port 8088, which is why you cannot start another one.

Try “kill 3755” followed by starting influxd again.

Antony.

Thanks I tried to Kill PID

now showing another error like this…

run: open server: open tsdb store: mkdir /var/lib/influxdb/data/_internal/_se

After kill process, it show same error
Also I tried,

$ sudo systemctl start influxdb

$ sudo chown -R influxdb:influxdb /var/lib/influxdb/*

$influxd

2021-04-15T17:49:13.524393Z info InfluxDB starting {“log_id”: “0TXfGRi0000”, “version”: “1.8.4”, “branch”: “1.8”, “commit”: “bc8ec4384eed25436d31045f974bf39f3310fa3c”}
2021-04-15T17:49:13.524484Z info Go runtime {“log_id”: “0TXfGRi0000”, “version”: “go1.13.8”, “maxprocs”: 4}
run: open server: listen: listen tcp 127.0.0.1:8088: bind: address already in

This is repeated same error…I want my data back completely.

I do not see an error message there.

Please paste the entire message, and also the output of “influx” (note, no d at
the end) after trying to start the service.

Antony.

Please see this.

$ influx
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp [::1]:8086: connect: connection refused
Please check your connection settings and ensure ‘influxd’ is running.

I don’t understand what you are trying to do.

You say you run the following command:

$ sudo systemctl start influxdb

Good, that should start the influxd service.

I’m not sure quite why you then do:

$ sudo chown -R influxdb:influxdb /var/lib/influxdb/*

However you then run the command (and not as root):

$ influxd

which of course complains that influxd is already running (you started it in
the first command).

What is surprising about the fact that the second time you try to run influxd
it tells you that the first instance is already bound to port 8088?

Why are you trying to run it a second time at all?

Antony.

So, you are starting influxd listening on port 8088 and then trying to connect
with the influx client to port 8086?

Antony.

Now I start from beginning
1.
$sudo netstat -lptn
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:8088 0.0.0.0:* LISTEN 4679/influxd
2.
$sudo kill 4679
3.

$influxd

2021-04-15T18:13:09.799677Z info InfluxDB starting {“log_id”: “0TXgd69l000”, “version”: “1.8.4”, “branch”: “1.8”, “commit”: “bc8ec4384eed25436d31045f974bf39f3310fa3c”}
2021-04-15T18:13:09.799787Z info Go runtime {“log_id”: “0TXgd69l000”, “version”: “go1.13.8”, “maxprocs”: 4}
2021-04-15T18:13:09.946770Z info Using data dir {“log_id”: “0TXgd69l000”, “service”: “store”, “path”: “/var/lib/influxdb/data”}
2021-04-15T18:13:09.947069Z info Compaction settings {“log_id”: “0TXgd69l000”, “service”: “store”, “max_concurrent_compactions”: 2, “throughput_bytes_per_second”: 50331648, “throughput_bytes_per_second_burst”: 50331648}
2021-04-15T18:13:09.947172Z info Open store (start) {“log_id”: “0TXgd69l000”, “service”: “store”, “trace_id”: “0TXgd6jl000”, “op_name”: “tsdb_open”, “op_event”: “start”}
2021-04-15T18:13:09.951670Z info Open store (end) {“log_id”: “0TXgd69l000”, “service”: “store”, “trace_id”: “0TXgd6jl000”, “op_name”: “tsdb_open”, “op_event”: “end”, “op_elapsed”: “4.502ms”}
run: open server: open tsdb store: mkdir /var/lib/influxdb/data/_internal/_series: permission denied
4.

$ influx

Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp [::1]:8086: connect: connection refused
Please check your connection settings and ensure ‘influxd’ is running.

*** No problem solved.

Now I start from beginning
1.
$sudo netstat -lptn
Proto Recv-Q Send-Q Local Address Foreign Address
State PID/Program name tcp 0 0 127.0.0.1:8088
0.0.0.0:* LISTEN 4679/influxd 2.

That shows that influxd is running, and listening on port 8088.

$sudo kill 4679

It is no longer running.

  1. $influxd

You start influxd but not as root, therefore it will not have the required
permissions to run.

run: open server: open tsdb store: mkdir
/var/lib/influxdb/data/_internal/_series: permission denied 4.

It does not have the required permissions to run. You cannot start influxd as
non-root.

$ influx

Failed to connect to http://localhost:8086: Get http://localhost:8086/ping:
dial tcp [::1]:8086: connect: connection refused Please check your
connection settings and ensure ‘influxd’ is running.

You now have two problems:

  1. You are trying to start influxd as non-root. This will not work.

  2. When you do start influxd as root, it listens only on port 8088, and you
    then try to connect to it on port 8086, This will not work.

To fix this:

  1. Make sure you either have bind-address = “:8086” in the [http] section of
    /etc/influxdb/influxdb.conf or that this is commented out and there is no other
    bind-address statement in that section of the file.

  2. Start influxd as root, do not kill it, and do not try re-starting it as non-
    root.

  3. Connect using the command “influx” as non-root; it should connect to port

If that does not work, check the output of “netstat -lptn” again and check
whether influx is listening on both port 8086 and 8088.

Regards,

Antony.

Hi,

Thank lot.

  1. Now I tried $sudo influxd in root (It loading more file 1-2 minutes)

  2. After I start influx ... (not connected to port) influx
    Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp [::1]:8086: connect: connection refused
    Please check your connection settings and ensure ‘influxd’ is running.

  3. $sudo netstat -lptn (no listen port on influxdb)

**Config file is default
[http]
#bind-address = “.8086” (default, commented)

What can i do next…

Let’s go back and run a command we did some while ago, to see whether the
result is still the same.

As root:

grep -r “808[678]” /etc

Also as root:

netstat -lptn | grep influx

Antony.

I tried , No results, both output blank

grep -r “808[678]” /etc
netstat -lptn | grep influx

Also Checked

$sudo netstat -lptn

No listen port on influx

grep -r “808[678]” /etc

netstat -lptn | grep influx

I tried , No results, both output blank

That is inconsistent with the following:

**Config file is default
[http]
#bind-address = “.8086” (default, commented)

You say you have a default influxdb.conf file (which should have :8086 in it,
and not .8086, but I’ll assume that’s a typo instead of copy&paste from the
file itself), and that that file contains the string “8086”, and yet you say
that the command:

grep -r “808[678]” /etc

produces nothing.

That either means:

a) you have typed at least one of the commands incorrectly

b) your influxdb.conf file is not under /etc (I expect it to be in /etc/influxdb)

c) the file has changed since you told me it contained:

#bind-address = “.8086” (default, commented)

Finally, if “netstat -lptn | grep influx” produced no output, then either:

a) you did not run it as root as requested, or

b) influxdb was not running at the time (please start it and re-run the netstat
command)

Antony.

I follow your points step by step.
System Restarted

  1. $ sudo netstat -lptn ( influxdb listen port 8088)
  2. $ sudo kill PID (Process stopped)
  3. $ sudo influxd (loading more files, then finally end like this;)

goroutine 13655 [running]:
runtime.throw(0xfd75ae, 0xd)
/usr/local/go/src/runtime/panic.go:774 +0x5c fp=0x16b7868c sp=0x16b78678 pc=0x41644
runtime.(*mcache).refill(0x76ef1008, 0x1f)
/usr/local/go/src/runtime/mcache.go:140 +0xfc fp=0x16b786a0 sp=0x16b7868c pc=0x262ec
runtime.(*mcache).nextFree(0x76ef1008, 0x1f, 0x0, 0x40d5c, 0x37af974)
/usr/local/go/src/runtime/malloc.go:854 +0x7c fp=0x16b786c0 sp=0x16b786a0 pc=0x1b0f4
runtime.mallocgc(0xe0, 0x0, 0x0, 0x40)
/usr/local/go/src/runtime/malloc.go:1022 +0x7a0 fp=0x16b78728 sp=0x16b786c0 pc=0x1ba40
runtime.rawbyteslice(0xd8, 0x0, 0x0, 0x0)
/usr/local/go/src/runtime/string.go:272 +0x84 fp=0x16b78744 sp=0x16b78728 pc=0x5f908
runtime.stringtoslicebyte(0x0, 0x4d902a0, 0xd8, 0x4b505d0, 0x0, 0x0)
/usr/local/go/src/runtime/string.go:161 +0xa4 fp=0x16b78764 sp=0x16b78744 pc=0x5f354
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*ring).apply.func1(0x1dde0dd4, 0x1cbf668, 0x1892b140, 0x7a05000)
/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/ring.go:160 +0xc0 fp=0x16b787dc sp=0x16b78764 pc=0xd1187c
runtime.goexit()
/usr/local/go/src/runtime/asm_arm.s:868 +0x4 fp=0x16b787dc sp=0x16b787dc pc=0x73610
created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*ring).apply
/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/ring.go:155 +0xb >

4.$influx ( this output showing not connection refused)

Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp [::1]:8086: connect: connection refused
Please check your connection settings and ensure ‘influxd’ is running.

  1. $sudo netstat -lptn
    Influxdb not listen any port

    *** I tried to run again
    sudo influxd influx (failed to connect , the same problem)

Please go through my influxd config file, is copied below

# Bind address to use for the RPC service for backup and restore.
# bind-address ="127.0.0.0:8088"

[meta]
  # Where the metadata/raft database is stored
  dir = "/var/lib/influxdb/meta"

  # Automatically create a default retention policy when creating a database.
  # retention-autocreate = true

  # If log messages are printed for the meta service
  # logging-enabled = true


[data]
  # The directory where the TSM storage engine stores TSM files.
  dir = "/var/lib/influxdb/data"

  # The directory where the TSM storage engine stores WAL files.
  wal-dir = "/var/lib/influxdb/wal"

[http]
# auth-enabled = true
# pprof-enabled = false
# pprof-auth-enabled = true
# ping-auth-enabled = true

  # Determines whether HTTP endpoint is enabled.
  # enabled = true

  # Determines whether the Flux query endpoint is enabled.
  # flux-enabled = true

  # Determines whether the Flux query logging is enabled.
  # flux-log-enabled = false

  # The bind address used by the HTTP service.
  # bind-address = ":8086"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
  # auth-enabled = false

  # The default realm sent back when issuing a basic auth challenge.
  # realm = "InfluxDB"

  # Determines whether HTTP request logging is enabled.
  # log-enabled = true
  1. $ sudo influxd (loading more files, then finally end like this;)

This seems like a strange way of starting influxd to me. You are running this
on Raspbian Stretch.

Previously you have been using the command “$ sudo systemctl start influxdb”
which looks far more standard to me.

If you start the service like that, does it still produce all these errors?

goroutine 13655 [running]:
runtime.throw(0xfd75ae, 0xd)
/usr/local/go/src/runtime/panic.go:774 +0x5c fp=0x16b7868c sp=0x16b78678
pc=0x41644 runtime.(*mcache).refill(0x76ef1008, 0x1f)
/usr/local/go/src/runtime/mcache.go:140 +0xfc fp=0x16b786a0 sp=0x16b7868c
pc=0x262ec runtime.(*mcache).nextFree(0x76ef1008, 0x1f, 0x0, 0x40d5c,
0x37af974) /usr/local/go/src/runtime/malloc.go:854 +0x7c fp=0x16b786c0
sp=0x16b786a0 pc=0x1b0f4 runtime.mallocgc(0xe0, 0x0, 0x0, 0x40)
/usr/local/go/src/runtime/malloc.go:1022 +0x7a0 fp=0x16b78728
sp=0x16b786c0 pc=0x1ba40 runtime.rawbyteslice(0xd8, 0x0, 0x0, 0x0)
/usr/local/go/src/runtime/string.go:272 +0x84 fp=0x16b78744 sp=0x16b78728
pc=0x5f908 runtime.stringtoslicebyte(0x0, 0x4d902a0, 0xd8, 0x4b505d0, 0x0,
0x0) /usr/local/go/src/runtime/string.go:161 +0xa4 fp=0x16b78764
sp=0x16b78744 pc=0x5f354
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*ring).apply.func1(0x1dde
0dd4, 0x1cbf668, 0x1892b140, 0x7a05000)
/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/ring.go:160 +0xc0
fp=0x16b787dc sp=0x16b78764 pc=0xd1187c runtime.goexit()
/usr/local/go/src/runtime/asm_arm.s:868 +0x4 fp=0x16b787dc sp=0x16b787dc
pc=0x73610 created by
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*ring).apply
/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/ring.go:155 +0xb >

You need to find out why influxd is complaining that much when you start it
before it makes any sense to go further.

That output is beyond my expertise to diagnose, so:

a) please start influxd with the normal command:

$ sudo systemctl start influxdb

b) if that doesn’t work and you still get the same errors, I hope someone with
more understanding of what those errors mean can help you.

Regards,

Antony.

Thanks for your support and sparing time with me. I will try find a better solution.

I think the RPC service (backup restore) may be running, and blocked the normal operation. In previous days it working perfectly, when power & internet connection failed after it will not working.

We should find the solution.

“In previous days it working perfectly, when power & internet connection
failed after it will not working.”

I think it would have been very helpful for everyone involved if you had said
that from the start.

Antony.

2 Likes