Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSSQL - DBAL - Symfony / enqueue - Issue with Uuid #1358

Open
svI24 opened this issue Sep 16, 2024 · 0 comments
Open

MSSQL - DBAL - Symfony / enqueue - Issue with Uuid #1358

svI24 opened this issue Sep 16, 2024 · 0 comments

Comments

@svI24
Copy link

svI24 commented Sep 16, 2024

I have a Symfony 6.4 application and have an issue with enqueue.
My Symfony Database is a MSSQL Server.
I have installed the enqueue modules with composer. This worked fine. The table enqueue got created.

When I now try to save a command to the Queue, I get an error:

$cmd = new RunCommand('debug:container', ['--tag=form.type']);
$producer->sendCommand(Commands::RUN_COMMAND, $cmd);

Error:

[Doctrine\DBAL\Exception\DriverException (-16)]
An exception occurred while executing a query: SQLSTATE [IMSSP, -16]: An invalid PHP type for parameter 1 was specified

While debugging I found out that parameter 1 of the error is the id field of the database.
The Id is set at L69 https://github.com/php-enqueue/dbal/blob/2375961434e2a69b8710875f1c4e56f01b348a47/DbalProducer.php#L69 with Uuid:uuid4() function. 'id' => Uuid::uuid4(),
It returns an object for id:

Array
(
    [id] => Ramsey\Uuid\Lazy\LazyUuidFromString Object
        (
            [unwrapped:Ramsey\Uuid\Lazy\LazyUuidFromString:private] => 
            [uuid:Ramsey\Uuid\Lazy\LazyUuidFromString:private] => 5909c9e3-1690-4cd0-b0f0-0151e6f7996a
        )

    [published_at] => 17252753310188
    // [body]  =>... more fields of enqueue table
)

When I change now L69 to 'id' => \Enqueue\Util\UUID::generate(), it returns the Uuid String and saving to database works.

Array
(
    [id] => 6f9cfd8d-4f3a-4675-9f95-a2099de60457
    [published_at] => 17252757497569
    //[body] => ... 
)

There seems to be an issue to convert the Object to an Uuid string somewhere later or it is only MSSQL related.

Can you please check, if you can reproduce this issue?
Does anyone know a solution for this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant