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
ezdb - A one click script to quickly setting up a development database #75053
Conversation
Can a noob clone my branch and tell me if it works for them |
I've only had a cursory look through this but very neat. Some suggestions: You should say in EZDB.md that python is required. In It's not necessary but perhaps some handling for if the database's version is higher than the latest code version, I know this won't occur without someone messing around but it's happened to tg before so something like "you've messed up your versioning go fix that first". |
It shouldn't be, it |
Er yes, apparently i'd forgotten how |
i have skill of noob when it comes to DB stuff but i tested it out: The first round, a CMD prompt came up and I instinctually closed it out because it was capturing my keyboard inputs and because I didn't know what it was for: I didn't realize this was an issue until I did some more testing, and realized that the CMD prompt that I was getting was somehow critical to the functioning of ezdb - since I kept getting this runtime error whenever I closed out of that CMD prompt. [2023-05-03 00:27:38.884] Running /tg/ revision: 2023-04-30
- origin/master: fb60c65619b8f746a1d8a8761f37ef9f48ef2ef4
- HEAD: 128f5057311f3f66af4759c1de29a53cd0f87e52
[2023-05-03 00:27:41.124] runtime error: Failed to start DB daemon: -1.07374e+009
- (code/controllers/subsystem/dbcore.dm:467)
- proc name: stack trace (/proc/_stack_trace)
- source file: stack_trace.dm,4
- usr: (src)
- src: null
- call stack:
- stack trace("Failed to start DB daemon: -1....", "code/controllers/subsystem/dbc...", 467)
- Database (/datum/controller/subsystem/dbcore): start db daemon() In fact, closing out the CMD prompt at any time during the server's runtime (which is what some users might do either by accident or because they don't know why it's there) completely yonks the SQL operations with the following error: [2023-05-03 00:41:20.443] SQL: DriverError { Could not connect to address `localhost:1338': No connection could be made because the target machine actively refused it. (os error 10061) } | Query used:
- SELECT
- type,
- secret,
- id,
- IFNULL((SELECT byond_key FROM player WHERE ckey = adminckey), adminckey),
- text,
- timestamp,
- server,
- IFNULL((SELECT byond_key FROM player WHERE ckey = lasteditor), lasteditor),
- DATEDIFF(NOW(), timestamp),
- IFNULL((SELECT byond_key FROM player WHERE ckey = targetckey), targetckey),
- expire_timestamp,
- severity,
- playtime,
- round_id
- FROM messages
- WHERE type <> 'memo' AND targetckey = :targetckey AND deleted = 0 AND (expire_timestamp > NOW() OR expire_timestamp IS NULL)
- ORDER BY timestamp DESC
- | Arguments: {"targetckey":"san7890"}
I don't know if you get the same visible CMD prompt like I have been, but it seems to work fine on my machine other than that slight hiccup. |
i also kept getting this error whenever i was trying to add a note (is it a localhost thing?) but i think that's less ezdb's problem and more a problem on master (unless this doesn't happen for some reason with real databases), just noting it down now because it might cause issues with that aspect of testing adminny code [2023-05-03 00:39:27.662] SQL: MySqlError { ERROR 1048 (23000): Column 'ip' cannot be null } | Query used:
- INSERT INTO player (`ckey`, `byond_key`, `firstseen`, `firstseen_round_id`, `lastseen`, `lastseen_round_id`, `ip`, `computerid`, `lastadminrank`, `accountjoindate`)
- VALUES (:ckey, :key, Now(), :round_id, Now(), :round_id, INET_ATON(:ip), :computerid, :adminrank, :account_join_date)
- | Arguments: {"ckey":"san7890","key":"San7890","round_id":"5","ip":null,"computerid":"{CENSORED}","adminrank":"Game Master","account_join_date":null} resending this since i accidentally sent my CID whoops |
A command prompt really shouldn't be opening, and it's not for me. It's a daemon. I will look into it I suppose? Also yes that looks like a master bug. |
Still going to look into that just tired |
Yeah I don't get that at all =( I have no idea what to do about that |
mso gave me an ok enough idea to lean into the command bar so why not |
@san7890 Can you use the latest build? It doesn't fix the command prompt issue (I don't know why that happens or how to stop it) but tell me if you see the echo message that it gives you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, python was so snail-crawl speed at doing the url retrieve step of the install (I don't even know if it was working or not) but I just did some schenanigans and beyond that it worked fine (this is probably an issue with my machine and might not apply to the community at large)
however, for some odd reason it was just flashing the CMD prompt and auto-closing, and I was getting this runtime posting to config_error.log
. doing the debugger showed that it was crashing out at the shelleo call for whatever reason
[2023-05-15 02:53:25.382] SQL: Connect() failed | DriverError { Could not connect to address `localhost:1338': No connection could be made because the target machine actively refused it. (os error 10061) }
[2023-05-15 02:53:25.383] SQL: Your server failed to establish a connection with the database.
[2023-05-15 02:53:29.457] SQL: Connect() failed | DriverError { Could not connect to address `localhost:1338': No connection could be made because the target machine actively refused it. (os error 10061) }
HOWEVER, I was able to get it to work the way that one would expect by changing the shelleo to the suggestion enclosed with this review.
The shell message is different because I just wrote it from what it should be, and everything seems to be working as expected.
BTW, I figured out a surefire way to have the daemon show up (at least for me), and that's just running the same exe
you get in the DB_DAEMON
portion of the ezdb.txt
config file. That's what got it to show up for me outside of the game context, not sure if that would work for you though.
Well yeah if you run it directly but I can't do anything about that |
…elopment database (#5979) Original PR: tgstation/tgstation#75053 --- Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: san7890 <the@san7890.com>
tgstation#75053) https://user-images.githubusercontent.com/35135081/235344815-8e825ba9-52cf-44e8-b8e2-a2aeb5d47276.mp4 - Downloads a portable MariaDB (doesn't pollute your main system) - Sets up a database with a random password on port 1338 (configurable) - Installs the initial schema - Every time after, will run updates Major versions right now explicitly escape hatch, because those historically come with something like a Python script, and I do not want it to pretend to work. --------- Co-authored-by: san7890 <the@san7890.com>
…database (#1366) * ezdb - A one click script to quickly setting up a development database (tgstation#75053) https://user-images.githubusercontent.com/35135081/235344815-8e825ba9-52cf-44e8-b8e2-a2aeb5d47276.mp4 - Downloads a portable MariaDB (doesn't pollute your main system) - Sets up a database with a random password on port 1338 (configurable) - Installs the initial schema - Every time after, will run updates Major versions right now explicitly escape hatch, because those historically come with something like a Python script, and I do not want it to pretend to work. --------- Co-authored-by: san7890 <the@san7890.com> * Comment out /tg/ contributors from CODEOWNERS --------- Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: san7890 <the@san7890.com>
DiscordPTB_2023-04-30T02-00-28.mp4
Major versions right now explicitly escape hatch, because those historically come with something like a Python script, and I do not want it to pretend to work.