PHP7 on AWS Deployment: MappingException "Duplicate definition of column" #5338

Closed
opened 2026-01-22 15:04:58 +01:00 by admin · 10 comments
Owner

Originally created by @spointecker on GitHub (Dec 5, 2016).

Originally assigned to: @Ocramius on GitHub.

Hello,

I am currently facing an error for a week now and I have no clue what is happening here.

  1. It works fine on my local vagrant machine with Ubuntu LTE 16.04 PHP7
  2. It fails with the following error message during our deployment for warming the doctrine cache (Elastic Beanstalk Config 64bit Amazon Linux 2016.09 v2.2.0 running PHP 7.0)

We run this command on deploy:
php bin/console cache:clear --env=prod && php bin/console cache:warmup --env=prod

And this is the exception we get:

[Doctrine\ORM\Mapping\MappingException]
  Duplicate definition of column 'created' on entity 'xyz\Bundle\Entity\xyz' in a field or discriminator column mapping.
  1. The ORM mapping is provided by XML files, "auto_mapping" for doctrine is enabled. I also tried manually pointing to the orm xml files. Same result.
  2. There is no annotation for doctrine orm in the entity files.
  3. Packages installed currently:
    "doctrine/doctrine-bundle": "1.6.4",
    "doctrine/doctrine-cache-bundle": "1.3.",
    "beberlei/DoctrineExtensions": "1.0.
    ",
    "doctrine/orm": "2.5.",
    "symfony/symfony": "3.1.
    ",
    "symfony/framework-bundle": "3.0.*",

If you need more information (config, entities, exception, ...) just tell me.

Thanks in advance,
Stefan

Originally created by @spointecker on GitHub (Dec 5, 2016). Originally assigned to: @Ocramius on GitHub. Hello, I am currently facing an error for a week now and I have no clue what is happening here. 1. It works fine on my local vagrant machine with Ubuntu LTE 16.04 PHP7 2. It fails with the following error message during our deployment for warming the doctrine cache (Elastic Beanstalk Config 64bit Amazon Linux 2016.09 v2.2.0 running PHP 7.0) We run this command on deploy: `php bin/console cache:clear --env=prod && php bin/console cache:warmup --env=prod ` And this is the exception we get: ``` [Doctrine\ORM\Mapping\MappingException] Duplicate definition of column 'created' on entity 'xyz\Bundle\Entity\xyz' in a field or discriminator column mapping. ``` 3. The ORM mapping is provided by XML files, "auto_mapping" for doctrine is enabled. I also tried manually pointing to the orm xml files. Same result. 4. There is no annotation for doctrine orm in the entity files. 5. Packages installed currently: "doctrine/doctrine-bundle": "1.6.4", "doctrine/doctrine-cache-bundle": "1.3.*", "beberlei/DoctrineExtensions": "1.0.*", "doctrine/orm": "2.5.*", "symfony/symfony": "3.1.*", "symfony/framework-bundle": "3.0.*", If you need more information (config, entities, exception, ...) just tell me. Thanks in advance, Stefan
admin added the BugIncompleteMissing Tests labels 2026-01-22 15:04:58 +01:00
admin closed this issue 2026-01-22 15:04:58 +01:00
Author
Owner

@Ocramius commented on GitHub (Dec 5, 2016):

Entity and related mapping file, please

On 5 Dec 2016 3:24 p.m., "Pointi" notifications@github.com wrote:

Hello,

I am currently facing an error for a week now and I have no clue what is
happening here.

  1. It works fine on my local vagrant machine with Ubuntu LTE 16.04 PHP7
  2. It fails with the following error message during our deployment for
    warming the doctrine cache (Elastic Beanstalk Config 64bit Amazon Linux
    2016.09 v2.2.0 running PHP 7.0)

We run this command on deploy:
php bin/console cache:clear --env=prod && php bin/console cache:warmup
--env=prod

And this is the exception we get:

[Doctrine\ORM\Mapping\MappingException]
Duplicate definition of column 'created' on entity 'Iamstudent\ServiceBundle\Entity\Voucher' in a field or discriminator column mapping.

  1. The ORM mapping is provided by XML files, "auto_mapping" for
    doctrine is enabled. I also tried manually pointing to the orm xml files.
    Same result.
  2. There is no annotation for doctrine orm in the entity files.
  3. Packages installed currently:
    "doctrine/doctrine-bundle": "1.6.4",
    "doctrine/doctrine-cache-bundle": "1.3.
    ", "beberlei/DoctrineExtensions": "1.0.",
    "doctrine/orm": "2.5.
    ", "symfony/symfony": "3.1.",
    "symfony/framework-bundle": "3.0.*",

If you need more information (config, entities, exception, ...) just tell
me.

Thanks in advance,
Stefan


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6158, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakFHlY9O0zcVTACaXdhq_Z-pJnQecks5rFB6NgaJpZM4LER7g
.

@Ocramius commented on GitHub (Dec 5, 2016): Entity and related mapping file, please On 5 Dec 2016 3:24 p.m., "Pointi" <notifications@github.com> wrote: > Hello, > > I am currently facing an error for a week now and I have no clue what is > happening here. > > 1. It works fine on my local vagrant machine with Ubuntu LTE 16.04 PHP7 > 2. It fails with the following error message during our deployment for > warming the doctrine cache (Elastic Beanstalk Config 64bit Amazon Linux > 2016.09 v2.2.0 running PHP 7.0) > > We run this command on deploy: > php bin/console cache:clear --env=prod && php bin/console cache:warmup > --env=prod > > And this is the exception we get: > > [Doctrine\ORM\Mapping\MappingException] > Duplicate definition of column 'created' on entity 'Iamstudent\ServiceBundle\Entity\Voucher' in a field or discriminator column mapping. > > > 1. The ORM mapping is provided by XML files, "auto_mapping" for > doctrine is enabled. I also tried manually pointing to the orm xml files. > Same result. > 2. There is no annotation for doctrine orm in the entity files. > 3. Packages installed currently: > "doctrine/doctrine-bundle": "1.6.4", > "doctrine/doctrine-cache-bundle": "1.3. > *", "beberlei/DoctrineExtensions": "1.0.*", > "doctrine/orm": "2.5. > *", "symfony/symfony": "3.1.*", > "symfony/framework-bundle": "3.0.*", > > If you need more information (config, entities, exception, ...) just tell > me. > > Thanks in advance, > Stefan > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/doctrine/doctrine2/issues/6158>, or mute the thread > <https://github.com/notifications/unsubscribe-auth/AAJakFHlY9O0zcVTACaXdhq_Z-pJnQecks5rFB6NgaJpZM4LER7g> > . >
Author
Owner

@spointecker commented on GitHub (Dec 5, 2016):

Hi, thanks for your really fast response!

Entity:

<?php

namespace Iamstudent\ServiceBundle\Entity;

use DateTime;

/**
 * Slideshow
 */
class Slideshow
{
    /**
     * @var string
     */
    private $sloganRow1;

    /**
     * @var string
     */
    private $sloganRow2;

    /**
     * @var string
     */
    private $image;

    /**
     * @var string
     */
    private $buttonText;

    /**
     * @var \DateTime
     */
    private $fromDate;

    /**
     * @var \DateTime
     */
    private $toDate;

    /**
     * @var \DateTime
     */
    private $created;

    /**
     * @var \DateTime
     */
    private $updated;

    /**
     * @var \DateTime
     */
    private $deleted;

    /**
     * @var integer
     */
    private $id;

    /**
     * @var \Iamstudent\ServiceBundle\Entity\App
     */
    private $app;

    /**
     * @var \Iamstudent\ServiceBundle\Entity\Challenge
     */
    private $challenge;

    /**
     * @var \Iamstudent\ServiceBundle\Entity\Voucher
     */
    private $voucher;


    /**
     * Set sloganRow1
     *
     * @param string $sloganRow1
     * @return Slideshow
     */
    public function setSloganRow1($sloganRow1)
    {
        $this->sloganRow1 = $sloganRow1;

        return $this;
    }

    /**
     * Get sloganRow1
     *
     * @return string
     */
    public function getSloganRow1()
    {
        return $this->sloganRow1;
    }

    /**
     * Set sloganRow2
     *
     * @param string $sloganRow2
     * @return Slideshow
     */
    public function setSloganRow2($sloganRow2)
    {
        $this->sloganRow2 = $sloganRow2;

        return $this;
    }

    /**
     * Get sloganRow2
     *
     * @return string
     */
    public function getSloganRow2()
    {
        return $this->sloganRow2;
    }

    /**
     * Set image
     *
     * @param string $image
     * @return Slideshow
     */
    public function setImage($image)
    {
        if ($image !== null) {
            $this->image = $image;
        }
        return $this;
    }

    /**
     * Get image
     *
     * @return string
     */
    public function getImage()
    {
        return $this->image;
    }

    /**
     * Set buttonText
     *
     * @param string $buttonText
     * @return Slideshow
     */
    public function setButtonText($buttonText)
    {
        $this->buttonText = $buttonText;

        return $this;
    }

    /**
     * Get buttonText
     *
     * @return string
     */
    public function getButtonText()
    {
        return $this->buttonText;
    }

    /**
     * Set fromDate
     *
     * @param \DateTime $fromDate
     * @return Slideshow
     */
    public function setFromDate($fromDate)
    {
        $this->fromDate = $fromDate;

        return $this;
    }

    /**
     * Get fromDate
     *
     * @return \DateTime
     */
    public function getFromDate()
    {
        return $this->fromDate;
    }

    /**
     * Set toDate
     *
     * @param \DateTime $toDate
     * @return Slideshow
     */
    public function setToDate($toDate)
    {
        $this->toDate = $toDate;

        return $this;
    }

    /**
     * Get toDate
     *
     * @return \DateTime
     */
    public function getToDate()
    {
        return $this->toDate;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     * @return Slideshow
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set updated
     *
     * @param \DateTime $updated
     * @return Slideshow
     */
    public function setUpdated($updated)
    {
        $this->updated = $updated;

        return $this;
    }

    /**
     * Get updated
     *
     * @return \DateTime
     */
    public function getUpdated()
    {
        return $this->updated;
    }

    /**
     * Set deleted
     *
     * @param \DateTime $deleted
     * @return Slideshow
     */
    public function setDeleted($deleted)
    {
        $this->deleted = $deleted;

        return $this;
    }

    /**
     * Get deleted
     *
     * @return \DateTime
     */
    public function getDeleted()
    {
        return $this->deleted;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set app
     *
     * @param \Iamstudent\ServiceBundle\Entity\App $app
     * @return Slideshow
     */
    public function setApp(\Iamstudent\ServiceBundle\Entity\App $app = null)
    {
        $this->app = $app;

        return $this;
    }

    /**
     * Get app
     *
     * @return \Iamstudent\ServiceBundle\Entity\App
     */
    public function getApp()
    {
        return $this->app;
    }

    /**
     * Set challenge
     *
     * @param \Iamstudent\ServiceBundle\Entity\Challenge $challenge
     * @return Slideshow
     */
    public function setChallenge(\Iamstudent\ServiceBundle\Entity\Challenge $challenge = null)
    {
        $this->challenge = $challenge;

        return $this;
    }

    /**
     * Get challenge
     *
     * @return \Iamstudent\ServiceBundle\Entity\Challenge
     */
    public function getChallenge()
    {
        return $this->challenge;
    }

    /**
     * Set voucher
     *
     * @param \Iamstudent\ServiceBundle\Entity\Voucher $voucher
     * @return Slideshow
     */
    public function setVoucher(\Iamstudent\ServiceBundle\Entity\Voucher $voucher = null)
    {
        $this->voucher = $voucher;

        return $this;
    }

    /**
     * Get voucher
     *
     * @return \Iamstudent\ServiceBundle\Entity\Voucher
     */
    public function getVoucher()
    {
        return $this->voucher;
    }
    /**
     * @var string
     */
    private $url;


    /**
     * Set url
     *
     * @param string $url
     * @return Slideshow
     */
    public function setUrl($url)
    {
        $this->url = $url;

        return $this;
    }

    /**
     * Get url
     *
     * @return string
     */
    public function getUrl()
    {
        return $this->url;
    }

    /**
     * Returns the days till the end of this voucher
     * @return integer Days
     */
    public function getDaysUntil()
    {
        $now = new DateTime(date('Y-m-d'));
        $endDate = $this->getToDate();
        // +1 damit das Gewinnspiel am letzten Tag auch noch gültig ist
        if ($now <= $endDate) {
            return $endDate->diff($now)->days + 1;
        } else {
            return 0;
        }
    }

    public function isOnline()
    {
        $now = new DateTime(date('Y-m-d'));
        return $now >= $this->getFromDate() && $now <= $this->getToDate();
    }
    /**
     * @var \Iamstudent\ServiceBundle\Entity\Country
     */
    private $country;


    /**
     * Set country
     *
     * @param \Iamstudent\ServiceBundle\Entity\Country $country
     *
     * @return Slideshow
     */
    public function setCountry(\Iamstudent\ServiceBundle\Entity\Country $country = null)
    {
        $this->country = $country;

        return $this;
    }

    /**
     * Get country
     *
     * @return \Iamstudent\ServiceBundle\Entity\Country
     */
    public function getCountry()
    {
        return $this->country;
    }

    public function hasValidDates()
    {
        return ($this->fromDate < $this->toDate);
    }

    /**
     * @var boolean
     */
    private $sticky;


    /**
     * Set sticky
     *
     * @param boolean $sticky
     *
     * @return Slideshow
     */
    public function setSticky($sticky)
    {
        $this->sticky = $sticky;

        return $this;
    }

    /**
     * Get sticky
     *
     * @return boolean
     */
    public function getSticky()
    {
        return $this->sticky;
    }
}

ORM File:

<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="Iamstudent\ServiceBundle\Entity\Slideshow" table="slideshow">
    <indexes>
      <index name="fk_slideshow_voucher1_idx" columns="voucher_id"/>
      <index name="fk_slideshow_challenge1_idx" columns="challenge_id"/>
      <index name="fk_slideshow_app1_idx" columns="app_id"/>
      <index name="fk_slideshow_country_idx" columns="country_id"/>
      <index name="fk_slideshow_app_country_sticky" columns="app_id,country_id,sticky"/>
    </indexes>
    <id name="id" type="integer" column="id">
      <generator strategy="IDENTITY"/>
    </id>
    <field name="sloganRow1" type="string" column="slogan_row1" length="255" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="sloganRow2" type="string" column="slogan_row2" length="255" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="image" type="string" column="image" length="255" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="buttonText" type="string" column="button_text" length="45" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="fromDate" type="date" column="from_date" nullable="true"/>
    <field name="toDate" type="date" column="to_date" nullable="true"/>
    <field name="url" type="string" column="url" length="255" nullable="true">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="sticky" type="boolean" column="sticky" nullable="true">
      <options>
        <option name="default">0</option>
      </options>
    </field>
    <field name="created" type="datetime" column="created" nullable="true"/>
    <field name="updated" type="datetime" column="updated" nullable="true"/>
    <field name="deleted" type="datetime" column="deleted" nullable="true"/>
    <many-to-one field="app" target-entity="App" fetch="LAZY">
      <join-columns>
        <join-column name="app_id" referenced-column-name="id"/>
      </join-columns>
    </many-to-one>
    <many-to-one field="challenge" target-entity="Challenge" fetch="LAZY">
      <join-columns>
        <join-column name="challenge_id" referenced-column-name="id"/>
      </join-columns>
    </many-to-one>
    <many-to-one field="country" target-entity="Country" fetch="LAZY">
      <join-columns>
        <join-column name="country_id" referenced-column-name="id"/>
      </join-columns>
    </many-to-one>
    <many-to-one field="voucher" target-entity="Voucher" fetch="LAZY">
      <join-columns>
        <join-column name="voucher_id" referenced-column-name="id"/>
      </join-columns>
    </many-to-one>
  </entity>
</doctrine-mapping>
@spointecker commented on GitHub (Dec 5, 2016): Hi, thanks for your really fast response! Entity: ``` <?php namespace Iamstudent\ServiceBundle\Entity; use DateTime; /** * Slideshow */ class Slideshow { /** * @var string */ private $sloganRow1; /** * @var string */ private $sloganRow2; /** * @var string */ private $image; /** * @var string */ private $buttonText; /** * @var \DateTime */ private $fromDate; /** * @var \DateTime */ private $toDate; /** * @var \DateTime */ private $created; /** * @var \DateTime */ private $updated; /** * @var \DateTime */ private $deleted; /** * @var integer */ private $id; /** * @var \Iamstudent\ServiceBundle\Entity\App */ private $app; /** * @var \Iamstudent\ServiceBundle\Entity\Challenge */ private $challenge; /** * @var \Iamstudent\ServiceBundle\Entity\Voucher */ private $voucher; /** * Set sloganRow1 * * @param string $sloganRow1 * @return Slideshow */ public function setSloganRow1($sloganRow1) { $this->sloganRow1 = $sloganRow1; return $this; } /** * Get sloganRow1 * * @return string */ public function getSloganRow1() { return $this->sloganRow1; } /** * Set sloganRow2 * * @param string $sloganRow2 * @return Slideshow */ public function setSloganRow2($sloganRow2) { $this->sloganRow2 = $sloganRow2; return $this; } /** * Get sloganRow2 * * @return string */ public function getSloganRow2() { return $this->sloganRow2; } /** * Set image * * @param string $image * @return Slideshow */ public function setImage($image) { if ($image !== null) { $this->image = $image; } return $this; } /** * Get image * * @return string */ public function getImage() { return $this->image; } /** * Set buttonText * * @param string $buttonText * @return Slideshow */ public function setButtonText($buttonText) { $this->buttonText = $buttonText; return $this; } /** * Get buttonText * * @return string */ public function getButtonText() { return $this->buttonText; } /** * Set fromDate * * @param \DateTime $fromDate * @return Slideshow */ public function setFromDate($fromDate) { $this->fromDate = $fromDate; return $this; } /** * Get fromDate * * @return \DateTime */ public function getFromDate() { return $this->fromDate; } /** * Set toDate * * @param \DateTime $toDate * @return Slideshow */ public function setToDate($toDate) { $this->toDate = $toDate; return $this; } /** * Get toDate * * @return \DateTime */ public function getToDate() { return $this->toDate; } /** * Set created * * @param \DateTime $created * @return Slideshow */ public function setCreated($created) { $this->created = $created; return $this; } /** * Get created * * @return \DateTime */ public function getCreated() { return $this->created; } /** * Set updated * * @param \DateTime $updated * @return Slideshow */ public function setUpdated($updated) { $this->updated = $updated; return $this; } /** * Get updated * * @return \DateTime */ public function getUpdated() { return $this->updated; } /** * Set deleted * * @param \DateTime $deleted * @return Slideshow */ public function setDeleted($deleted) { $this->deleted = $deleted; return $this; } /** * Get deleted * * @return \DateTime */ public function getDeleted() { return $this->deleted; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set app * * @param \Iamstudent\ServiceBundle\Entity\App $app * @return Slideshow */ public function setApp(\Iamstudent\ServiceBundle\Entity\App $app = null) { $this->app = $app; return $this; } /** * Get app * * @return \Iamstudent\ServiceBundle\Entity\App */ public function getApp() { return $this->app; } /** * Set challenge * * @param \Iamstudent\ServiceBundle\Entity\Challenge $challenge * @return Slideshow */ public function setChallenge(\Iamstudent\ServiceBundle\Entity\Challenge $challenge = null) { $this->challenge = $challenge; return $this; } /** * Get challenge * * @return \Iamstudent\ServiceBundle\Entity\Challenge */ public function getChallenge() { return $this->challenge; } /** * Set voucher * * @param \Iamstudent\ServiceBundle\Entity\Voucher $voucher * @return Slideshow */ public function setVoucher(\Iamstudent\ServiceBundle\Entity\Voucher $voucher = null) { $this->voucher = $voucher; return $this; } /** * Get voucher * * @return \Iamstudent\ServiceBundle\Entity\Voucher */ public function getVoucher() { return $this->voucher; } /** * @var string */ private $url; /** * Set url * * @param string $url * @return Slideshow */ public function setUrl($url) { $this->url = $url; return $this; } /** * Get url * * @return string */ public function getUrl() { return $this->url; } /** * Returns the days till the end of this voucher * @return integer Days */ public function getDaysUntil() { $now = new DateTime(date('Y-m-d')); $endDate = $this->getToDate(); // +1 damit das Gewinnspiel am letzten Tag auch noch gültig ist if ($now <= $endDate) { return $endDate->diff($now)->days + 1; } else { return 0; } } public function isOnline() { $now = new DateTime(date('Y-m-d')); return $now >= $this->getFromDate() && $now <= $this->getToDate(); } /** * @var \Iamstudent\ServiceBundle\Entity\Country */ private $country; /** * Set country * * @param \Iamstudent\ServiceBundle\Entity\Country $country * * @return Slideshow */ public function setCountry(\Iamstudent\ServiceBundle\Entity\Country $country = null) { $this->country = $country; return $this; } /** * Get country * * @return \Iamstudent\ServiceBundle\Entity\Country */ public function getCountry() { return $this->country; } public function hasValidDates() { return ($this->fromDate < $this->toDate); } /** * @var boolean */ private $sticky; /** * Set sticky * * @param boolean $sticky * * @return Slideshow */ public function setSticky($sticky) { $this->sticky = $sticky; return $this; } /** * Get sticky * * @return boolean */ public function getSticky() { return $this->sticky; } } ``` ORM File: ``` <?xml version="1.0" encoding="utf-8"?> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> <entity name="Iamstudent\ServiceBundle\Entity\Slideshow" table="slideshow"> <indexes> <index name="fk_slideshow_voucher1_idx" columns="voucher_id"/> <index name="fk_slideshow_challenge1_idx" columns="challenge_id"/> <index name="fk_slideshow_app1_idx" columns="app_id"/> <index name="fk_slideshow_country_idx" columns="country_id"/> <index name="fk_slideshow_app_country_sticky" columns="app_id,country_id,sticky"/> </indexes> <id name="id" type="integer" column="id"> <generator strategy="IDENTITY"/> </id> <field name="sloganRow1" type="string" column="slogan_row1" length="255" nullable="true"> <options> <option name="fixed"/> </options> </field> <field name="sloganRow2" type="string" column="slogan_row2" length="255" nullable="true"> <options> <option name="fixed"/> </options> </field> <field name="image" type="string" column="image" length="255" nullable="true"> <options> <option name="fixed"/> </options> </field> <field name="buttonText" type="string" column="button_text" length="45" nullable="true"> <options> <option name="fixed"/> </options> </field> <field name="fromDate" type="date" column="from_date" nullable="true"/> <field name="toDate" type="date" column="to_date" nullable="true"/> <field name="url" type="string" column="url" length="255" nullable="true"> <options> <option name="fixed"/> </options> </field> <field name="sticky" type="boolean" column="sticky" nullable="true"> <options> <option name="default">0</option> </options> </field> <field name="created" type="datetime" column="created" nullable="true"/> <field name="updated" type="datetime" column="updated" nullable="true"/> <field name="deleted" type="datetime" column="deleted" nullable="true"/> <many-to-one field="app" target-entity="App" fetch="LAZY"> <join-columns> <join-column name="app_id" referenced-column-name="id"/> </join-columns> </many-to-one> <many-to-one field="challenge" target-entity="Challenge" fetch="LAZY"> <join-columns> <join-column name="challenge_id" referenced-column-name="id"/> </join-columns> </many-to-one> <many-to-one field="country" target-entity="Country" fetch="LAZY"> <join-columns> <join-column name="country_id" referenced-column-name="id"/> </join-columns> </many-to-one> <many-to-one field="voucher" target-entity="Voucher" fetch="LAZY"> <join-columns> <join-column name="voucher_id" referenced-column-name="id"/> </join-columns> </many-to-one> </entity> </doctrine-mapping> ```
Author
Owner

@Ocramius commented on GitHub (Dec 5, 2016):

Can you re-run the command with a -vvv flag, to see the exception trace?

@Ocramius commented on GitHub (Dec 5, 2016): Can you re-run the command with a `-vvv` flag, to see the exception trace?
Author
Owner

@spointecker commented on GitHub (Dec 5, 2016):

Sure.

I executed the following command:

(The failing entity changes sometimes, that´s why there is now another entity failing)

bin/console cache:clear --env=prod -vvv

Output:

// Clearing the cache for the prod environment with debug false                                                        

 // Warming up cache...                                                                                                 


                                                                                                                                              
  [Doctrine\ORM\Mapping\MappingException]                                                                                                     
  Duplicate definition of column 'name' on entity 'Iamstudent\ServiceBundle\Entity\Organisation' in a field or discriminator column mapping.  
                                                                                                                                              

Exception trace:
 () at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:565
 Doctrine\ORM\Mapping\MappingException::duplicateColumnName() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1393
 Doctrine\ORM\Mapping\ClassMetadataInfo->_validateAndCompleteFieldMapping() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:2314
 Doctrine\ORM\Mapping\ClassMetadataInfo->mapField() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php:252
 Doctrine\ORM\Mapping\Driver\XmlDriver->loadMetadataForClass() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php:102
 Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain->loadMetadataForClass() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:151
 Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadMetadata() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:332
 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78
 Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:216
 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:115
 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getAllMetadata() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php:69
 Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer->warmUp() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php:48
 Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:489
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:117
 Symfony\Component\HttpKernel\Kernel->boot() at /var/app/ondeck/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:134
 Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() at /var/app/ondeck/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:96
 Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:837
 Symfony\Component\Console\Application->doRunCommand() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:187
 Symfony\Component\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/framework-bundle/Console/Application.php:80
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:118
 Symfony\Component\Console\Application->run() at /var/app/ondeck/bin/console:29
@spointecker commented on GitHub (Dec 5, 2016): Sure. I executed the following command: (The failing entity changes sometimes, that´s why there is now another entity failing) `bin/console cache:clear --env=prod -vvv` Output: ``` // Clearing the cache for the prod environment with debug false // Warming up cache... [Doctrine\ORM\Mapping\MappingException] Duplicate definition of column 'name' on entity 'Iamstudent\ServiceBundle\Entity\Organisation' in a field or discriminator column mapping. Exception trace: () at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:565 Doctrine\ORM\Mapping\MappingException::duplicateColumnName() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1393 Doctrine\ORM\Mapping\ClassMetadataInfo->_validateAndCompleteFieldMapping() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:2314 Doctrine\ORM\Mapping\ClassMetadataInfo->mapField() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php:252 Doctrine\ORM\Mapping\Driver\XmlDriver->loadMetadataForClass() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php:102 Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain->loadMetadataForClass() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:151 Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadMetadata() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:332 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78 Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:216 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:115 Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getAllMetadata() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php:69 Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer->warmUp() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php:48 Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:489 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:117 Symfony\Component\HttpKernel\Kernel->boot() at /var/app/ondeck/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:134 Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() at /var/app/ondeck/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:96 Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256 Symfony\Component\Console\Command\Command->run() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:837 Symfony\Component\Console\Application->doRunCommand() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:187 Symfony\Component\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/framework-bundle/Console/Application.php:80 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:118 Symfony\Component\Console\Application->run() at /var/app/ondeck/bin/console:29 ```
Author
Owner

@Ocramius commented on GitHub (Dec 5, 2016):

Do you by chance extend the entity that you have shown here?

On 5 Dec 2016 3:49 p.m., "Pointi" notifications@github.com wrote:

Sure.

I executed the following command:

bin/console cache:clear --env=prod -vvv

Output:

// Clearing the cache for the prod environment with debug false

// Warming up cache...

[Doctrine\ORM\Mapping\MappingException]
Duplicate definition of column 'name' on entity 'Iamstudent\ServiceBundle\Entity\Organisation' in a field or discriminator column mapping.

Exception trace:
() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:565
Doctrine\ORM\Mapping\MappingException::duplicateColumnName() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1393
Doctrine\ORM\Mapping\ClassMetadataInfo->_validateAndCompleteFieldMapping() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:2314
Doctrine\ORM\Mapping\ClassMetadataInfo->mapField() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php:252
Doctrine\ORM\Mapping\Driver\XmlDriver->loadMetadataForClass() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php:102
Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain->loadMetadataForClass() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:151
Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadMetadata() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:332
Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78
Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:216
Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:115
Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getAllMetadata() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php:69
Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer->warmUp() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php:48
Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:489
Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:117
Symfony\Component\HttpKernel\Kernel->boot() at /var/app/ondeck/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:134
Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() at /var/app/ondeck/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:96
Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256
Symfony\Component\Console\Command\Command->run() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:837
Symfony\Component\Console\Application->doRunCommand() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:187
Symfony\Component\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/framework-bundle/Console/Application.php:80
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:118
Symfony\Component\Console\Application->run() at /var/app/ondeck/bin/console:29


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6158#issuecomment-264872767,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakOghfj_Pe5rNTPWa9GJ8fpeGVgrHks5rFCRxgaJpZM4LER7g
.

@Ocramius commented on GitHub (Dec 5, 2016): Do you by chance extend the entity that you have shown here? On 5 Dec 2016 3:49 p.m., "Pointi" <notifications@github.com> wrote: > Sure. > > I executed the following command: > > bin/console cache:clear --env=prod -vvv > > Output: > > // Clearing the cache for the prod environment with debug false > > // Warming up cache... > > > > [Doctrine\ORM\Mapping\MappingException] > Duplicate definition of column 'name' on entity 'Iamstudent\ServiceBundle\Entity\Organisation' in a field or discriminator column mapping. > > > Exception trace: > () at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:565 > Doctrine\ORM\Mapping\MappingException::duplicateColumnName() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1393 > Doctrine\ORM\Mapping\ClassMetadataInfo->_validateAndCompleteFieldMapping() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:2314 > Doctrine\ORM\Mapping\ClassMetadataInfo->mapField() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php:252 > Doctrine\ORM\Mapping\Driver\XmlDriver->loadMetadataForClass() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php:102 > Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain->loadMetadataForClass() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:151 > Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadMetadata() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:332 > Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78 > Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:216 > Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor() at /var/app/ondeck/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:115 > Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getAllMetadata() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php:69 > Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer->warmUp() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php:48 > Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:489 > Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:117 > Symfony\Component\HttpKernel\Kernel->boot() at /var/app/ondeck/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:134 > Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() at /var/app/ondeck/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:96 > Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256 > Symfony\Component\Console\Command\Command->run() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:837 > Symfony\Component\Console\Application->doRunCommand() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:187 > Symfony\Component\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/framework-bundle/Console/Application.php:80 > Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:118 > Symfony\Component\Console\Application->run() at /var/app/ondeck/bin/console:29 > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/doctrine/doctrine2/issues/6158#issuecomment-264872767>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AAJakOghfj_Pe5rNTPWa9GJ8fpeGVgrHks5rFCRxgaJpZM4LER7g> > . >
Author
Owner

@spointecker commented on GitHub (Dec 5, 2016):

No the entities aren´t extended at all. Unfortunately this is the most common answer to this problem according to my research. But it´s definitely not the case.

@spointecker commented on GitHub (Dec 5, 2016): No the entities aren´t extended at all. Unfortunately this is the most common answer to this problem according to my research. But it´s definitely not the case.
Author
Owner

@spointecker commented on GitHub (Dec 5, 2016):

The weird thing is that if I disable all doctrine related deploy commands the deployment works just fine and if I run the commands directly on the instance afterwards it works also just fine.

So if the app has switched from /var/app/ondeck to /var/app/current it works.
I already thought about some permission problems but it (the thrown exception) makes no sense to me.

@spointecker commented on GitHub (Dec 5, 2016): The weird thing is that if I disable all doctrine related deploy commands the deployment works just fine and if I run the commands directly on the instance afterwards it works also just fine. So if the app has switched from /var/app/ondeck to /var/app/current it works. I already thought about some permission problems but it (the thrown exception) makes no sense to me.
Author
Owner

@spointecker commented on GitHub (Dec 6, 2016):

So I guess you @Ocramius have also no idea left for me? ^^

@spointecker commented on GitHub (Dec 6, 2016): So I guess you @Ocramius have also no idea left for me? ^^
Author
Owner

@Ocramius commented on GitHub (Dec 6, 2016):

@spointecker I don't. I suggest going through with a debugger. Also look for occurrences of those strings (in this case "name") in your project. Also check for listeners attached to the ORM (DoctrineExtensions, for example, may have some)

@Ocramius commented on GitHub (Dec 6, 2016): @spointecker I don't. I suggest going through with a debugger. Also look for occurrences of those strings (in this case "name") in your project. Also check for listeners attached to the ORM (DoctrineExtensions, for example, may have some)
Author
Owner

@Ocramius commented on GitHub (May 20, 2017):

Closing this as not reproducible

@Ocramius commented on GitHub (May 20, 2017): Closing this as not reproducible
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5338