Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Lock] The choice of a store name from env vars doesn't work #27555

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

Closed
andsm opened this issue Jun 8, 2018 · 6 comments
Closed

[Lock] The choice of a store name from env vars doesn't work #27555

andsm opened this issue Jun 8, 2018 · 6 comments

Comments

@andsm
Copy link

andsm commented Jun 8, 2018

Symfony version(s) affected: 4.1.0

Description

Symfony\Component\Cache\Exception\InvalidArgumentException: Unsupported DSN: semaphore.

semaphore/flock - error
redis/memcached dsn - ok

How to reproduce

parameters:
    env(LOCK_STORE_DSN): 'semaphore'

framework:
    lock: '%env(LOCK_STORE_DSN)%'
@fabpot fabpot closed this as completed Apr 6, 2019
fabpot added a commit that referenced this issue Apr 6, 2019
…usse)

This PR was merged into the 4.3-dev branch.

Discussion
----------

Use env variable to create anytype of lock store

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27555
| License       | MIT
| Doc PR        | NA

In lock configuration, at the moment, env variable are only able to resolve DNS which are able to create RedisStore and MemcachedStore.

This PR update the StoreFactory to be able to also create connection at runtime.

Commits
-------

6b57ea9 Use env variable to create anytype of lock store
@ronisaha
Copy link

ronisaha commented Jul 2, 2019

This still not working! If we set semaphore or flock as LOCK_STORE_DSN value, getting Unsupported DSN: semaphore/flock. error whiling using the lock service.

console output:

[2019-07-02 01:02:16] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Cache\Exception\InvalidArgumentException: "Unsupported DSN: semaphore." at vendor/symfony/cache/Adapter/AbstractAdapter.php line 143 {"exception":"[object] (Symfony\Component\Cache\Exception\InvalidArgumentException(code: 0): Unsupported DSN: semaphore. at vendor/symfony/cache/Adapter/AbstractAdapter.php:143)"} []

Symfony version: 4.3.2

@xabbuh
Copy link
Member

xabbuh commented Jul 2, 2019

@ronisaha This looks like a configuration issue to me. The error mentions the Cache component.

@ronisaha
Copy link

ronisaha commented Jul 2, 2019

@xabbuh This is because the factory used Symfony\Component\Cache\Adapter\AbstractAdapter

@xabbuh xabbuh reopened this Jul 4, 2019
@ronisaha
Copy link

Any update on this issue?

@jderusse
Copy link
Member

jderusse commented Feb 3, 2020

This should be fixed by https://github.com/symfony/symfony/pull/34043/files and release in Symfony 4.4

Could you have a try?

@ronisaha
Copy link

ronisaha commented Feb 4, 2020

@jderusse Tested in 4.4.4, it's working.

@fabpot fabpot closed this as completed Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants