might jump back on the "trying to run my personal websites through docker" thing. i guess. maybe

can't actually be bothered but i was thinking about maybe doing something new on there & i don't want to be held back by the old sites running on old versions of things on the same server

doing a bit of housekeeping on the existing code first. like trying to get rid of php short open tags. i used to use those a lot

Okay I got too into all this and it has become 2:30am whoops
Made pretty good progress though. I had a big list of todos and problems and questions from last time & I've got through all of them except for some PHP extensions I still need to install
Then if that all works I can try it on the actual server.....

was looking into how much free space i have on my VPS before i do all this & found that i'm using like half the 40GB available
and of that like 4GB was /var/log/journal so i configured it to use max 100MB because i never checked those logs in my life?
another 4GB ibdata1 in mysql which .......apparently is mostly accounted for by my notes wiki db WHY there's barely shit in there

oh christ it's from when i had open talk pages and they got spammed to shit & its stored thousands of revisions of megabytes of fucking spam in the database

so i ran a mediawiki script to purge the deleted revisions, which worked
but that script then runs another script to purge orphaned text records (which are the thing that is actually taking up the space) and that... did nothing
cool cool thanks

I Think what happened was the first script purged the references to the revisions in the "archive" table, meanwhile the second script is looking for references in the "content" table which was not actually touched by the first script
so uhhhhh I guess I can try and identify orphaned content entries myself and delete them and then run the second script and hope I don't fuck everything up

How did I even get here this has nothing to fucking do with Docker

OK so what I figured out is that revisions are linked to content by the "slots" table, and the "slots" table suspiciously has 2888 entries referencing nonexistent revision ids, which is the exact same number of archived revisions that were purged
So I THINK I should be safe to delete those slots and Then delete the content entries corresponding to those slots and Then delete the text entries corresponding to the content entries

Sorry for posting through this btw

well my internet went down but i'm tethering off my phone to fucking finish this
I deleted all those orphaned slots/content entries and ran the script. the script actually found the orphaned text this time but threw an error when trying to delete it. so I ran another sql query to delete the text
THAT failed cos it ran out of space while trying to write a temp file so I'm now doing them 100 at a time

We did it gamers. Deleted all the spam text. And how much space has that gained me? fuck all!!!!! because InnoDB will never give you space back once it's used it, if you have the "file per table" setting turned off (which is the default) it just dumps everything into that fucking ibdata file which can never get any smaller. The only thing you can do from here apparently is to dump all the DBs, wipe the whole thing and reimport them. I'm going to fucking bed

Tried a few possible solutions for reclaiming the space without recreating the whole DB. None of them worked. Piss

I also found that "file per table" was actually ON but for that particular table it doesn't create a file for it, even if I dump and reimport the table? hello???
once again I'm going to fucking bed

Realised why that was happening, the table dump actually had TABLESPACE `innodb_system` in it, which caused the reimported table to always go in the massive ibdata file. Have converted everything to file per table properly now. But that was still kind of a futile exercise considering theres still no way to shrink ibdata without dumping, deleting and recreating all the databases. And I'm just not gonna do that until I fucking need to because I have plenty of space for docker atm

so...i got docker installed on the server... got my container up and running... web server pointed at it... all that worked fine

the new and cool problem i now face is that it's unable to connect to the mysql server on the host, despite this working fine for me locally. it doesn't even fail in a useful way either, it just times out. if i ping the hostname that's supposed to map to the host's internal network, it responds fine. but doesn't respond for mysql

going to fucking bed again

This seems bad??!?!? I very nearly misconfigured my container in a way that would have accidentally left a port exposed, but I thought "oh well it wouldn't have been _too_ bad cos the firewall would block it anyway", but apparently, no, docker just says Fuck your firewall

I still can't resolve this mysql issue though. So like for background I have extra_hosts: - "host.docker.internal:host-gateway"
configured in my docker-compose file & that's supposed to map the host machine's internal network to the hostname docker.internal.host inside the container
And that works, for some things, e.g. I can ping it, I can connect to its web server port. But not for mysql! It just times out! I don't know how to debug this!!!!

@lion how are you running mysql, are you using one of the existing docker images for it?

i ask bc i know i've had a lot of confusion before when trying to set up mysql manually because sometimes it just doesn't bother with the whole networking thing

@Ninji nah i'm not running mysql through docker at all, it's just an existing setup on the host machine, i'm trying to connect to that from inside the container

@lion when you connect to it outside of docker, do you know for sure that it's accepting connections over TCP and not just using the unix socket?

@lion i don't have a running instance to check this against, but a good first step might be to just try `telnet localhost 3306` and see what happens

if it's refused or timed out then that's a good sign something is probably sus

check that you don't have 'skip-networking' in the server's config file, also

Follow

@Ninji that did work yeah - but I also realised i need to actually let the container connect through the firewall & I'm getting somewhere now :bunhdthink:

like i'm now at the point of getting normal mysql access denied errors, i can work with this

@lion ah, excellent

check your privileges - usually mysql grants have a user *and* host assigned, so if it's something like 'taizou@localhost' or whatever then that might fail

@Ninji Yeah I did indeed have to do that
and it works!!!!!!! thanks for your help

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!