Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. error on export db

error on export db

Scheduled Pinned Locked Moved Support
10 Posts 2 Posters 9.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L
    L
    luccosen
    wrote on last edited by
    #1

    Hi to all.,

     I receive this error when exporting the db, do you know a way to resolve it? .

    ERROR: SQLite query failed: UNIQUE constraint failed: config.var_name
      Query: INSERT INTO config (var_name,var_value,default_value,is_visible,need_server_restart,data_type,is_public,description,units) VALUES ('DBConnectionPool.MaxLifetime','14400','14400','1','1','I','N','Maximum lifetime (in seconds) for a database connection.','seconds')
    Database export failed.

    Thank you

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      If you open Configuration->Server Configuration in management client and search for 
      DBConnectionPool.MaxLifetime

       how many entries with such name are there? If two, delete one of them. 

      What DB are you using, what is NetXMS version?

      1 Reply Last reply
      0
      • L
        L
        luccosen
        wrote on last edited by
        #3

        I'm using postgres, and netxms 4.4.5.

        thanks.

        1 Reply Last reply
        0
        • F
          F
          Filipp Sudanov
          wrote on last edited by
          #4

          So how many entries are there in Configuration->Server Configuration ?

          1 Reply Last reply
          0
          • L
            L
            luccosen
            wrote on last edited by
            #5

            only one  :(.

            1 Reply Last reply
            0
            • F
              F
              Filipp Sudanov
              wrote on last edited by
              #6

              Ok, and if you connect to your DB using postgres tools and run
              select * from config where var_name = 'DBConnectionPool.MaxLifetime';

              how many lines this query will produce?

              1 Reply Last reply
              0
              • L
                L
                luccosen
                wrote on last edited by
                #7

                ok, I see 3 lines... Have I to delete 2?

                1 Reply Last reply
                0
                • L
                  L
                  luccosen
                  wrote on last edited by
                  #8

                  wich is the correct command to delete only 2 row? 

                  thanks

                  1 Reply Last reply
                  0
                  • F
                    F
                    Filipp Sudanov
                    wrote on last edited by
                    #9

                    This can be accomplished by copying only one row to a temporary table:

                    create temp table saved as select * from config where var_name = 'DBConnectionPool.MaxLifetime' limit 1;

                    delete from config where var_name = 'DBConnectionPool.MaxLifetime';

                    insert into config select * from saved;

                    1 Reply Last reply
                    0
                    • L
                      L
                      luccosen
                      wrote on last edited by
                      #10

                      many thanks, but I found more row duplicate  😕 ... then I adopted the query below...

                      delete from config a using config b where a=b and a.ctid < b.ctid;

                      it works well... also for all duplicate on db. 

                      I resolved.

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups