Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • 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 (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Removing a domain produces an SQL error

Removing a domain produces an SQL error

Scheduled Pinned Locked Moved Solved Support
domains
5 Posts 3 Posters 807 Views 3 Watching
  • 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.
  • C Offline
    C Offline
    ChicagoGregg
    wrote on last edited by girish
    #1

    Hello. I'm trying to remove a domain and it's giving me the following error:

    ER_ROW_IS_REFERENCED_2: Cannot delete or update a parent row: a foreign key constraint fails (box.mailboxes, CONSTRAINT mailboxes_aliasDomain_constraint FOREIGN KEY (aliasDomain) REFERENCES mail (domain))

    There are four mailboxes connected to the domain.

    Do I perhaps need to delete the mailboxes before removing the domain?

    If so, feature request to put a checkbox (when deleting the domain) that will delete the mailboxes associated with it prior.

    Thanks!

    ba65f030-a051-4de7-9da5-3cdda962fb38-image.png

    girishG 1 Reply Last reply
    1
    • C ChicagoGregg

      Hello. I'm trying to remove a domain and it's giving me the following error:

      ER_ROW_IS_REFERENCED_2: Cannot delete or update a parent row: a foreign key constraint fails (box.mailboxes, CONSTRAINT mailboxes_aliasDomain_constraint FOREIGN KEY (aliasDomain) REFERENCES mail (domain))

      There are four mailboxes connected to the domain.

      Do I perhaps need to delete the mailboxes before removing the domain?

      If so, feature request to put a checkbox (when deleting the domain) that will delete the mailboxes associated with it prior.

      Thanks!

      ba65f030-a051-4de7-9da5-3cdda962fb38-image.png

      girishG Do not disturb
      girishG Do not disturb
      girish
      Staff
      wrote on last edited by
      #2

      @ChicagoGregg said in Removing a domain produces an SQL error:

      Do I perhaps need to delete the mailboxes before removing the domain?

      Yes, indeed. You have to remove mailboxes before deleting the domain itself.

      But looks like we don't handle some error properly, I am trying to reproduce this now.

      If so, feature request to put a checkbox (when deleting the domain) that will delete the mailboxes associated with it prior.

      This will be a bit complicated because you have to also decide whether to keep the mails in each mailbox. When you delete a mailbox, the option to keep the data or not is provided as a checkbox.

      1 Reply Last reply
      1
      • girishG girish marked this topic as a question on
      • girishG Do not disturb
        girishG Do not disturb
        girish
        Staff
        wrote on last edited by
        #3

        This for reporting, I could reproduce this. Fixed in https://git.cloudron.io/cloudron/box/-/commit/ba16fdaf603d664ca818dd084e6eb0315a3168a0

        C 1 Reply Last reply
        3
        • girishG girish has marked this topic as solved on
        • girishG girish

          This for reporting, I could reproduce this. Fixed in https://git.cloudron.io/cloudron/box/-/commit/ba16fdaf603d664ca818dd084e6eb0315a3168a0

          C Offline
          C Offline
          ChicagoGregg
          wrote on last edited by
          #4

          @girish said in Removing a domain produces an SQL error:

          This will be a bit complicated because you have to also decide whether to keep the mails in each mailbox. When you delete a mailbox, the option to keep the data or not is provided as a checkbox.

          Yea, it's a little more detailed for a new feature. How often is a domain deleted anyways. Well, it's a "nice to have". Low of the totem pole.

          @girish said in Removing a domain produces an SQL error:

          This for reporting, I could reproduce this. Fixed in https://git.cloudron.io/cloudron/box/-/commit/ba16fdaf603d664ca818dd084e6eb0315a3168a0

          Sure thing. Glad to have helped.

          Thanks,

          -gregg

          scookeS 1 Reply Last reply
          0
          • C ChicagoGregg

            @girish said in Removing a domain produces an SQL error:

            This will be a bit complicated because you have to also decide whether to keep the mails in each mailbox. When you delete a mailbox, the option to keep the data or not is provided as a checkbox.

            Yea, it's a little more detailed for a new feature. How often is a domain deleted anyways. Well, it's a "nice to have". Low of the totem pole.

            @girish said in Removing a domain produces an SQL error:

            This for reporting, I could reproduce this. Fixed in https://git.cloudron.io/cloudron/box/-/commit/ba16fdaf603d664ca818dd084e6eb0315a3168a0

            Sure thing. Glad to have helped.

            Thanks,

            -gregg

            scookeS Offline
            scookeS Offline
            scooke
            wrote on last edited by
            #5

            @ChicagoGregg said in Removing a domain produces an SQL error:

            Low of the totem pole.

            Low of the totem pole. Just use "least significant/important/crucial".

            A life lived in fear is a life half-lived

            1 Reply Last reply
            0
            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.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Bookmarks
            • Search