Skip to content

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

Closed

Description

@MarcBanyard

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.

Activity

  1. MarcBanyard commented on Oct 19, 2020

    @MarcBanyard
    ContributorAuthor

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

  2. added
    duplicateDuplicate of another issue
    and removed
    unverifiedSome days we don't have a clue
    on Oct 19, 2020
  3. TheWitness commented on Oct 19, 2020

    @TheWitness
    Member

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

  4. MarcBanyard commented on Oct 19, 2020

    @MarcBanyard
    ContributorAuthor

    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.

  5. TheWitness commented on Oct 19, 2020

    @TheWitness
    Member

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

  6. MarcBanyard commented on Oct 19, 2020

    @MarcBanyard
    ContributorAuthor

    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

  7. added a commit that references this issue on Oct 19, 2020
  8. TheWitness commented on Oct 19, 2020

    @TheWitness
    Member

    grab lib/import.php and try again.

  9. MarcBanyard commented on Oct 19, 2020

    @MarcBanyard
    ContributorAuthor

    Still the same error I'm afraid
    image

  10. added a commit that references this issue on Oct 19, 2020
  11. TheWitness commented on Oct 19, 2020

    @TheWitness
    Member

    Try again.

  12. MarcBanyard commented on Oct 19, 2020

    @MarcBanyard
    ContributorAuthor

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

  13. TheWitness commented on Oct 19, 2020

    @TheWitness
    Member

    It's Lunch time ;)

  14. MarcBanyard commented on Oct 19, 2020

    @MarcBanyard
    ContributorAuthor

    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.

  15. TheWitness commented on Oct 19, 2020

    @TheWitness
    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.

  16. added and removed
    duplicateDuplicate of another issue
    on Oct 19, 2020
  17. added this to the 1.2.15 milestone on Oct 19, 2020
  18. 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[/+] on Nov 2, 2020
  19. locked and limited conversation to collaborators on Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions