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

Unable to add hosts using bulkupload #88

Open
haijubin opened this issue May 17, 2020 · 1 comment
Open

Unable to add hosts using bulkupload #88

haijubin opened this issue May 17, 2020 · 1 comment

Comments

@haijubin
Copy link

Hi There,

I am getting below error while adding hosts using bulkupload tool. Tried on IE, Chrome and Firefox.
.csv file is successfully getting uploaded to uploads folder, but while applying below fakepath error is throwing.

Could not find file, "C: akepath est.csv".

image

Thanks,
Jubin

@kwadroke
Copy link

kwadroke commented Dec 22, 2022

I know that this is an old issue, but I just ran into it today.
This is my quick fix to get around this error incase anyone else comes across it.

Apparently PHP is prepending the C:\fakepath\ to the filename and causing an issue with the csv2json.sh shell script.

I had to remove the C:\fakepath\ text and then it would run the shell script correctly.

plugins-lib/smorg_hosts_bulktools_btn_impl.php line 831

$csvfile = str_replace( "C:\\fakepath\\", '', $query_str["filename"] );
$cmd = "scripts/csv2json.sh \"upload/".$csvfile."\"";

a few lines down I fixed the error message not showing up.

$retval["message"] = "Error converting CSV. Exit Status: ".$exit_status." | Command: ".$cmd." | Output: ".$output;

Hopefully this will help someone else having the same issue.

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

No branches or pull requests

2 participants