CLI History Error on ARM #6070

Open
rossmcdonald opened this Issue Mar 21, 2016 · 25 comments

Comments

Projects
None yet
Contributor

rossmcdonald commented Mar 21, 2016

When running the InfluxDB CLI on ARM Linux (specifically Raspbian), the command history returns the error:

There was an error writing history file: open : no such file or directory

Even though the user is set appropriately. Based on this comment, it seems like the file history path isn't being set correctly.

drdran commented Apr 3, 2016

Hi I have the same problem.

Contributor

jonseymour commented Apr 4, 2016

FWIW: i can reproduce the same symptom on linux/amd64 if I compile the influx binary with CGO_ENABLED=0 set in the environment. In this case, the reason is that user.Current() then fails with the error: 'Current not implemented on linux/amd64.'

This causes the branch in this block to be skipped, which then results in the reported symptom after a command is run (since the history path is never initialised properly).

So, I suspect the reason this is occurring on ARM systems is either that the ARM build of the influx binary was done with CGO_ENABLED=0 for some reason or go has not implemented user.Current() for ARM systems for some different reason.

Contributor

jonseymour commented Apr 4, 2016

Based on a quick review of the go source, it seems more likely that the ARM influx binary was compiled with CGO_ENABLED=0 or, alternatively, that the user.Current() call is failing for some other reason on ARM systems.

xmoulin commented Apr 10, 2016

same problem:
uname -a
Linux Nas-XMN 3.2.40 #7321 SMP Wed Mar 23 11:47:17 CST 2016 armv7l GNU/Linux synology_armada375_ds215j

influx -version
InfluxDB shell 0.12.1

Same issue on a beaglebone (arm based).

root@beaglebone:# uname -a
Linux beaglebone 4.1.15-ti-rt-r43 #1 SMP PREEMPT RT Thu Jan 21 20:13:58 UTC 2016 armv7l GNU/Linux
root@beaglebone:
# influx --version
InfluxDB shell 0.12.0
root@beaglebone:~# influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.12.0
InfluxDB shell 0.12.0

create database snmp
There was an error writing history file: open : no such file or directory

Same here :(.

~# influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.12.1
InfluxDB shell 0.12.1
> create database foo;
There was an error writing history file: open : no such file or directory

nobrick commented Apr 19, 2016

Same issue on ubuntu 14.04.

 ~ uname -a
Linux ubuntu 3.19.0-31-generic #36~14.04.1-Ubuntu SMP Thu Oct 8 17:59:01 UTC 2015 i686 i686 i686 GNU/Linux
 ~ influx --version
InfluxDB shell 0.12.1
 ~ influx
> create database foo;
There was an error writing history file: open : no such file or directory

same here on a fresh rPi3

0.12.2, Banana Pi, same problem:

$ uname -a
Linux bananapi 3.4.108-bananian #2 SMP PREEMPT Thu Aug 13 06:08:25 UTC 2015 armv7l GNU/Linux
$ influx --version
InfluxDB shell 0.12.2

gena01 commented May 1, 2016

I am seeing this on x86_64 running the 0.12.2 static linux binaries (inside an alpine docker container)

On the latest Windows builds I get this after every command in the the influx.exe terminal: "There was an error writing history file: open : The system cannot find the file specified."

Same error on CubieTruck:

mirage@cubietruck:~$ uname -a
Linux cubietruck 3.16.0-00124-g6b6dcc2-dirty #2 SMP Wed Feb 3 14:27:34 GMT 2016 armv7l armv7l armv7l GNU/Linux
mirage@cubietruck:~$ influx --version
InfluxDB shell 0.12.2
> create database test
There was an error writing history file: open : no such file or directory

I still see this issue in the latest (Windows) nightly on 8 July 2016. It seems to slow the influx.exe client a little too -- maybe it has some timeout where it tries to right to the file.

Contributor

runner-mei commented Aug 1, 2016

Same error on Windows

@runner-mei runner-mei added a commit to runner-mei/influxdb that referenced this issue Aug 1, 2016

@runner-mei runner-mei fix #6070
fix #6070 on windows
c501f9d

runner-mei referenced this issue Aug 1, 2016

Closed

fix #6070 #7102

2 of 4 tasks complete

This is a high-priority issue for me. I'm glad to see progress. Thanks.

phemmer commented Aug 2, 2016

The original issue this was opened for is actually fixed. The code no longer uses user.Current().
However it instead uses $HOME which now errors on windows, and on *nix when $HOME is unset.

On Windows 10, doing SET HOME=<path to exe location> seems to fix this for me.

sinedsem commented Nov 4, 2016

Adding environment variable HOME with value <path to exe location> solved problem for me either, OS Windows 7. But that's doesn't looks like a fix, just a workaround. Look forward to an appropriate fix.

Adding environment variable HOME with value solved for me in Win7

How did anyone come up with the idea to use SET HOME= ? I didn't find "HOME" in the config file or in the Influx docs...
For less experienced Windows users: Use the configuration screen tot set this environment variable. Using SET wil only change the environment variable once for that instance of the command prompt...

Owner

e-dard commented Nov 30, 2016

@rossmcdonald is this still a problem?

Contributor

rossmcdonald commented Nov 30, 2016

@e-dard It looks like the error still occurs if the HOME environment variable is not set correctly. It looks like the client code should handle this correctly, though, so this may be Windows-specific.

was there ever a resolution to this?

I am facing the same issue with freshly installed influxdb on Windows 10 system. Is adding an environment variable HOME to the path a recommended solution for this problem?

This issue persists on Windows.

This batch file wraps influx.exe in the fix given by @JackUkleja. Save to influx.bat in the same directory as your influx executable and run the batch file instead:

@ECHO OFF
SETLOCAL
SET HOME=%~dp0
"%~dp0\influx.exe" %*
ENDLOCAL

Temporary shim but it works. Some details:

  • Sets environment variable HOME to the directory containing the batch file.
  • Localizes the environment variable setting so it won't interfere with other things.
  • Passes all command line arguments on to influx.

The culpable feature seems to be command history logging. Once HOME is set up right influx will create .influx_history in the HOME directory. It contains a history of commands you've entered at the influx shell.

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