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

updated instructions for .env and compose files when using non standard port in redis #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

m5ingh
Copy link

@m5ingh m5ingh commented Jul 22, 2023

Redis might require passing port value in commands section (in compose file) when using non standard ports. Added instructions for achieving the same. Should not be a breaking change. Tested with both configs works as expected.

@m5ingh m5ingh changed the title updated instructions .env and compose files for using non standard port updated instructions for .env and compose files when using non standard port in redis Jul 22, 2023
@saleh-mir
Copy link
Member

Is it possible for the user to only change the port in the .env file and not touch the docker compose file?

@m5ingh
Copy link
Author

m5ingh commented Apr 16, 2024

Unfortunately both files are required to be edited.
Here is the output when i try with just updated .env file:

[+] Running 33/33
✔ jesse 14 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 132.3s
✔ 7d63c13d9b9b Pull complete 32.0s
✔ 6ad2a11ca37b Pull complete 31.6s
✔ 8076cdef4689 Pull complete 39.3s
✔ 0ba90f5a7dd0 Pull complete 37.4s
✔ 27c191df269f Pull complete 38.9s
✔ 18aabdb8a4ca Pull complete 62.6s
✔ b26edd9e0452 Pull complete 55.9s
✔ ba258fce2cfd Pull complete 48.7s
✔ 4aa46db1a17f Pull complete 61.9s
✔ bdd4c2bcdd9b Pull complete 61.6s
✔ 7195f0c15a62 Pull complete 63.1s
✔ f30dd2bf6594 Pull complete 98.1s
✔ edcd463cc2f3 Pull complete 71.4s
✔ 24204799b598 Pull complete 69.5s
✔ postgres 8 layers [⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 123.0s
✔ e54d40fa3899 Pull complete 80.2s
✔ 63bba88902c4 Pull complete 80.2s
✔ 895cde69c46d Pull complete 95.1s
✔ f283b4aaa3dc Pull complete 81.6s
✔ e1dfb80fbe96 Pull complete 88.1s
✔ cab9af40886f Pull complete 89.9s
✔ 0008d7ccfed1 Pull complete 91.5s
✔ 5f53a735edbf Pull complete 98.7s
✔ redis 8 layers [⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 53.1s
✔ 4abcf2066143 Pull complete 7.1s
✔ 2c3a1d240687 Pull complete 6.8s
✔ 643f361aa308 Pull complete 7.0s
✔ a693cf0e318c Pull complete 18.4s
✔ ade57efb0b22 Pull complete 19.0s
✔ 2fa2e1566407 Pull complete 18.4s
✔ 4f4fb700ef54 Pull complete 29.5s
✔ 4464e0709769 Pull complete 29.5s
[+] Running 4/3
✔ Network docker_default Created 0.1s
✔ Container redis Created 0.1s
✔ Container postgres Created 0.1s
✔ Container jesse Created 0.0s
Attaching to jesse, postgres, redis
redis | 1:C 16 Apr 2024 09:36:45.880 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis | 1:C 16 Apr 2024 09:36:45.880 # Redis version=6.2.14, bits=64, commit=00000000, modified=0, pid=1, just started
redis | 1:C 16 Apr 2024 09:36:45.880 # Configuration loaded
redis | 1:M 16 Apr 2024 09:36:45.880 * monotonic clock: POSIX clock_gettime
redis | 1:M 16 Apr 2024 09:36:45.881 * Running mode=standalone, port=6379.
redis | 1:M 16 Apr 2024 09:36:45.881 # Server initialized
redis | 1:M 16 Apr 2024 09:36:45.881 * Ready to accept connections
postgres |
postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres |
postgres | 2024-04-16 09:36:45.962 UTC [1] LOG: starting PostgreSQL 14.11 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014, 64-bit
postgres | 2024-04-16 09:36:45.962 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres | 2024-04-16 09:36:45.962 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres | 2024-04-16 09:36:45.964 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres | 2024-04-16 09:36:45.967 UTC [22] LOG: database system was interrupted; last known up at 2023-07-27 15:14:25 UTC
postgres | 2024-04-16 09:36:46.073 UTC [22] LOG: database system was not properly shut down; automatic recovery in progress
postgres | 2024-04-16 09:36:46.074 UTC [22] LOG: redo starts at 0/1742AC0
postgres | 2024-04-16 09:36:46.074 UTC [22] LOG: invalid record length at 0/1742BA8: wanted 24, got 0
postgres | 2024-04-16 09:36:46.074 UTC [22] LOG: redo done at 0/1742B70 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
postgres | 2024-04-16 09:36:46.083 UTC [1] LOG: database system is ready to accept connections
jesse | Traceback (most recent call last):
jesse | File "/usr/local/bin/jesse", line 33, in
jesse | sys.exit(load_entry_point('jesse', 'console_scripts', 'jesse')())
jesse | File "/usr/local/bin/jesse", line 25, in importlib_load_entry_point
jesse | return next(matches).load()
jesse | File "/usr/local/lib/python3.9/importlib/metadata.py", line 77, in load
jesse | module = import_module(match.group('module'))
jesse | File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module
jesse | return _bootstrap._gcd_import(name[level:], package, level)
jesse | File "", line 1030, in _gcd_import
jesse | File "", line 1007, in _find_and_load
jesse | File "", line 972, in _find_and_load_unlocked
jesse | File "", line 228, in _call_with_frames_removed
jesse | File "", line 1030, in _gcd_import
jesse | File "", line 1007, in _find_and_load
jesse | File "", line 986, in _find_and_load_unlocked
jesse | File "", line 680, in _load_unlocked
jesse | File "", line 850, in exec_module
jesse | File "", line 228, in _call_with_frames_removed
jesse | File "/jesse-docker/jesse/init.py", line 13, in
jesse | from jesse.services.redis import async_redis, async_publish, sync_publish
jesse | File "/jesse-docker/jesse/services/redis.py", line 23, in
jesse | async_redis = asyncio.run(init_redis())
jesse | File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
jesse | return loop.run_until_complete(main)
jesse | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
jesse | return future.result()
jesse | File "/jesse-docker/jesse/services/redis.py", line 12, in init_redis
jesse | return await aioredis.create_redis_pool(
jesse | File "/usr/local/lib/python3.9/site-packages/aioredis/commands/init.py", line 188, in create_redis_pool
jesse | pool = await create_pool(address, db=db,
jesse | File "/usr/local/lib/python3.9/site-packages/aioredis/pool.py", line 58, in create_pool
jesse | await pool._fill_free(override_min=False)
jesse | File "/usr/local/lib/python3.9/site-packages/aioredis/pool.py", line 383, in _fill_free
jesse | conn = await self._create_new_connection(self._address)
jesse | File "/usr/local/lib/python3.9/site-packages/aioredis/connection.py", line 111, in create_connection
jesse | reader, writer = await asyncio.wait_for(open_connection(
jesse | File "/usr/local/lib/python3.9/asyncio/tasks.py", line 442, in wait_for
jesse | return await fut
jesse | File "/usr/local/lib/python3.9/site-packages/aioredis/stream.py", line 23, in open_connection
jesse | transport, _ = await get_event_loop().create_connection(
jesse | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
jesse | raise exceptions[0]
jesse | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
jesse | sock = await self._connect_sock(
jesse | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
jesse | await self.sock_connect(sock, address)
jesse | File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
jesse | return await fut
jesse | File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
jesse | raise OSError(err, f'Connect call failed {address}')
jesse | ConnectionRefusedError: [Errno 111] Connect call failed ('172.18.0.3', 6380)
jesse exited with code 1

From what i have tested editing both files should also have no impact for both use cases of standard and non standard ports as the port value by default is always 6379. Additional info/command is included for folks that may want to run on non standard ports. This is very beneficial when there is already a redis instance running for some other application.

Tested with latest version too. Works as intended.

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

Successfully merging this pull request may close these issues.

2 participants