Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      OSX ( Using Symfony2 )

      Description

      When I run doctrine:schema:create, doctrine throw the following exception:
      [Doctrine\DBAL\DBALException]
      Unknown column type requested.

      ( Note: their is 2 spaces between type and requested )

      The problem with this error message is how much it's unspecific. Event with -v, I still have no clue about that type is wrong, and what file is concerned.
      So basically, I have to manually look at all my mapping files, one by one.

      Also note that doctrine:mapping:info return all OK.

        Activity

        Francois Mazerolle created issue -
        Hide
        Denny Swindle added a comment -

        Ironically, this same issue has recently started happening for me as well. It just started randomly over the weekend. Same exact issue (with 2 spaces between type and requested). For me, it happens when using Doctrine\ORM\EntityManager->find() on a valid entity.

        #0 /doctrine-2.1.2/Doctrine/DBAL/DBALException.php(81): Doctrine\DBAL\DBALException::unknownColumnType()
        #1 /doctrine-2.1.2/Doctrine/DBAL/Types/Type.php(140): Doctrine\DBAL\DBALException::unknownColumnType()
        #2 /doctrine-2.1.2/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php(84): Doctrine\DBAL\Types\Type::getType()
        #3 /doctrine-2.1.2/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php(43): Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->_hydrateRow()
        #4 /doctrine-2.1.2/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php(99): Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->_hydrateAll()
        #5 /doctrine-2.1.2/Doctrine/ORM/Persisters/BasicEntityPersister.php(581): Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll()
        #6 /doctrine-2.1.2/Doctrine/ORM/EntityRepository.php(130): Doctrine\ORM\Persisters\BasicEntityPersister->load()
        #7 /doctrine-2.1.2/Doctrine/ORM/EntityManager.php(350): Doctrine\ORM\EntityRepository->find()

        Show
        Denny Swindle added a comment - Ironically, this same issue has recently started happening for me as well. It just started randomly over the weekend. Same exact issue (with 2 spaces between type and requested). For me, it happens when using Doctrine\ORM\EntityManager->find() on a valid entity. #0 /doctrine-2.1.2/Doctrine/DBAL/DBALException.php(81): Doctrine\DBAL\DBALException::unknownColumnType() #1 /doctrine-2.1.2/Doctrine/DBAL/Types/Type.php(140): Doctrine\DBAL\DBALException::unknownColumnType() #2 /doctrine-2.1.2/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php(84): Doctrine\DBAL\Types\Type::getType() #3 /doctrine-2.1.2/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php(43): Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->_hydrateRow() #4 /doctrine-2.1.2/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php(99): Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->_hydrateAll() #5 /doctrine-2.1.2/Doctrine/ORM/Persisters/BasicEntityPersister.php(581): Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll() #6 /doctrine-2.1.2/Doctrine/ORM/EntityRepository.php(130): Doctrine\ORM\Persisters\BasicEntityPersister->load() #7 /doctrine-2.1.2/Doctrine/ORM/EntityManager.php(350): Doctrine\ORM\EntityRepository->find()
        Hide
        Gediminas Morkevicius added a comment -

        hi, seems like doctrine does not clean cache fully.

        in my case I'm using APC cache
        run: in php *apc_clear_cache('user');*

        it should work fine now

        PS.:
        running cache clearing commands, does not help.

        doctrine:cache:clear-metadata Clears all metadata cache for a entity manager
        doctrine:cache:clear-query Clears all query cache for a entity manager
        doctrine:cache:clear-result Clears result cache for a entity manager

        Show
        Gediminas Morkevicius added a comment - hi, seems like doctrine does not clean cache fully. in my case I'm using APC cache run: in php * apc_clear_cache('user'); * it should work fine now PS.: running cache clearing commands, does not help. doctrine:cache:clear-metadata Clears all metadata cache for a entity manager doctrine:cache:clear-query Clears all query cache for a entity manager doctrine:cache:clear-result Clears result cache for a entity manager
        Hide
        Francois Mazerolle added a comment -

        Hi,

        @gediminas : I don't have the error anymore so I can't test, but it's nice if there's a solution to fix it.

        However, this error is problematic as it's anti-verbose.
        There's is no indication of a cache problem in the error message. It try to point out to a field, and that field is not even displayed in the error.
        I hope someone will be able to fix the error so that's it become a useful error, like by following some sort of guideline:

        http://www.useit.com/alertbox/20010624.html

        I don't want to troll or anything, but as I'Ve started using doctrine2 with symfony2, the MAJOR problem I've encountered what bad error message that was leaving me lost. Often I had -v, find the file where the error occurred, look at the code, understand by myself what's wrong and attempt to fix it. This is counter-productive and really show that the exception message doesn't follow most error message guide line. For sure, we're not end-users, but we're "programmer-user" that use the system, and this "title" come with a knowledge that is not the same as we could expect of a core-developer, for example.

        I hope this message was constructive.

        Show
        Francois Mazerolle added a comment - Hi, @gediminas : I don't have the error anymore so I can't test, but it's nice if there's a solution to fix it. However, this error is problematic as it's anti-verbose. There's is no indication of a cache problem in the error message. It try to point out to a field, and that field is not even displayed in the error. I hope someone will be able to fix the error so that's it become a useful error, like by following some sort of guideline: http://www.useit.com/alertbox/20010624.html I don't want to troll or anything, but as I'Ve started using doctrine2 with symfony2, the MAJOR problem I've encountered what bad error message that was leaving me lost. Often I had -v, find the file where the error occurred, look at the code, understand by myself what's wrong and attempt to fix it. This is counter-productive and really show that the exception message doesn't follow most error message guide line. For sure, we're not end-users, but we're "programmer-user" that use the system, and this "title" come with a knowledge that is not the same as we could expect of a core-developer, for example. I hope this message was constructive.
        Hide
        Benjamin Eberlei added a comment -

        Improved this error message alot and also changed some regarding reverse engineering of custom types (where this error often occured):

        You can now implement Type#getMappedDatabaseTypes(AbstractPlatform $platform); on your custom type and return a list of database types that this doctrine type maps to.

        Show
        Benjamin Eberlei added a comment - Improved this error message alot and also changed some regarding reverse engineering of custom types (where this error often occured): You can now implement Type#getMappedDatabaseTypes(AbstractPlatform $platform); on your custom type and return a list of database types that this doctrine type maps to.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3 [ 10184 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 13142 ] jira-feedback2 [ 17760 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17760 ] jira-feedback3 [ 20115 ]
        Hide
        Almog Baku added a comment -

        this bug is still happening to me.. but its works as excepted within `schema:create` and throw error on `schema:update` or `schema:drop`

        I using doctrine with symfony

        Show
        Almog Baku added a comment - this bug is still happening to me.. but its works as excepted within `schema:create` and throw error on `schema:update` or `schema:drop` I using doctrine with symfony

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-178, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Francois Mazerolle
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: