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

When importing a data query, an invalid column name error can sometimes be shown #3871

Closed
MarcBanyard opened this issue Oct 19, 2020 · 12 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@MarcBanyard
Copy link
Contributor

Describe the bug

Import DataQuery show PHP Error: ERROR PHP NOTICE: Undefined index: fname in file: /var/www/cacti/lib/import.php on line: 1798
CMDPHP PHP ERROR NOTICE Backtrace: (/templates_import.php[43]:form_save(), /templates_import.php[97]:import_xml_data(), /lib/import.php[194]:xml_to_data_input_method(), /lib/import.php[1743]:compare_data(), /lib/import.php[1798]:CactiErrorHandler())

To Reproduce

Steps to reproduce the behavior:

  1. Go to Console->Import/Export-->Import Templates

  2. Click "Select a File" and choose the file you want to import that contains a Data Query

  3. Disable "Preview Import Only"

  4. Click "Import"

  5. See onscreen popup error

  6. Check "Logs" tab, this should contain something like the following

DBCALL ERROR: SQL Save on table 'data_input_fields': Column 'fname' does not exist, unable to save!
CMDPHP PHP ERROR NOTICE Backtrace: (/templates_import.php[43]:form_save(), /templates_import.php[97]:import_xml_data(), /lib/import.php[194]:xml_to_data_input_method(), /lib/import.php[1743]:compare_data(), /lib/import.php[1798]:CactiErrorHandler())
ERROR PHP NOTICE: Undefined index: fname in file: /var/www/cacti/lib/import.php on line: 1798
  1. See Error

Additional context

This looks like it is related to issue #3778.

@MarcBanyard MarcBanyard added bug Undesired behaviour unverified Some days we don't have a clue labels Oct 19, 2020
@MarcBanyard
Copy link
Contributor Author

MarcBanyard commented Oct 19, 2020

This only happens on a Device Template import that contains a Data Query.

@TheWitness TheWitness added duplicate Duplicate of another issue and removed unverified Some days we don't have a clue labels Oct 19, 2020
@TheWitness
Copy link
Member

This is already fixed in the 1.2.x branch and will be a part of the 1.2.15 release.

@MarcBanyard
Copy link
Contributor Author

I've just tested on the 1.2.x branch and its not working.
It only happens if you have a device template that contains a Data Query.

@TheWitness
Copy link
Member

Oh, I see now. Take just a few minutes to fix.

@TheWitness TheWitness reopened this Oct 19, 2020
@MarcBanyard
Copy link
Contributor Author

We are running v1.2.15 and the error comes up as
image
This ONLY happens when importing a Device Template that contains a Data Query.

I have even tried to remove the Data Query from the bottom of the XML and the error still happens, so it is only referenced in the top part of the XML.
image

TheWitness added a commit that referenced this issue Oct 19, 2020
Import DataQuery show PHP Error: ERROR PHP NOTICE: Undefined index: fname
@TheWitness
Copy link
Member

grab lib/import.php and try again.

@MarcBanyard
Copy link
Contributor Author

Still the same error I'm afraid
image

TheWitness added a commit that referenced this issue Oct 19, 2020
This should fix the remainder of the issues.
@TheWitness
Copy link
Member

Try again.

@MarcBanyard
Copy link
Contributor Author

Perfect, that has fixed the error, wow that was a quick fix.

@TheWitness
Copy link
Member

It's Lunch time ;)

@MarcBanyard
Copy link
Contributor Author

How far off is 1.2.15 from being released as the latest version?
This is the only issue we have come across so far with it so far.

@TheWitness
Copy link
Member

Well, the more testing done by people like you, the closer it is. We are now a month behind, and I keep saying no more, a day before more show up.

@TheWitness TheWitness added resolved A fixed issue and removed duplicate Duplicate of another issue labels Oct 19, 2020
@TheWitness TheWitness added this to the 1.2.15 milestone Oct 19, 2020
@netniV netniV changed the title Import DataQuery show PHP Error: ERROR PHP NOTICE: Undefined index: fname When importing a data query, an invalid column name error can sometimes be shown Nov 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants