Why am I receiving this error?

There’s two folders in your project and both of them have a bot.py file.
I suggest that you rename one of them to another thing or just change the extension to bot.py.bkp

1 Like

strange, there was just 1 before

1 Like

also i deleted the second folder

1 Like

uhmm, the error with database is still there, everything that i use that has database don’t work

1 Like

Oh sorry, is this still the error you are getting?

ERROR    discord.client Ignoring exception in on_message

  File "/home/runner/RP-Utilities/.pythonlibs/lib/python3.10/site-packages/pymongo/topology.py", line 269, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: encoding with 'idna' codec failed (UnicodeError: label empty or too long), Timeout: 30s, Topology Description: <TopologyDescription id: 64f71a41ad1b5bfeb8bc78e4, topology_type: Unknown, servers: [<ServerDescription ('mongodb%2bsrv%3a%2f%2fhirukarogue%3adv%40plasma123%40rpucloudserver.bscpl0p.mongodb.net%2f%3fretrywrites%3dtrue%26w%3dmajority', 27017) server_type: Unknown, rtt: None, error=UnicodeError("encoding with 'idna' codec failed (UnicodeError: label empty or too long)")>]>
1 Like

Based on this error:

pymongo.errors.ServerSelectionTimeoutError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)

It indicates there’s an issue with the encoding of your MongoDB connection URI.
Based on your error traceback:

mongodb%2bsrv%3a%2f%2fhirukarogue%3adv%40plasma123%40rpucloudserver.bscpl0p.mongodb.net%2f%3fretrywrites%3dtrue%26w%3dmajority

It looks like the URI is URL-encoded. AFAIK you shouldn’t pass URL-encoded strings to MongoDB. You should pass a raw connection string without encoding.

So you need to make sure that the URI is correct.
And use raw connection strings.
So instead of this:

await self.database.connect(parse.quote_plus(os.environ['database']))

Do something like this:

username = parse.quote_plus(os.environ['db_username'])
password = parse.quote_plus(os.environ['db_password'])
db_name = "mydatabase"  # or whatever your database name is
connection_uri = f"mongodb+srv://{username}:{password}@cluster.mongodb.net/{db_name}?retryWrites=true&w=majority"
await self.database.connect(connection_uri)

You can check connection string formats here:

3 Likes

yes, this is the error i’m receiving

1 Like

okay i tried that way but didn’t worked:

Traceback (most recent call last):
  File "/home/runner/RP-Utilities/.pythonlibs/lib/python3.10/site-packages/pymongo/srv_resolver.py", line 97, in _resolve_uri
    results = _resolve(
  File "/home/runner/RP-Utilities/.pythonlibs/lib/python3.10/site-packages/pymongo/srv_resolver.py", line 45, in _resolve
    return resolver.resolve(*args, **kwargs)
  File "/home/runner/RP-Utilities/.pythonlibs/lib/python3.10/site-packages/dns/resolver.py", line 1565, in resolve
    return get_default_resolver().resolve(
  File "/home/runner/RP-Utilities/.pythonlibs/lib/python3.10/site-packages/dns/resolver.py", line 1307, in resolve
    (request, answer) = resolution.next_request()
  File "/home/runner/RP-Utilities/.pythonlibs/lib/python3.10/site-packages/dns/resolver.py", line 749, in next_request
    raise NXDOMAIN(qnames=self.qnames_to_try, responses=self.nxdomain_responses)
dns.resolver.NXDOMAIN: The DNS query name does not exist: _mongodb._tcp.cluster.mongodb.net.

1 Like

This is a generic name you need to pick up your cluster hostname. You can use the Atlas CLI to get the right hostname.

I think the command to use on cli is “atlas process list -o json” . An host name example would be: atlas-vpjr9d-shard-00-03.hbmflhz.mongodb.net

2 Likes

unfortunatelly i couldn’t install the mongodb cli:

1 Like
~/RP-Utilities$ brew install gcc
Running `brew update --auto-update`...
==> Downloading https://ghcr.io/v2/homebrew/core/gcc/manifests/13.2.0
Already downloaded: /home/runner/.cache/Homebrew/downloads/7b8317732e5fcc6f220d88ec01976badf7786ec77c64efc9b38a81b54c34e9b9--gcc-13.2.0.bottle_manifest.json
==> Fetching dependencies for gcc: linux-headers@5.15, glibc, gmp, isl, mpfr, libmpc, lz4, xz, zlib, zstd and binutils
==> Downloading https://ghcr.io/v2/homebrew/core/linux-headers/5.15/manifests/5.15.131
Already downloaded: /home/runner/.cache/Homebrew/downloads/d5723b44432840a4527f8e25cd0ea4686ca76e3136205592db6a2e5e9d8bf6bf--linux-headers@5.15-5.15.131.bottle_manifest.json
==> Fetching linux-headers@5.15
==> Downloading https://ghcr.io/v2/homebrew/core/linux-headers/5.15/blobs/sha256:244e9f
Already downloaded: /home/runner/.cache/Homebrew/downloads/0cb8c27a839b68ee0127a602e1c6424921856c93a222606716508d4830fb0a7b--linux-headers@5.15--5.15.131.x86_64_linux.bottle.tar.gz
==> Fetching glibc
Warning: Building glibc from source as the bottle needs:
- HOMEBREW_CELLAR: /home/linuxbrew/.linuxbrew/Cellar (yours is /home/runner/RP-Utilities/homebrew/Cellar)
- HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew (yours is /home/runner/RP-Utilities/homebrew)
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/55c64143625a3c
Already downloaded: /home/runner/.cache/Homebrew/downloads/efde5376883ef301c73cf1d8727cbf974ab754b5075311a371481075ccf5d760--glibc.rb
==> Downloading https://github.com/Homebrew/glibc-bootstrap/releases/download/1.0.0/boo
Already downloaded: /home/runner/.cache/Homebrew/downloads/9daccbc8162c5702590e1405c1fb9c4824aee8c29b607f4ae0f77e06cb827036--bootstrap-binutils-2.38.tar.gz
==> Downloading https://github.com/Homebrew/glibc-bootstrap/releases/download/1.0.0/boo
Already downloaded: /home/runner/.cache/Homebrew/downloads/e8b2b31c87e86aae9b340b3f236f622d7bfa64d68a968b9a27879cd44f3868b2--bootstrap-bison-3.8.2.tar.gz
==> Downloading https://github.com/Homebrew/glibc-bootstrap/releases/download/1.0.0/boo
Already downloaded: /home/runner/.cache/Homebrew/downloads/69ea20c522780dd7bb9eca0b720d1b8d5b0e725910e014e46d8c42278da2e25c--bootstrap-gawk-5.1.1.tar.gz
==> Downloading https://github.com/Homebrew/glibc-bootstrap/releases/download/1.0.0/boo
Already downloaded: /home/runner/.cache/Homebrew/downloads/d798bf0a43adeacfa8eabcd3be7716c504985349d6ec35b2aa6cc131df924e85--bootstrap-gcc-9.5.0.tar.gz
==> Downloading https://github.com/Homebrew/glibc-bootstrap/releases/download/1.0.0/boo
Already downloaded: /home/runner/.cache/Homebrew/downloads/d2ccb4e6c70f07e3d6240650c09c5ebc7e93a9c0e6db5b124ce9d518e30358e5--bootstrap-make-4.3.tar.gz
==> Downloading https://github.com/Homebrew/glibc-bootstrap/releases/download/1.0.0/boo
Already downloaded: /home/runner/.cache/Homebrew/downloads/25df16c6cd058f6218b9f9235ce8b0fecf7d350162ffd46aab2de7967d051154--bootstrap-python3-3.9.13.tar.gz
==> Downloading https://github.com/Homebrew/glibc-bootstrap/releases/download/1.0.0/boo
Already downloaded: /home/runner/.cache/Homebrew/downloads/eeceff913839cbc91176f6c1db39d31391731c20d0bbe8777797c6ca71c51be0--bootstrap-sed-4.8.tar.gz
==> Downloading https://ftp.gnu.org/gnu/glibc/glibc-2.35.tar.gz
Already downloaded: /home/runner/.cache/Homebrew/downloads/329d4c5b7b38da0a5dcb652257748b77e9100bbc4771166317ac852d1376cf82--glibc-2.35.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/manifests/6.2.1_1
Already downloaded: /home/runner/.cache/Homebrew/downloads/a1986a80dafb4e42b8372268a00d8d14aa8294154c876ba82e7ce48db06885cb--gmp-6.2.1_1.bottle_manifest.json
==> Fetching dependencies for gmp: glibc
==> Fetching gmp
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/blobs/sha256:786ae29f0c0b06ea86e42
Already downloaded: /home/runner/.cache/Homebrew/downloads/b4fd2f8770dab9531cfeae2cbc9cdae3bfbccbf4e251c4aa251b75d23beb3fd9--gmp--6.2.1_1.x86_64_linux.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/isl/manifests/0.26
Already downloaded: /home/runner/.cache/Homebrew/downloads/ec0bbec77171645273dd59a9ccfdf290deccd999b3ca2082e0478d282b777ec0--isl-0.26.bottle_manifest.json
==> Fetching dependencies for isl: glibc
==> Fetching isl
==> Downloading https://ghcr.io/v2/homebrew/core/isl/blobs/sha256:db14ba1e4ea23ab41e069
Already downloaded: /home/runner/.cache/Homebrew/downloads/8ec6804f086e8abd51daae940fff59aeb6d66bc32113cf67d6e024835cf7e164--isl--0.26.x86_64_linux.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/mpfr/manifests/4.2.0-p12
Already downloaded: /home/runner/.cache/Homebrew/downloads/d11db1fb1639030bbe9b0e2518a12765b48cd30dfad27f38d1affdbbf404c046--mpfr-4.2.0-p12.bottle_manifest.json
==> Fetching dependencies for mpfr: glibc
==> Fetching mpfr
==> Downloading https://ghcr.io/v2/homebrew/core/mpfr/blobs/sha256:57c89c97863cb0d08251
Already downloaded: /home/runner/.cache/Homebrew/downloads/314c044de4fb89b0ffa59f9c4fffa99fb473dcb8c7b29766596c299f87899628--mpfr--4.2.0-p12.x86_64_linux.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/libmpc/manifests/1.3.1
Already downloaded: /home/runner/.cache/Homebrew/downloads/fdfa98e0f8bb3ce075cb32776ac2345aa2f89252706c162aecfc841085fa76be--libmpc-1.3.1.bottle_manifest.json
==> Fetching dependencies for libmpc: glibc
==> Fetching libmpc
==> Downloading https://ghcr.io/v2/homebrew/core/libmpc/blobs/sha256:f6542ae5bcf643ca0c
Already downloaded: /home/runner/.cache/Homebrew/downloads/6032341c169e7e85223d6088efc74e2443db4b533a330f19b40b2239df164080--libmpc--1.3.1.x86_64_linux.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/manifests/1.9.4
Already downloaded: /home/runner/.cache/Homebrew/downloads/379e59b981667f9585b33a2ff318769d8edca3ce6fd2e9a67ed291ae3e0cc872--lz4-1.9.4.bottle_manifest.json
==> Fetching dependencies for lz4: glibc
==> Fetching lz4
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/blobs/sha256:1757fefc3840e11c4822e
Already downloaded: /home/runner/.cache/Homebrew/downloads/0e1822b21340968e08a38ebad2df2a2007600450c01d984e82071a679ae9b419--lz4--1.9.4.x86_64_linux.bottle.tar.gz
==> Fetching dependencies for xz: glibc
==> Fetching xz
Warning: Building xz from source as the bottle needs:
- HOMEBREW_CELLAR: /home/linuxbrew/.linuxbrew/Cellar (yours is /home/runner/RP-Utilities/homebrew/Cellar)
- HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew (yours is /home/runner/RP-Utilities/homebrew)
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/55c64143625a3c
Already downloaded: /home/runner/.cache/Homebrew/downloads/b353ae86ac48cbf878cf36b46ade3da3302cf25f278cc4d5cb3b89156e993bfc--xz.rb
==> Downloading https://downloads.sourceforge.net/project/lzmautils/xz-5.4.4.tar.gz
Already downloaded: /home/runner/.cache/Homebrew/downloads/c04c8a07f85b624479bfa330a221f3fdd2d1603be8bd58b6c0cb30a233f6b706--xz-5.4.4.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/manifests/1.3
Already downloaded: /home/runner/.cache/Homebrew/downloads/b4c20c0489e59e6d8c5f8e4abdd47f07d52fe38699b6f0fea76781631025eecd--zlib-1.3.bottle_manifest.json
==> Fetching dependencies for zlib: glibc
==> Fetching zlib
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/blobs/sha256:a47a3b5c8ee68010ab37
Already downloaded: /home/runner/.cache/Homebrew/downloads/8079be26d78645fd5b819edd702c6d39030084c0688f7fef61dce714b8891b3d--zlib--1.3.x86_64_linux.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/zstd/manifests/1.5.5-1
Already downloaded: /home/runner/.cache/Homebrew/downloads/fc13698599720a53800064b40cddd854399651cf8760d9b0e46092f2e8da701a--zstd-1.5.5-1.bottle_manifest.json
==> Fetching dependencies for zstd: glibc and xz
==> Fetching zstd
==> Downloading https://ghcr.io/v2/homebrew/core/zstd/blobs/sha256:96afcbd191c996144616
Already downloaded: /home/runner/.cache/Homebrew/downloads/0dc9504bd106b159981be080054012bfe6c10732bc65096fe1d39b7114ae1475--zstd--1.5.5.x86_64_linux.bottle.1.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/binutils/manifests/2.41
Already downloaded: /home/runner/.cache/Homebrew/downloads/06cd935b73925633b6181886748531112240cdb3b9bbaf121c437d716c6f8e90--binutils-2.41.bottle_manifest.json
==> Fetching dependencies for binutils: glibc
==> Fetching binutils
==> Downloading https://ghcr.io/v2/homebrew/core/binutils/blobs/sha256:3b91a59270365b12
Already downloaded: /home/runner/.cache/Homebrew/downloads/00b013008ca5303014f62b90915f9d762dfa1e520b70cb2b5c40ee98d3ad4fbc--binutils--2.41.x86_64_linux.bottle.tar.gz
==> Fetching gcc
==> Downloading https://ghcr.io/v2/homebrew/core/gcc/blobs/sha256:fea0256da0e5ef8a08fe0
Already downloaded: /home/runner/.cache/Homebrew/downloads/8389f4464e66bf2a730e4539307a8b69e0be8186ce09155f7cff640240c5b6e4--gcc--13.2.0.x86_64_linux.bottle.tar.gz
Error: The following formulae cannot be installed from bottles and must be
built from source.
  glibc and xz
Install Clang or run `brew install gcc`.
1 Like

this one is me trying to install gcc but failing on process, i was trying to fix the error doing it but i couldn’t

1 Like

What type of bot are you trying to hook up?

I know it’s an RP but it need to be one this one? There’s plenty of Discord RP bots out there, is there any specific reason for you wanting this one?

1 Like

i’m trying to make a RP super tool bot, with selection dice roll, math, characters, templates and even macros, i’m planning to make it complex but yet intuitive to everyone use it. I want this one cus it’s my project i’m planning to make it and maybe get a breadwinner from it (not p2w but cosmetics). This is my test server for my bot in discord:

2 Likes

also i want to make it in a good quality way, cus i can’t make a thing just for money, it shall need quality

1 Like

@UMARismyname or @QwertyQwerty88 does replit support homebrew?

1 Like

I don’t beleive so since that would require sudo unless there’s a nix package

2 Likes

how do i use nix package for sudo?

I’m responding to windlother sorry but basically you can’t access sudo on replit sorry

1 Like

i see, also @WindLother