#dev-contrib

1 messages Β· Page 96 of 1

gritty wind
#

Site is on 3.8

vocal prairie
#

Oh.

#

Is there a way to run on a certain version?

gritty wind
#

Pipenv should be able to automatically pick up the version if you have it installed on your machine

#

If not, and you're on linux, look into pyenv to manage your system installs

#

But you'll have to get 3.8 regardless

vocal prairie
#

I don't have 3.8 installed. I'll get it and try again.

clever wraith
#

Huh

short snow
#

it was erroring out of the yarnpkg keyring so i thought we could remove it, if it causes some issues we could always add it

short snow
clever wraith
#

Wait... Why is Sudo being used if logged in as root

short snow
#

won't matter.

green oriole
#

Removing dev keys can make you not be able to add it back

short snow
#

ah ok, would reinstalling that pkg make it work then?

green oriole
#

Usually you should just pull a new key, yes

#

and a revocation certificate if it has been released

short snow
#

ok

vocal prairie
#

Yay, pipenv sync --dev finally worked. Thanks Akarys and Scaleios!

green oriole
#

naice

vocal prairie
#

This is what I need in my hosts file, right?

gritty wind
#

looks good

green oriole
#

Yep

#

Shouldn't be needed with docker though

vocal prairie
#

Oh, you don't?

#

Oops.

gritty wind
#

If you’re running everything on docker and don’t need to access the site, then yeah

#

Otherwise you still need to do it

vocal prairie
#

Got it, ty!

#

I have another semi related issue. I'm on Windows, and I'm trying to uninstall and reinstall docker desktop, but when I click uninstall it takes me to the "Uninstall or change a program" page. But there, there's nothing related to docker.

#

I can still open Docker Desktop.

gritty wind
#

The beauties of docker

#

See if you can

#

Find an uninstalled in the download folder

swift flower
#

does docker let you run more bots and use less memory?

vocal prairie
green oriole
#

Docker is just here for isolation, it doesn't allow you to do more things

vale ibex
#

@green oriole How did you reproduce that bug in the stream PR?

#

I can't spot it

vocal prairie
green oriole
#

I simply res- hold on

#

HOOOOLLD on

vale ibex
#

πŸ˜‚

#

_reload_tasks_from_redis seems to do the job as far as I can see

green oriole
#

fuck, the env on notion is using fake redis

vale ibex
#

ahhh, that'll be it

green oriole
#

Alright, let me check that it works

vale ibex
#

πŸ‘

vocal prairie
green oriole
#

Sounds good

#

There should be a huge red warning when fake redis is enabled

gritty wind
#

why?

vale ibex
#

I think there is a log entry, it just gets lost in the flood of startup logs

gritty wind
#

Ideally your code shouldn't break just because someone is using fake redis lmao

green oriole
# gritty wind why?

Because it shouldn't be ever enabled in prod and it is easier to notice the issue when testing

vale ibex
#

it doesn't break, it just doesn't work as a persistent cache

green oriole
#

yeah, there is no persistence

gritty wind
#

Well, seems intended tbh πŸ‘€

#

That's not what fakeredis is meant for

vocal prairie
#

"docker uninstall" returned nothing. Time to search for "docker desktop uninstall".

vale ibex
#

Yea, agreed, it just raised a possible false negative on this PR

gritty wind
#

Nice

#

that's a win for VC

#

now I just gotta figure out this silence PR πŸ₯Ί

vale ibex
#

Cool

#

now to surprise Hem when it deploys πŸ‘€

gritty wind
#

You say that like Hem can't sense what everyone is thinking all the time

vale ibex
#

no spoilers

#

haha, too true

vocal prairie
#

So apparently, there's no uninstall file on my desktop for docker. But anyway, when I run docker-compose up, I get this:

[19952] Failed to execute script docker-compose```
gritty wind
#

is docker running

sleek steppe
vocal prairie
#

I have the desktop app open.

#

Is there something else I need to do?

#

The app says "No Containers Running"

vale ibex
#

IE the same dir as the docker-compose.yml file

vocal prairie
#

Yes.

vale ibex
#

Odd, I only tend to get that error when docker agent isn't running

gritty wind
sleek steppe
#

then why is it a parameter?

vale ibex
vocal prairie
#

Docker isn't recognized. Dang it.

vale ibex
#

restart your terminal

gritty wind
vocal prairie
#

Still nothing.

gritty wind
#

can you check path

vale ibex
#

Yea, it'll be something like C:\Program Files\Docker\Docker\resources\bin

gritty wind
#

just type PATH in cmd

vocal prairie
#

I don't think Docker's there, let me add it.

#

I added it, still nothing.

gritty wind
#

terminal restart?

vocal prairie
#

I closed and opened it a couple times.

gritty wind
#

alright, what do you get with docker now?

#

still same thing

vocal prairie
#

Yeah, same thing.

gritty wind
#

interesting

#

what did you add to path?

vocal prairie
#

C:\Program Files\Docker\Docker\resources\bin

gritty wind
#

hm

#

I think default install is

#

C:\ProgramData\DockerDesktop\version-bin

#

check your files

vocal prairie
#

docker.exe is in that folder.

gritty wind
#

Which folder?

vocal prairie
#

version-bin

gritty wind
#

Alright, try adding that as well

vocal prairie
#

That worked. Thanks!

gritty wind
#

nice

vocal prairie
#

I now have this:

web_1 | System check identified no issues (0 silenced).
web_1 | April 06, 2021 - 16:03:38
web_1 | Django version 3.0.11, using settings 'pydis_site.settings'
web_1 | Starting development server at http://0.0.0.0:8000/
web_1 | Quit the server with CONTROL-C.
```, but going to that url does nothing.
gritty wind
#

Try

vocal prairie
#

Both say "This site can't be reached"

gritty wind
#

uhh

#

can you check the response in the network tab

#

Oh wait

#

without the s

#

and with the port lol

#

I'm so bad at this

vocal prairie
#

The bottom one worked. Thank you so much!

short snow
fervent sage
#

hm, quackstack - or at least the current parts of it that make up the api - is meant to be a backend microservice, so it doesn't really make sense for it to do frontend stuff (especially since the request also takes json params the browser doesn't give), so i think that should wait for whatever frontend gets stuck onto quackstack

vocal prairie
#

When you're contributing to the site, how do you access the admin dashboard? Is there a test username and password, or can we just not access that?

gritty wind
#

admin - admin

vocal prairie
#

Oh, well that's simple. Thanks!

fallen patrol
vocal prairie
#

What?

#

That's a new feature.

#

It's not user facing at the moment.

fallen patrol
#

hold on my internet went down lemme get the last screenshot

#

yes it is

vocal prairie
#

It is?

#

Where do users besides the devs see that?

vocal prairie
#

Oh ok.

fallen patrol
#

it will be user facing eventually

vocal prairie
#

Eventually, yes.

#

I'm having some issues with Django url paths.

#

I have this code:html <a class="navbar-item" href="{% url 'wiki:get' path="timeline/" %}"> Timeline </a>My issue is that the timeline is not in the wiki folder, so I don't know what to put in the wiki:get section.

fervent sage
patent pivot
#

ah

#

update branch

fervent sage
#

i notice the ci merge went through

patent pivot
#

how do update branch lol

#

hold on I can probably do this from cli

fervent sage
#

could push a blank commit and squash it

patent pivot
#

cc @short snow: I updated your fork to fix a stuck lint

#

there we go

fervent sage
#

man ducks in prod soonℒ️

patent pivot
#

there we go

#

lol why is policy bot not reporting ow

#
{"level":"info","rid":"c1m9pgoeg3cfm7m6infg","github_installation_id":13368055,"github_repository_owner":"python-discord","github_repository_name":"quackstack","github_pr_num":25,"github_sha":"ef2f78fd9018162836870f2fb64cf9e6913987ce","time":"2021-04-06T17:39:18.225350775Z","message":"Skipping status update because PR state is not open"}

mfw

#

oh

#

lol

#

worked ig

fervent sage
#

probably because you had a merge commit since i last reviewed

#

so i reviewed again

magic arch
fervent sage
cold moon
#

Lmao

placid ermine
#

Suggestion: add a flag like --timeit to the !e command

#

which would, well, show how much time it took to execute the code along with the rest of the output

vale ibex
#

iirc there's a PR open for that already

#

or at least something similar

#

bot#1234

dusky shoreBOT
placid ermine
#

oh

magic arch
#

(I love that PR number)

placid ermine
#

heh

fervent sage
#

i'll admit im very satisfied to have bot#1500

vocal prairie
#

I like that pr number too.

#

Ooh, nice.

vale ibex
placid ermine
#

ha
i have pr#100 on another repo

#

anyway

gritty wind
# fallen patrol

We get those updates directly from discord, but those don’t seem to actually change the OAuth screen at all

magic arch
fallen patrol
#

does snekbox automatically update?

patent pivot
#

it auto-deploys, yep

swift flower
#

i bought a fresh vm

#

time to try this again..

fallen patrol
patent pivot
#

ah, no

swift flower
#

okay @short snow

#

Docker is running

#

everything is going well omg

swift flower
#

@patent pivot sorry for the ping, but i'm setting up the site, i ran docker-compose up and it was going for some time, then it stopped on Installing dependencies from Pipfile.lock (804ba7)... or i think my session may have timed out, should i just re-run the command?

patent pivot
#

that might take some time

swift flower
#

oh

#

so it's still going 😁

clever wraith
#

what's quackstack?

patent pivot
#

Duck generator as a microservice

clever wraith
#

nice

#

how to access?

#

any thing i can help with?

patent pivot
#

that page has a set of issues

clever wraith
#

i wanna work on the README

#

quackstack#12

patent pivot
#

I think that is somewhat blocking on having more things available, such as a CLI and PyPI package

fervent sage
#

for the time being if you wants docs i am walking talking ducks docs

magic arch
#

and here we see @magic arch playing with his rubber duckies...

swift flower
#

so um

#

the console is actually froze now

#

not responding πŸ˜”

sleek steppe
#

Could sir-lancebot get a draft PR emoji so it can show draft instead of the green open emoji?

#

For example, sir-lancebot#623

dusky shoreBOT
patent pivot
#

oooo

#

+1

magic arch
#

Where are the emojis the bot is using actually at?

clever wraith
#

another server i think

vocal wolf
#

smol pr needs review

brazen charm
#

What are the current review requirements for a pr to be merged?

magic arch
sleek steppe
#

2 staff/contributor approvals a coredev approval and no disaprovals from a staff/contributor I think

magic arch
#

this + anyone in the pydis org can disapprove + a devops review is required if GitHub Actions or Dockerfiles are changed

patent pivot
#

yeah, that

magic arch
sleek steppe
swift flower
#

can anyone voice call with me

swift flower
#

it says to use pipenv sync --dev
but when i do i get: ModuleNotFoundError: No module named 'distutils.spawn'

vale ibex
#

that PR is in my PR

vocal wolf
#

lmfao

#

@vale ibex maybe we should merge the other PR for now so it's a very temp fix, then merge yours eventually...?

vale ibex
#

yea sure, good with me

swift flower
#

how do i install distutils.spawn

#

or whatever

vale ibex
#

only issue with the small PR is it doesn't handle any raised exceptions

#

but it's unlikely to happen with the use case for that specific cog

fervent sage
#

do you ever just

sleek steppe
#

yes

swift flower
#
$ docker-compose up
bot_1       |     raise ClientConnectorError(req.connection_key, exc) from exc
bot_1       | aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host pydis-api.default.svc.cluster.local:80 ssl:default [None]
bot_1       | 2021-04-06 21:17:54 | bot | CRITICAL | Could not connect to site API. Is it running?
bot_bot_1 exited with code 69
#

what am i doing wrong?

vale ibex
#

in config.yml

#

under urls

#

set these vars ```yml
site: &DOMAIN "web:8000"
site_api: &API !JOIN ["api.", *DOMAIN]
site_paste: &PASTE !JOIN ["paste.", "pythondiscord.com"]
site_staff: &STAFF !JOIN ["staff.", *DOMAIN]
site_schema: &SCHEMA "http://"

#

some might already be correct

swift flower
#

once i run it can i exit out of ssh?

#

because it doesnt stop

sleek steppe
#

ctrl + c

swift flower
#

2021-04-06 21:37:46 | bot | CRITICAL | Could not connect to site API. Is it running?

sleek steppe
swift flower
#

yes

sleek steppe
#

web should be saying that it isn't connecting

swift flower
#

what should i do then?

vale ibex
#

Did you change config.yml or config-default.yml?

swift flower
#

config.yml

vale ibex
#

ok good

swift flower
#

yeah

#

it even says

#

idk why it isn't connecting

vale ibex
#

could you do docker-compose down and then docker-compose up --build

swift flower
#

sure

#

ok its done

#

no significant errors

vale ibex
#

Cool, just looks like some of your other config's are setup wrong

swift flower
#

but it should connect to the API

#

right?

vale ibex
#

looks like it is now right?

magic arch
#

The configs are a pain lol

vale ibex
#

making a whole package for it

swift flower
#

if i do pipenv run start it wont connect @vale ibex

vale ibex
#

its all running in docker now

magic arch
swift flower
#

is the bot online now then?

vale ibex
magic arch
#

As long as the docker command is running, the bot should be up and running

swift flower
#

i'll try !help

vale ibex
magic arch
#

Ah gotcha, sounds good

swift flower
#

AttributeError: 'NoneType' object has no attribute 'name'

#

hmm?

magic arch
#

Ohhh so that's what smartconfig is lol

vale ibex
vale ibex
swift flower
#

this is on discord @vale ibex

#

i did !help

vale ibex
#

anything in the docker output?

swift flower
#
bot_1       |   File "/usr/local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
bot_1       |     ret = await coro(*args, **kwargs)
bot_1       |   File "/bot/bot/decorators.py", line 90, in inner
bot_1       |     log.trace(f"Redirecting output of {ctx.author}'s command '{ctx.command.name}' to {redirect_channel.name}")
bot_1       | AttributeError: 'NoneType' object has no attribute 'name'```
vale ibex
#

ahh that'll be because you haven't setup redirect_channel yet

swift flower
#

oh i'll setup all of the cogs now

vale ibex
swift flower
#

thanks :)

vale ibex
#

np πŸ˜„

swift flower
#

just a case of cut and paste

#

now

magic arch
vale ibex
swift flower
#

what is redirect_channel for? i dont see it documented

magic arch
swift flower
#

okay

magic arch
#

So for example when you ran !help, it was trying to redirect the output to the bot command channel, which isn't set up yet in config probably

vale ibex
#

Yea, it's the constants.Channels.bot_commands channel

vale ibex
#

So it's more just be on the lookup for an announcement πŸ˜„

magic arch
#

Alrighty sounds good, looking forward to it

swift flower
#

@magic arch

#

what line is it on in config.yml?

vale ibex
#

It's bot_commands

#

under the Channels section

#

I'd suggest going through each of these and updating them to the equivalent on your server ```
style.emojis
guild.categories
guild.channels
guild.roles
guild.webhooks

swift flower
#

i still cant find it ahh

#

oh

#

line 183

sleek steppe
#

I also recommend you edit the trashcan emoji

swift flower
#

what's big brother?

vale ibex
#

!help bb

stable mountainBOT
#
Command Help

!bigbrother
Can also use: bb

Monitors users by relaying their messages to the Big Brother watch channel.

Subcommands:

!bigbrother oldest [update_cache=True]
Shows Big Brother monitored users ordered by oldest watched.
!bigbrother unwatch <user> <reason>
Stop relaying messages by the given user.
!bigbrother watch <user> <reason>
Relay messages sent by the given user to the #big-brother channel.
!bigbrother watched [oldest_first=False] [update_cache=True]
Shows the users that are currently being monitored by Big Brother.

vale ibex
#

it give mods the ability to 'watch' users

#

so all of their messages get relayed to a mod only channel

magic arch
#

I saw that it's kinda creepy loll

#

Thoughts on adding a tag on string indices/slicing?

sleek steppe
#

That would be cool

swift flower
#

i cant get the bot to come online now

#

but no errors in terminal

#

uhh

#

the bot isn't starting with the token i put in config.yml

vocal prairie
swift flower
#

and now bot_1 | bot.api.ResponseCodeError: Status: 401 Response: {'detail': 'Invalid token.'}

#

where is it getting the token from?

vocal prairie
#

Also, this page mentions SeasonalBot near the top, which may be confusing to users who are just starting to contribute to PyDis projects (especially since it's linked on the Lancebot contributing page): https://pythondiscord.com/pages/contributing/working-with-git/cli/.

swift flower
#

i put the bot token in config.yml

#

and .env

#

@vocal wolf i saw you had this issue, how did you fix it if you mind me asking?

vocal wolf
#

you're trying to setup the bot?

swift flower
#

yes

vocal wolf
#

give sec

swift flower
#

okay

vocal wolf
#

I think what I did

#

set up everything in one command

#

docker-compose up

#

and

#

that's all I remember

vocal wolf
swift flower
#

hmm okay

#

i still get an error :/

vocal wolf
#

can you link me to where I was discussing this issue?

vocal wolf
#

Since you're doing docker you may need to change the site url to web:8000, I'm not completely sure on that though.

swift flower
#

i did that already in config.yml

vocal prairie
#

Is Lancebot being slow today, or does it just not like me?

swift flower
#

you've gotta be fucking kidding me

short snow
short snow
fervent sage
fervent sage
vocal prairie
#

Quackstack's front end will be a customizable ducky builder on the website, right?

fervent sage
#

think so yea

vocal prairie
#

Noice.

vocal prairie
#

Yeah.

#

I was just making sure I remembered correctly.

short snow
fervent sage
#

i've learned more about using git in a more advanced capacity in the last 3 weeks as the entire rest of my time using it lmao

thorny obsidian
#

Welcome to Python Discord development. You're crash coursed through so many useful tools, whether you want to or not

fervent sage
#

(and by advanced capacity i mean branching kek)

magic arch
vocal prairie
#

Me neither.

fallen patrol
#

I'm curious why this function exists....

#

the point of that limitation wasn't to try and get around it....

tawdry vapor
#

Because it sends webhooks under people's names (like for logging) and some people may use clyde as their name or nickname, causing all webhooks for them to fail.

#

It's not about circumventing to intentionally impersonate Discord clyde.

sharp timber
tawdry vapor
#

I thought there was a chance Discord may stop enforcing it but I suppose that went nowhere.

fallen patrol
#

ohhhh

#

because

#

hi im clyde is caught as well

#

not just clyde itself as the only message

fallen patrol
#

related

#

why write the own manager here and not use praw?

#

!pypi praw

stable mountainBOT
#

PRAW, an acronym for `Python Reddit API Wrapper`, is a python package that allows for simple access to reddit's API.

tawdry vapor
#

praw is not async

fallen patrol
#

well that's good to know

#

wait

#

why not use asyncpraw

#

!pypi asyncpraw

stable mountainBOT
#

Async PRAW, an abbreviation for `Asynchronous Python Reddit API Wrapper`, is a python package that allows for simple access to reddit's API.

tawdry vapor
#

Cause it didn't exist

fallen patrol
#

oh.

sharp timber
#

Asyncpraw is new as of this year, server's been relaying reddit posts for at least three

fallen patrol
#

ah

#

that's a good reason

gritty wind
gritty wind
#

I'm not sure what that is. Is that a google VM?

swift flower
#

yes

#

i just had to create a new one and detatch the disk to the new VM to get the files back because i restarted the VM and couldn't SSH

gritty wind
#

I've never worked with them, so I'm not sure how to help. I don't believe anything uses the ssh port from our projects

short snow
#

are you running for production or development?

swift flower
#

development

short snow
#

same here, never worked with them, so not sure.

#

btw did you get docker isntalled?

swift flower
#

i....

short snow
#

uh?

swift flower
#

no

short snow
#

which step are you stuck?

#

sudo apt-get update?

swift flower
#

@short snow No i've set it up again now

#

Just back to square one

#

Of the bot telling me my token is invalid

short snow
#

regenerate a token and put it in

swift flower
#

The token isn't the problem

#

It works fine in my own code

#

And i've regenerated it countless times

gritty wind
#

Make sure to use the correct python version

#

namely

#

you're on 3.6

#

we're on 3.8

swift flower
#

i'm on 3.8 too

#

if i type python3.8

gritty wind
#

the traceback shows 3.6

thorny obsidian
#

Did you pipenv install aiohttp?

swift flower
#

no i'll try that

thorny obsidian
#

because pipenv will be separate from your regular packages

vocal prairie
#

pipenv sync --dev should do that, shouldn't it?

gritty wind
#

More specifically - your dep install shows 3.6, your running shows 3.8

thorny obsidian
#

Yeah, it should work with a sync, I sometimes have to just make sure I actually pipenv install all the packages though

swift flower
#

i made a help channel about it, my system wont let me delete python3.6 but i installed python 3.8 i have to type the version number to use it though @gritty wind

gritty wind
#

try running the following:
pipenv run python -VVVVVVV

swift flower
#

Python 3.8.0 (default, Feb 25 2021, 22:10:10)

gritty wind
#

If that shows 3.8, you should be able to follow up with
pipenv install --dev

swift flower
#

Oh cool

gritty wind
#

If all goes smoothly, you should then be able to start the bot, provided you have the site running

#

pipenv run start iirc

swift flower
#

it says my token is wrong though

thorny obsidian
#

I do love pipenv (if you ignore the locking >_>)

short snow
gritty wind
swift flower
#

yeah just running it

#

okay so pipenv run start tells me the API isn't running

#

and docker-compose up tells me my token is wrong

gritty wind
#

can you share the docker error (provided you wanna continue with docker)

swift flower
#

okay

gritty wind
#

otherwise, docker container ps to see if the site is running

short snow
#

if it is not, see the logs, and post the error here

swift flower
#

i dont see it running

#
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
gritty wind
#

in that case, try docker-compose up -d postgres web

#

if you also want snekbox or redis, you can add them to the end of that command

#

but they are optional

swift flower
#

ok i see it

gritty wind
#

nice

short snow
#

go to 127.0.0.1:8000

#

and see if it is running

gritty wind
#

You have to update your config now if you want to run locally. If you are going to run with docker, see what happens now

swift flower
#

that wont work because its a cloud VM @short snow

#

ok i'll try it @gritty wind

#

docker-compose up?

gritty wind
#

yup

#

and send the output of that

swift flower
#
bot_1       | Traceback (most recent call last):
bot_1       |   File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
bot_1       |     return _run_code(code, main_globals, None,
bot_1       |   File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
bot_1       |     exec(code, run_globals)
bot_1       |   File "/bot/bot/__main__.py", line 15, in <module>
bot_1       |     bot.instance.run(constants.Bot.token)
bot_1       |   File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 718, in run
bot_1       |     return future.result()
bot_1       |   File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 697, in runner
bot_1       |     await self.start(*args, **kwargs)
bot_1       |   File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 660, in start
bot_1       |     await self.login(*args, bot=bot)
bot_1       |   File "/bot/bot/bot.py", line 256, in login
bot_1       |     await self.cache_filter_list_data()
bot_1       |   File "/bot/bot/bot.py", line 87, in cache_filter_list_data
bot_1       |     full_cache = await self.api_client.get('bot/filter-lists')
bot_1       |   File "/bot/bot/api.py", line 80, in get
bot_1       |     return await self.request("GET", endpoint, raise_for_status=raise_for_status, **kwargs)
bot_1       |   File "/bot/bot/api.py", line 75, in request
bot_1       |     await self.maybe_raise_for_status(resp, raise_for_status)
bot_1       |   File "/bot/bot/api.py", line 67, in maybe_raise_for_status
bot_1       |     raise ResponseCodeError(response=response, response_json=response_json)
bot_1       | bot.api.ResponseCodeError: Status: 401 Response: {'detail': 'Invalid token.'}
bot_bot_1 exited with code 1```
gritty wind
#

well, I guess check the token, and check that it's loaded correctly

#

add print(constants.Bot.token) on line 14 in bot/__main__.py

thorny obsidian
#

If you know the token is correct, that feels like it might be misconfigured in the .env file

short snow
#

you can just see it in .env

swift flower
#

@short snow

#

the token is definitely right, because i can copy and paste it in my own code and it loads fine

thorny obsidian
gritty wind
swift flower
#

okay

short snow
#

yeah, i was up in message history, so saw something else

swift flower
#

uhh

gritty wind
#

that's the site token

swift flower
#

thats not the one i have in my config

#

oh

gritty wind
#

What do you have in your env

#

make sure to censor things

swift flower
#

a different one

#

starts with Nz

gritty wind
#

what's the variable itself called

#

should have something like:

BOT_TOKEN=Nz...
BOT_API_KEY=badbot13m0n8f570f942013fc818f234916ca531
swift flower
gritty wind
#

hm

#

try removing the ""

swift flower
#

okay

gritty wind
#

the api key should be badbot

#

but we can get to that later

swift flower
#

ok done

#

what should i do now?

gritty wind
#

try running docker-compose up --build bot

short snow
#

--build will rebuild the docker image ^

swift flower
#

invalid token :(

patent pivot
#

what type of invalid token

#

from discord or from our API

#

because it looks like it should be the one from scale starting with badbot

swift flower
#
bot_1       | Traceback (most recent call last):
bot_1       |   File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
bot_1       |     return _run_code(code, main_globals, None,
bot_1       |   File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
bot_1       |     exec(code, run_globals)
bot_1       |   File "/bot/bot/__main__.py", line 16, in <module>
bot_1       |     bot.instance.run(constants.Bot.token)
bot_1       |   File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 718, in run
bot_1       |     return future.result()
bot_1       |   File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 697, in runner
bot_1       |     await self.start(*args, **kwargs)
bot_1       |   File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 660, in start
bot_1       |     await self.login(*args, bot=bot)
bot_1       |   File "/bot/bot/bot.py", line 256, in login
bot_1       |     await self.cache_filter_list_data()
bot_1       |   File "/bot/bot/bot.py", line 87, in cache_filter_list_data
bot_1       |     full_cache = await self.api_client.get('bot/filter-lists')
bot_1       |   File "/bot/bot/api.py", line 80, in get
bot_1       |     return await self.request("GET", endpoint, raise_for_status=raise_for_status, **kwargs)
bot_1       |   File "/bot/bot/api.py", line 75, in request
bot_1       |     await self.maybe_raise_for_status(resp, raise_for_status)
bot_1       |   File "/bot/bot/api.py", line 67, in maybe_raise_for_status
bot_1       |     raise ResponseCodeError(response=response, response_json=response_json)
bot_1       | bot.api.ResponseCodeError: Status: 401 Response: {'detail': 'Invalid token.'}
bot_bot_1 exited with code 1```
patent pivot
#

Yeah that's from our API

short snow
#

put the bad bot token isntead of cz...

patent pivot
#

Where did you get the value you put in BOT_API_TOKEN

swift flower
cold moon
#

API token is for PyDis API, not for Discord API

swift flower
#

oh

gritty wind
#

badbot

swift flower
#

okay

#

let me try it now

#

hmm still invalid

gritty wind
#

still the same traceback?

swift flower
#

yeah

short snow
#

did you rebuild?

swift flower
#

yeah

cold moon
#

Do you have config.yml?

swift flower
#

yep

cold moon
#

Can you show section there about site URLs?

swift flower
#

sure

short snow
#

if we are getting response from api, then the urls are correct right?

gritty wind
#

Actually, can you print the token at that point

swift flower
#

at urls?

swift flower
gritty wind
#

so line 14 of __main__,

print(constants.Keys.site_api)```
gritty wind
#

different constant this time haha

short snow
#

πŸ˜› yes

swift flower
#

Okay

#

c9f2b5322248ebfe2c95ed6d67..........

gritty wind
#

so it didn't update

#

do you have that in your config file

short snow
#

i don't think you have rbuilt your image

gritty wind
#

specifically line 337

swift flower
#

i dont think so i only had it in my .env but i changed it

short snow
swift flower
#

i've been running that haha

short snow
#

hmmm, is it in the config.yml like scal said?

swift flower
#

nope

short snow
#

hmm, sure?

gritty wind
swift flower
#

i will do a search of the file for the specific ID and see if theres any results

gritty wind
#

the only thing I can think of now is taking down the bot container, deleting the image, and rebuilding

short snow
#

another thing to proove if rebuild works was, check the image in the var/ of root

#

and see if the .env is what you want

swift flower
#

shall i delete all the files?

short snow
#

no, not delete

#

which os?

swift flower
#

Ubuntu 18:04

short snow
#
freeCodeCamp.org

Docker has been widely adopted and is used to run and scale applications in production. Additionally, it can be used to start applications quickly by executing a single Docker command. Companies also are investing more and more effort into improving development in local and remote Docker containers, which comes with

#

and see if the .env and config.yml is what you want

swift flower
#

do you know what directory it'll be in? @short snow

containers
image
network
overlay2
plugins
runtimes
swarm
tmp
trust
volumes```
short snow
#

images

swift flower
#

where do i go from there?

short snow
#

do docker image inspect bot in the directory of bot/ then you can you can cd into the path of WorkDir

swift flower
#

Error: No such image: bot

short snow
#

i did a system prune earlier this week, so the images are building, can cross check once done

#

do docker-compose ps

swift flower
#

yeah

#

it doesnt show it

cold moon
#

docker-compose rm and then docker-compose up --rebuild

short snow
#

ok docker-compose up

swift flower
#

it just tells me the options

#

when i do --rebuild

swift flower
short snow
#

uhh, this is getting confusing, show the screenshot

swift flower
short snow
#

show the output of pwd

swift flower
#

/mnt/disks/bkp/root/discord/bot

short snow
#

ok

#

no idea here, i get the output as:

swift flower
#

alright guess what @short snow

#

i git cloned the repo

#

and now it works

#

the bot is online

#

i just need to change the IDs now

short snow
#

cool

#

change the ids

swift flower
#

will i have to rebuild after changing the IDs

#

last time i did this i changed the IDs correctly and the bot stopped working XD

short snow
#

yeah, you would need to rebuild

#

just do docker-compose up bot

#

uhh, something happened to mine now πŸ€¦β€β™‚οΈ

swift flower
#

use_fakeredis: true @short snow

short snow
#

yeah, got it working

#

why should fakeredis be true tho?

vocal prairie
#

Because they aren't using redis…

short snow
#

ik, but reason for that

sleek steppe
#

Maybe redis wasn't running?

short snow
#

redis was running, its state is Up

swift flower
#

is there an easy way to get the emojis

#

to put them in the test server

vocal prairie
short snow
#

currently no,

#

there couldddd be a test server for non staff people, we ppl can make it if itt is fine

vocal prairie
#

I have one already.

short snow
#

i ahve one with all emojis, so anything is fine

swift flower
#

#bot-commands

vocal prairie
#

Oh, I don't have all the emojis in mine yet.

short snow
#

get the link, by right clicking on the emoji

vocal prairie
#

Yeah ik.

short snow
#

telling it to 60x

#

i can dm the test server invite, if anyone needs it

vocal prairie
#

Can you dm it to me?

swift flower
#

pls

#

can you zip me all of the emojis

#

I dm'd you jason

short snow
#

got away from pc, will run a eval command once back and send you them 60x

fallen patrol
swift flower
#

!user @swift flower

stable mountainBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

placid ermine
#

what would it be like to have a latex command for @dusky shore?

#

there are some math questions in the ot channels once in a while

thorny obsidian
#

I'd love it. There miiiight be an issue for it? My memory is failing me

patent pivot
#

I like that idea

#

I wonder if we could do something neater than an API it'd be cool

placid ermine
thorny obsidian
#

katex, katex, katex, katex

patent pivot
#

katex is javascript

thorny obsidian
#

I mean.... I know. But it's real good

patent pivot
#

lul

#

matplotlib seems to be able to do it

placid ermine
patent pivot
#

iiiinteresting

#

but only PDF support

gritty wind
#

I’d write a JavaScript transpiler πŸ‘€

#

Just say the words

vocal prairie
#

That would actually be a really fun project.

magic arch
#

Oh I know a super easy latex api, lemme see if I can find it really quick

#

I'm sure there are better options out there but that's something I've used in a hurry before

short snow
#

Oh nice, I was implementing it for my school server, can make one here too if no one else wants to

#

@obsidian patio was working on one iirc

obsidian patio
#

A latex API?

#

I’ve looked into making such a command in the past, but not an API for it. I think there was something available, but I’m not sure about licensing

short snow
#

There is already a api for it

#

No need to make one

obsidian patio
#

Not sure what you mean I was working on, then

patent pivot
#

If we can implement it without an API I think that would be nice

short snow
#

I saw you were making a latex command on the tile set server

patent pivot
#

I've said this before but the less we can make lancebot dependent on external APIs, or at least minimise the usage, the more educational of a resource it is

placid ermine
#

yeahhhhhhh

#

but as far as latex goes
the rendering itself would probably be delegated to some dependency nonetheless

short snow
#

Hmm, I will see if I can find a way without API, I use the api as of now.

placid ermine
#

rendering latex from scratch
would be
well
hellish

sleek steppe
#

That seems off topic...

green oriole
#

Hello @turbid cedar, please don't post your form in random channels. Feel free to post it once in off-topic though!

gritty wind
#

Which project is this, and what do you have in your config

green oriole
#

I believe you have to change the ownership of your Docker socket

#

Linux, right?

gritty wind
#

Also why is it using an outdated python version

green oriole
#

Yeah I am just blind

#

That's the system python where docker-compose is installed scal

#

That's a compose internal error

#

Formatted in an awesome way

gritty wind
#

Ah, makes sense

#

Good luck then lol

green oriole
#

sudo chown $USER /var/run/docker

#

Can you try this command @sly trellis?

#

Does it work now?

#

Hmm

#

What does ls -la /var/run | grep docker gives you?

#

Does ls /var/run/docker gives you anything?

green oriole
#

Hmmmmmm

#

What does echo $USER gives you @sly trellis?

fallen patrol
#

what rpi fwiw?

placid ermine
#

like

#

it looks like it can use latex for the titles and axis labels and such

#

but
using it just for rendering latex looks kinda hacky-ish

patent pivot
#

hah, I believe you

green oriole
#

Hmm that's weird. Is Docker running? (systemctl status docker)

#

Alright let's try

sudo usermod -a -G docker $USER
sudo chown docker /var/run/docker
#

Hmm try with root instead of docker

#

Alright, does it work now?

#

Hmm I'm not sure, sorry

clever wraith
#

Hey @patent pivot , I reviewed your pr for switching to poetry and everything looks good, except the use of taskipy. Everything taskipy is doing can be done using vanilla poetry. Is there a specific reason for using taskipy?

patent pivot
#

It can't be done with vanilla poetry

#

so

gritty wind
#

I left a comment πŸ‘€

patent pivot
#

the task that taskipi accomplishes is allowing running of arbitrary shell commands

#

and SCALEIOS stop stealing stuff from me

gritty wind
#

smh we have timestamps

clever wraith
patent pivot
#

uhhhh

#

there is a PR

patent pivot
#

the commands get long and unrememberable fast

gritty wind
patent pivot
#

so while possible, taskipy basically is an alias system for longer commands

clever wraith
#

Ahhh

gritty wind
#

if you were to get something like a lint command:

my-script = "flake8"
#

it would error out with:

  at c:\python\python39\lib\site-packages\poetry\console\commands\run.py:36 in run_script
      32β”‚     def run_script(self, script, args):
      33β”‚         if isinstance(script, dict):
      34β”‚             script = script["callable"]
      35β”‚
    β†’ 36β”‚         module, callable_ = script.split(":")
      37β”‚
      38β”‚         src_in_sys_path = "sys.path.append('src'); " if self._module.is_in_src() else ""
      39β”‚
      40β”‚         cmd = ["python", "-c"]
clever wraith
#

Huh

#

I see

#

I didn't know that poetry's custom scripts worked like that, sorry

gritty wind
#

Nah it's alright

patent pivot
#

no worries!

clever wraith
#

Sorry for the ping joe

patent pivot
#

all good again πŸ™‚ always happy to be pinged about things like this

clever wraith
#

It seems like such an easy thing to fix on poetrys side...

patent pivot
#

the reason they haven't is basically because they recommend things like this be adopted through third party plugin scripts, such as taskipy

clever wraith
#

Ah

patent pivot
#

which in fairness, taskipy isn't all that bad of a solution, it means that when you enter the venv you can still run such scripts by just doing ```bash
$ task lint

and so on, which is a pretty neat feature
clever wraith
#

It is pretty cool, yeah

gritty wind
#

does poetry support using the activated venv

#

I know pipenv does, albeit with a snarky comment

patent pivot
#

yeah

#

poetry shell

clever wraith
#

I think you can just poetry shell

gritty wind
#

I'm thinking more along the lines of

#

source ./venv/activate
poetry ..

#

would that use the activated venv

clever wraith
#

I think so

#

I don't often use poetry

patent pivot
#

hmmm

clever wraith
#

Poetry does create the venv, so in theory you should be able to

gritty wind
#

well, what I don't know is will it use this venv that I'm using, which is not it's own venv, or will it still try to create its own

#

The same thing in pipenv would output:

patent pivot
#

yeah

#

it installs to the activated venv

gritty wind
#

hm? what's the output of pip list

patent pivot
gritty wind
#

ah nice

clever wraith
#

Damn nice terminal joe

patent pivot
patent pivot
gritty wind
patent pivot
#

lol

magic arch
#

Hey @patent pivot quick question for ya, should we use the US or UK version of the YouTube terms for !ytdl? (bot#1509) They're not much different it's just minor wording differences but yeah lol

dusky shoreBOT
patent pivot
#

hmmmm

#

which one do we use right now

magic arch
#

UK I think

clever wraith
#

I'd just stay with UK personally but that's Joe's territory πŸ˜„

patent pivot
#

might be easier to stick with what we have yeah, but I don't really think it matters at all

magic arch
#

Alright, in that case I'll just update the link so it's always pointing to the UK version and switch back the wording to what it was

#

Thanks a bunch

sleek steppe
#

Am I reviewing too much? πŸ˜…

fallen patrol
#

what happened to #dev-bug-bounty

patent pivot
patent pivot
fallen patrol
#

smh

#

where is the changelog

#

there was one to open it but not one to close it

patent pivot
#

we broached the topic and felt it wasn't really necessary, we might drop a note in #dev-announcements though

fallen patrol
#

:facesad:

short snow
#

show the errors

vocal prairie
#

Did you run pipenv sync --dev?

short snow
#

try running that ^

sleek steppe
#

@short snow What's the difference between partial(x) and x?

short snow
#

partial(x) is like a wrapper around x, while x would make a "copy" of the function

sleek steppe
#

I don't see why you need to copy it though.

tawdry vapor
#

You're trying to run it on a raspberry pi, right?

#

Some dependencies don't publish wheels for ARM, meaning the packages have to be compiled from source. However, our container doesn't include a compiler (cause our production server doesn't use ARM and therefore doesn't need a compiler).

#

If you want to run it with Docker on ARM then you'll need to modify the Dockerfile to include gcc. Alternatively, you could just run the bot directly on the host, which presumably does have a compiler.

#

You can selectively start services with Docker. For example, you could run the site, db, and redis with Docker but run the bot on the host.

short snow
#

Could some staf review this hotfix

#

quackstack#29

#

uh

vocal prairie
fervent sage
#

yes please kek

#

the bug is currently breaking the /duck endpoint which is half the api lmao

sleek steppe
#

why doesn't quackstack#29 work thonk

fervent sage
#

quaclstake

vocal prairie
fervent sage
#

does quackstack#2 work

#

nop

#

thonk

sleek steppe
#

oof

fervent sage
#

i got u

patent pivot
#

I should open an issue on quackstack to migrate image code to push to a bucket somewhere

#

hmmmm

#

!remind 12h that

stable mountainBOT
#
You're the boss!

Your reminder will arrive in 12 hours!

fervent sage
#

approve my pr first mmLol

patent pivot
#

lol which pr

#

ah i see

fervent sage
sleek steppe
#

#29

fervent sage
#

the one that fixes prod being broken kek

#

ok production ducks working soonℒ️

sleek steppe
#

I don't see why quackstack#29 doesn't work thonk

fervent sage
#

the funny bit is that manducks were never broken because of course they're still just handled internally

short snow
#

no idea, the repos aren't hardcoded, so they should wokr

#

vco is fast pydis_snake

vocal prairie
fervent sage
#

i just watched all of the netflix "day in the life of a netflix engineer" videos on youtube and am experiencing a craving for devops and ci/cd

#

watching this is making me very happy

sleek steppe
vocal prairie
fervent sage
#

yay we're no longer server erroring

short snow
short snow
sleek steppe
#

wait wrong long link

patent pivot
#

because

#

github paginates at 30

#

this makes sense yeah

fervent sage
#

sad quackstack noises

patent pivot
fervent sage
#

ill open an issue about fixing that

patent pivot
#

it's entry 35 on that list

sleek steppe
#

ic

fervent sage
#

actually should i just PR it since its such a simple fix

vocal prairie
#

Yeah, that's probably better.

short snow
#

yeah

sleek steppe
#

maybe use /users since it's shorter lol

patent pivot
#

users is hacky

#

we should use orgs

vocal prairie
#

Agreed.

patent pivot
#

i am bed now goodnight

vocal prairie
#

We are an org, not a user.

#

Good night joe!

fervent sage
#

hi bed now goodnight

#

okie, sir-lancebot#662 should resolve the quackstack issue

tawdry vapor
#

add a line that installs gcc with apt

fallen patrol
#

hm

#

media-branding#1

fallen patrol
#

oh okay

#

it gets every repo on python discord

vocal prairie
#

That's cool.

#

quackstack#29

#

@fallen patrol Um

fallen patrol
vocal prairie
#

What about quackstack?

vocal prairie
#

Oh, that wasn't approved yet?

fallen patrol
#

no

#

its the github api pagnation

vocal prairie
#

I see.

placid ermine
#

so i messed around some more with matplotlib's latex

#

and it's not looking too bad

#

small demo

#

pretty cool imo

green oriole
#

What is that all about?

#

LaTex command?

placid ermine
#

yes

green oriole
#

Cool

short snow
#

it would be better to open a issue and get assigned to it

placid ermine
#

yeah

#

writing it out now

#

done

timid sentinel
#

My main question for a latex command would be: is it safe to render untrusted latex input with no sort of sandboxing?

placid ermine
#

hmm

green oriole
#

We should have a timeout for sure

timid sentinel
#

seems it may allow file read/write by default as well, so may require some other configuration also

short snow
#

@green oriole There are still a number of icon_url present in fetch issues, when the emojis are assigned to it

#

and it isn't a url, so not sure, if emoji_url fits too, could be issue_emoji or just emoji

green oriole
#

Indeed

whole forge
green oriole
#

Will just go for emoji

timid sentinel
whole forge
# timid sentinel mmm, that would be pretty cool, although I reckon it would be pretty difficult t...

i didnt know how matplotlib renders it, looking it up apparently it does use a default latex renderer

Matplotlib’s LaTeX support requires a working LaTeX installation, dvipng (which may be included with your LaTeX installation), and Ghostscript (GPL Ghostscript 8.60 or later is recommended). The executables for these external dependencies must all be located on your PATH.
thats gonna be pretty impossible then. oof.

placid ermine
#

(in any case we could always fall back to an external API as a last resort)

green oriole
#

Doing rendering in another thread that we can kill after a few seconds and limiting disk access through configuration sounds like the way to go

gritty wind
green oriole
#

another microservice?

cold moon
#

New service

placid ermine
#

bruh what

#

proceeds to change "I'd like to implement this feature myself" to "Anyone can implement this feature"

whole forge
#

soon we will have about a few thousand microservices running, and achieved unlimited scalability.

green oriole
#

Nah there is just a running gag saying that we can't refuse a new project neither not rewrite something

#

Which... isn't totally false

placid ermine
#

looks like sympy can also do latex with sympy.preview

#

im kinda confused

#

what does matplotlib rendering engine mean then

#

doesn't matplotlib also rely on having latex installed

#

hmm

You can use a subset TeX markup in any matplotlib text string by placing it inside a pair of dollar signs ($).

Note that you do not need to have TeX installed, since matplotlib ships its own TeX expression parser, layout engine and fonts.

vocal prairie
placid ermine
#

will have to research some more about whether this subset also allows file read/write

#

if it doesn't it'd be a great relief

#

if it does

#

sigh

#

more research

placid ermine
#

alright
im fairly sure the only thing this allows is symbols, nothing more nothing less

#

now
as for writing to disk
i don't know if matplotlib does that internally, but the final image itself doesn't really have to be written to disk, we could just save it to a BytesIO object

#

should i start working on the dpy boilerplate πŸ€”

placid ermine
#

i'll just wait till i get assigned πŸ₯΄

thorny obsidian
placid ermine
thorny obsidian
#

assigned! go go goooo

placid ermine
#

aaaaaa

#

dear lord that's a lot of cogs

short snow
vocal prairie
#

Sir Lancebot is pretty popular. 🀷

vale ibex
#

That's just the evergreen folder too πŸ˜›

short snow
#

also, if you want a test server let me know, few of us have set up one

sleek steppe
placid ermine
#

am i going to be hit by 70 log messages when i run the bot lol

#

70+

sleek steppe
#

more

placid ermine
#

lol

whole forge
#

70 a second maybe

#

(will slow down after a bit)

sleek steppe
#

What's the right link for snekbox? Currently http://127.0.0.1:8060/eval isn't working.

short snow
#

everything dockerized?

#

http://snekbox:8060/eval it should be this

sleek steppe
#

I'll try that

#

Ok it works now

stable mountainBOT
#

@patent pivot

It has arrived!

Here's your reminder: that.
[Jump back to when you created the reminder](#dev-contrib message)

short snow
placid ermine
#

re the latex command, should the bot respond to all messages containing $text$, or should the command have to be specifically invoked?

patent pivot
#

specifically invoked

#

imo

placid ermine
#

neat

#

using on_message just feels... dirty

fallen patrol
#

yo

#

i would like to get my first issue even if its just a line

#

or just go directly to a pr

#
  - If you could have any superpower, what would it be?
- - Name one thing you like about a person to your right.
  - If you could be anyone else for one day, who would it be?
sleek steppe
#

Do people want to remove it tho?

brazen charm
#

Has it been discussed somewhere?

fallen patrol
#

it constantly gets shuned

#

because there is literally no one to any of our rights

#

ever, we're on discord

#

it would make more sense to be Name one thing you like about the last person to send a message.

#

or just completely remove it

cold island
#

You can't go wrong by opening an issue first

vocal prairie
sleek steppe
clever wraith
clever wraith
#

Invite*

vocal prairie
clever wraith
#

Thanks!!

fallen patrol
#

sir-lancebot#664

magic arch
#

Thanks Jay

patent pivot
fallen patrol
#

Β―_(ツ)_/Β―

patent pivot
#

I guess that's true, but I think that the reason we have issues is to avoid people doing too much work before we discuss implementation and approve issues, and reduces review time in time. A one line fix isn't really a huge amount of work

fallen patrol
#

yeah

#

and its not even a code change πŸ˜‚

#

i'll make a pr soon imma about to go to lunch

patent pivot
#

Exactly, which is why I personally wouldn't encourage issues like this, since it simply pollutes the issue search

fallen patrol
#

ah okay

#

well

#

I asked and ppl said yes so

#

tell them

patent pivot
#

I'll probably just delete the issue after the change is implemented

fallen patrol
#

lol ok

cold moon
#

Isn't closing enough?

vocal prairie
#

Joe doesn't want to clutter up issue search.

patent pivot
#

yeah I'm just not sure issues for such trivial changes are worth it

#

I will prod Xith about it since it's his domain