OCI8 - ORA-24415: Missing or null username

367 views
Skip to first unread message

Raymond DeBaBi

unread,
Jan 15, 2021, 7:12:14 AM1/15/21
to doctrine-user

Hi,

I am trying to use oracle database in my symfony 5.2 apps but unable to use it, I always have ORA-24415: Missing or null username

Here is an example of my .env
DATABASE_URL="oci8://${USERNAME}:${DATABASE_PASSWORD}@localhost:1234/${DBNAME}"

In my doctrine .yaml

`doctrine:
dbal:
password: '%env(DATABASE_PASSWORD)%'
user: '%env(resolve:USERNAME)%'
url: '%env(resolve:DATABASE_URL)%'
driver: 'oci8'
charset: 'UTF8'
logging: true
profiling: true
driver_class: 'Doctrine\DBAL\Driver\OCI8\Driver'

# IMPORTANT: You MUST configure your server version, # either here or in the DATABASE_URL env var (see .env file) #server_version: '13' orm: auto_generate_proxy_classes: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware auto_mapping: true mappings: App: is_bundle: false type: annotation dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' alias: App

`

And when I try : php bin/console dbal:run-sql "SELECT my_column FROM myTable" and I get [error] Error thrown while running command "dbal:run-sql 'SELECT PERS_ID FROM COMPTE'". Message: "An exception occurred in driver: ORA-24415: Missing or null username."

What I am doing wrong ?

I use
"doctrine/doctrine-bundle": "2.2.2", "doctrine/doctrine-migrations-bundle": "3.0.2", "doctrine/orm": "2.8.1"

Thanks

Reply all
Reply to author
Forward
0 new messages