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.
Hi I have the same problem.
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.
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.
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 :(.
Linux pi 4.1.13+ #826 PREEMPT Fri Nov 13 20:13:22 GMT 2015 armv6l GNU/Linux~# 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
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
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.
Same error on Windows
This is a high-priority issue for me. I'm glad to see progress. Thanks.
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.
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
How did anyone come up with the idea to use SET HOME=
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...
@rossmcdonald is this still a problem?
@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:
HOME to the directory containing the batch file.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.
Very good LycanStack!!
The windows build should use HOMEPATH (trust MS to use something slightly different from the 45 year old UNIX convention). In the meantime, I am "shimming" my environment with set HOME=%HOMEPATH% - much simpler than playing with %~ business.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
Most helpful comment
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."