memcached_host is not passed on from ARTEMiS configuration files while running in Docker #49

Closed
opened 2023-10-20 20:41:05 +00:00 by phantomlan · 3 comments
Contributor

I'm having an issue with memcached_host configuration variable when setting up ARTEMiS running inside Docker
Game tested with: ONGEKI Bright MEMORY (v139)
Some snippets of code from configuration:
config/core.yaml

database:
...
memcached_host: "ma.memcached"
...

docker-compose.yml

app:
environment:
CFG_CORE_MEMCACHED_HOSTNAME: ma.memcached

When logging into game with profile, game requests GetUserMusicApi, and fails:

artemis-app-1         | [2023-10-20 20:27:02] Ongeki | INFO | v139 GetUserMusicApi request from <IP>
artemis-app-1         | [2023-10-20 20:27:02] ERROR | Database | Memcache failed: error 3 from memcached_get(titles.ongeki.base-util_generate): CONNECTION FAILURE
artemis-app-1         | [2023-10-20 20:27:02] Ongeki | ERROR | Error handling v139 method GetUserMusicApi - error 47 from memcached_set: SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY

After failure, no Highscores load into the game, while the rest works fine
Debugging the issue, i noticed in core/data/cache.py:

        if has_mc:
            hostname = "127.0.0.1"
            if cfg:
                hostname = cfg.database.memcached_host
            memcache = pylibmc.Client([hostname], binary=True)

It seems that hostname = cfg.database.memcached_host is never invoked, keeping memcached address to 127.0.0.1(localhost)
Editing pylibmc.Client([hostname], binary=True) [hostname] entry to "ma.memcached" fixes the issue, ARTEMiS properly connects with memcached container and highscores load.
Of course disabling memcached also fixes loading highscores.

I'm having an issue with memcached_host configuration variable when setting up ARTEMiS running inside Docker Game tested with: ONGEKI Bright MEMORY (v139) Some snippets of code from configuration: config/core.yaml ``` database: ... memcached_host: "ma.memcached" ... ``` docker-compose.yml ``` app: environment: CFG_CORE_MEMCACHED_HOSTNAME: ma.memcached ``` When logging into game with profile, game requests GetUserMusicApi, and fails: ``` artemis-app-1 | [2023-10-20 20:27:02] Ongeki | INFO | v139 GetUserMusicApi request from <IP> artemis-app-1 | [2023-10-20 20:27:02] ERROR | Database | Memcache failed: error 3 from memcached_get(titles.ongeki.base-util_generate): CONNECTION FAILURE artemis-app-1 | [2023-10-20 20:27:02] Ongeki | ERROR | Error handling v139 method GetUserMusicApi - error 47 from memcached_set: SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY ``` After failure, no Highscores load into the game, while the rest works fine Debugging the issue, i noticed in core/data/cache.py: ``` if has_mc: hostname = "127.0.0.1" if cfg: hostname = cfg.database.memcached_host memcache = pylibmc.Client([hostname], binary=True) ``` It seems that `hostname = cfg.database.memcached_host` is never invoked, keeping memcached address to 127.0.0.1(localhost) Editing `pylibmc.Client([hostname], binary=True)` [hostname] entry to "ma.memcached" fixes the issue, ARTEMiS properly connects with memcached container and highscores load. Of course disabling memcached also fixes loading highscores.
Collaborator

Hello,

This issue was already reported a few weeks ago and fixed in the develop branch.

I would not recommend it in a docker as it is not really tested unless you want to tinker with the files directly, this is why the toggle to disable memcached is there.

If you have a potential fix for docker that would not break support for other operating systems such as Ubuntu and Windows, feel free to publish a pull request.

Thank you

Hello, This issue was already reported a few weeks ago and fixed in the develop branch. I would not recommend it in a docker as it is not really tested unless you want to tinker with the files directly, this is why the toggle to disable memcached is there. If you have a potential fix for docker that would not break support for other operating systems such as Ubuntu and Windows, feel free to publish a pull request. Thank you
Author
Contributor

I'm currently rewriting the dockerfile and docker-compose part with additional documentation to be more development and production friendly, i'll submit a merge request when that's finished and tested

I'm currently rewriting the dockerfile and docker-compose part with additional documentation to be more development and production friendly, i'll submit a merge request when that's finished and tested
Author
Contributor

Pull Request published, closing as issue is fixed in development branch

Pull Request published, closing as issue is fixed in development branch
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Hay1tsme/artemis#49
No description provided.