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

error 401 when trying to run influxdb commands in shell #20858

Closed
ElliotTanScripting opened this issue Mar 4, 2021 · 5 comments
Closed

error 401 when trying to run influxdb commands in shell #20858

ElliotTanScripting opened this issue Mar 4, 2021 · 5 comments

Comments

@ElliotTanScripting
Copy link

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

  1. start commandline terminal in folder with influxdb executables
  2. run 'influxd' for server
  3. run 'influx' for client

additionally, I also tried changing the port number for http to 8087, but when I ran 'influxd' the port number that came up in the log was still 8086. I ran "influxd.exe -config influxdb.conf 2>logfile.log" but the config did not update.

Expected behavior:
Expected server to run and be able to run commands in influx shell

Actual behavior:
log of influxd shown below

tried to run some commands in influxdb shell but got these responses:
WARN: Connected to http://localhost:8086, but found no server version.
Are you sure an InfluxDB server is listening at the given address?
InfluxDB shell version: 1.8.4

show databases
ERR: received status code 401 from server
exit

Environment info:

  • System info: Run uname -srm and copy the output here
    CYGWIN_NT-10.0 3.1.7(0.340/5/3) x86_64
  • InfluxDB version: Run influxd version and copy the output here
    InfluxDB v1.8.4 (git: 1.8 bc8ec43)
  • Other relevant environment details: Container runtime, disk info, etc

Config:
only edited directory for data, meta, and wal

Logs:
ts=2021-03-04T06:43:29.572810Z lvl=info msg="InfluxDB starting" log_id=0SfU4dG000 version=1.8.4 branch=1.8 commit=bc8ec4384eed25436d31045f974bf39f3310fa3c
ts=2021-03-04T06:43:29.573806Z lvl=info msg="Go runtime" log_id=0Sf
U4dG000 version=go1.13.8 maxprocs=8
ts=2021-03-04T06:43:29.680034Z lvl=info msg="Using data dir" log_id=0SfU4dG000 service=store path="C:\Users\Elliot\Desktop\IIT\2021\Spring\CS 550\term project\InfluxDB\data"
ts=2021-03-04T06:43:29.680034Z lvl=info msg="Compaction settings" log_id=0Sf
U4dG000 service=store max_concurrent_compactions=4 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
ts=2021-03-04T06:43:29.681036Z lvl=info msg="Open store (start)" log_id=0SfU4dG000 service=store trace_id=0SfU54G000 op_name=tsdb_open op_event=start
ts=2021-03-04T06:43:29.681036Z lvl=info msg="Open store (end)" log_id=0SfU4dG000 service=store trace_id=0SfU54G000 op_name=tsdb_open op_event=end op_elapsed=0.000ms
ts=2021-03-04T06:43:29.681036Z lvl=info msg="Opened service" log_id=0SfU4dG000 service=subscriber
ts=2021-03-04T06:43:29.681036Z lvl=info msg="Starting monitor service" log_id=0Sf
U4dG000 service=monitor
ts=2021-03-04T06:43:29.681036Z lvl=info msg="Registered diagnostics client" log_id=0SfU4dG000 service=monitor name=build
ts=2021-03-04T06:43:29.682034Z lvl=info msg="Registered diagnostics client" log_id=0Sf
U4dG000 service=monitor name=runtime
ts=2021-03-04T06:43:29.682034Z lvl=info msg="Registered diagnostics client" log_id=0SfU4dG000 service=monitor name=network
ts=2021-03-04T06:43:29.682034Z lvl=info msg="Registered diagnostics client" log_id=0Sf
U4dG000 service=monitor name=system
ts=2021-03-04T06:43:29.682034Z lvl=info msg="Starting precreation service" log_id=0SfU4dG000 service=shard-precreation check_interval=10m advance_period=30m
ts=2021-03-04T06:43:29.682034Z lvl=info msg="Starting snapshot service" log_id=0Sf
U4dG000 service=snapshot
ts=2021-03-04T06:43:29.682034Z lvl=info msg="Starting continuous query service" log_id=0SfU4dG000 service=continuous_querier
ts=2021-03-04T06:43:29.682034Z lvl=info msg="Starting HTTP service" log_id=0Sf
U4dG000 service=httpd authentication=false
ts=2021-03-04T06:43:29.683112Z lvl=info msg="opened HTTP access log" log_id=0SfU4dG000 service=httpd path=stderr
ts=2021-03-04T06:43:29.682034Z lvl=info msg="Storing statistics" log_id=0Sf
U4dG000 service=monitor db_instance=_internal db_rp=monitor interval=10s
run: open server: open service: listen tcp :8086: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.

Performance:
Generate profiles with the following commands for bugs related to performance, locking, out of memory (OOM), etc.

# Commands should be run when the bug is actively happening.
# Note: This command will run for at least 30 seconds.
curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=true"
curl -o vars.txt "http://localhost:8086/debug/vars"
iostat -xd 1 30 > iostat.txt
# Attach the `profiles.tar.gz`, `vars.txt`, and `iostat.txt` output files.
@danxmoran danxmoran added the 1.x label Mar 4, 2021
@danxmoran
Copy link
Contributor

@ElliotTanIIT is auth enabled in your influxdb.conf? If so, have you set up users and configured your CLI to use them (docs here)?

@ElliotTanScripting
Copy link
Author

i tried

@ElliotTanIIT is auth enabled in your influxdb.conf? If so, have you set up users and configured your CLI to use them (docs here)?

I tried following the instructions for setting up the inital admin but got the same error
image

Are all the lines in the config file supposed to begin with '#'? Or should I remove those?

@LLThomas
Copy link
Contributor

I have the same problem while my influxd was compiled from source code.

@ElliotTanScripting
Copy link
Author

I found that it was a firewall issue. I had to allow influxd firewall access.

@danxmoran
Copy link
Contributor

Sounds like the original issue was resolved, so closing this

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

No branches or pull requests

3 participants