Live data from Hacker News

A ChatGPT mistake cost us $10k

asim.bearblog.dev

511–520 of 526 posts

Re: A ChatGPT mistake cost us $10k

#511
post #509

Earlier quoted context omitted.

> it's collocating the idea of setup and cleanup together. Okay, sure, but Rollback is the cleanup function. You always want to rollback – you only sometimes want to commit. I suppose this confirms that someone got their logic mixed up.

> You always want to rollback This phrase highlights the confusion. If you learned SQL before Go, you want to rollback only on error. Every time I write `defer tx.Rollback()`, I cringe and have to remind myself that yes, it's actually ok to call a method called `Rollback` after succesfully writing data.

[deleted]

Re: A ChatGPT mistake cost us $10k

#512
post #19
post #2

Thanks for telling. Bookmarked for the next time we're told ChatGPT's code error rate is acceptable because we review its code just like an intern's.

If you're treating ChatGPT code differently than your interns' code, you're going to miss some serious issues regardless of which one isn't under a spotlight. I had to fix some intern code once, and… well, I can't give too many details, but I will say that an FAQ shouldn't consist entirely of quotations from a TV show from a different country in a language the app doesn't support.

[deleted]

Re: A ChatGPT mistake cost us $10k

#513

No, a lack of monitoring cost you $10K. Your app was throwing a database exception and nobody was alerted that this was not only happening, but happening continuously and in large volumes. Such an alert would have made this a 5-minute investigation rather than 5 days. If you haven't fixed that alerting deficiency, then you haven't really fixed anything.

Right? The log message would have said the id isn't unique, and then it would have taken much less time to debug this problem. Programming when everything works is easy, it's handling the problems that makes it hard.

Are you guys able to read this post? When I visit the OP post, I see only this text:

"Under construction "

Looks like the OP removed the post?

EDIT: Found archived copy of post: http://web.archive.org/web/20240609213809/https://asim.bearb...

Re: A ChatGPT mistake cost us $10k

#514
post #509

Earlier quoted context omitted.

> it's collocating the idea of setup and cleanup together. Okay, sure, but Rollback is the cleanup function. You always want to rollback – you only sometimes want to commit. I suppose this confirms that someone got their logic mixed up.

> You always want to rollback This phrase highlights the confusion. If you learned SQL before Go, you want to rollback only on error. Every time I write `defer tx.Rollback()`, I cringe and have to remind myself that yes, it's actually ok to call a method called `Rollback` after succesfully writing data.

If you learned SQL before Go, you'd know the pattern works just fine and is arguably a good sanity check.

    BEGIN;
    INSERT INTO ...
    COMMIT;
    ROLLBACK;
It is not some kind of Go-ism. The Go database/sql package actually executes ROLLBACK in the SQL engine. Check out the error returned by it.

Perhaps you mean learned SQL in the context of languages that consider a failed rollback an exception? In that case one needs to be careful to not rollback, else be stricken to handling the exception, which programmers seem to hate doing.

Re: A ChatGPT mistake cost us $10k

#515
post #509

Earlier quoted context omitted.

> You always want to rollback This phrase highlights the confusion. If you learned SQL before Go, you want to rollback only on error. Every time I write `defer tx.Rollback()`, I cringe and have to remind myself that yes, it's actually ok to call a method called `Rollback` after succesfully writing data.

If you learned SQL before Go, you'd know the pattern works just fine and is arguably a good sanity check. BEGIN; INSERT INTO ... COMMIT; ROLLBACK; It is not some kind of Go-ism. The Go database/sql package actually executes ROLLBACK in the SQL engine. Check out the error returned by it. Perhaps you mean learned SQL in the context of languages that consider a failed rollback an exception? In that case one needs to be…

> The Go database/sql package actually executes ROLLBACK in the SQL engine.

No: https://github.com/golang/go/blob/beaf7f3282c2548267d3c89441...

Re: A ChatGPT mistake cost us $10k

#516
post #515

Earlier quoted context omitted.

If you learned SQL before Go, you'd know the pattern works just fine and is arguably a good sanity check. BEGIN; INSERT INTO ... COMMIT; ROLLBACK; It is not some kind of Go-ism. The Go database/sql package actually executes ROLLBACK in the SQL engine. Check out the error returned by it. Perhaps you mean learned SQL in the context of languages that consider a failed rollback an exception? In that case one needs to be…

> The Go database/sql package actually executes ROLLBACK in the SQL engine. No: https://github.com/golang/go/blob/beaf7f3282c2548267d3c89441...

Fair enough, although it wouldn't matter if it did. Nothing would change other than some unnecessary computation would occur. SQL supports it just fine. Anyone who learned SQL first would know that quite well.

Re: A ChatGPT mistake cost us $10k

#517
post #515

Earlier quoted context omitted.

> The Go database/sql package actually executes ROLLBACK in the SQL engine. No: https://github.com/golang/go/blob/beaf7f3282c2548267d3c89441...

Fair enough, although it wouldn't matter if it did. Nothing would change other than some unnecessary computation would occur. SQL supports it just fine. Anyone who learned SQL first would know that quite well.

Fair as well. It's just sending a command which you know will fail, and even relying on the fact it fails, feels wrong, whether it sends a request over network or not.

BTW I checked and it's not an error in Postgres, only a warning. Still not something I would want in my database logs for the happy path.

Re: A ChatGPT mistake cost us $10k

#518
post #517

Earlier quoted context omitted.

Fair enough, although it wouldn't matter if it did. Nothing would change other than some unnecessary computation would occur. SQL supports it just fine. Anyone who learned SQL first would know that quite well.

Fair as well. It's just sending a command which you know will fail, and even relying on the fact it fails, feels wrong, whether it sends a request over network or not. BTW I checked and it's not an error in Postgres, only a warning. Still not something I would want in my database logs for the happy path.

You know it will fail if you didn't screw up anything else.

But it's a good sanity check/safety measure to call it anyway incase you made a mistake elsewhere. An errant rollback is more likely to be caught in testing than a dangling transaction.

Re: A ChatGPT mistake cost us $10k

#519

Earlier quoted context omitted.

FWIW, we host on Cloudflare and use their API to resize images on the fly and we're fine. Not so much a "lock-in" if other vendors can fill-in, is it?

What API do you use to resize images? Cloudflare? I know Vercel and NextJS have an resizing/optimization component that gets pricy.

Yes, Cloudflare through the `loader` prop in `Image` component.

See CF docs for what the url should be https://developers.cloudflare.com/images/transform-images/tr... Next.js docs should tell you how to write the loader

Re: A ChatGPT mistake cost us $10k

#520

Earlier quoted context omitted.

It's not some innocent mistake. The title is purposefully clickbait / keyword-y, implying that it was chatgpt that made the 'mistake' for SEO and to generate panicked clicks. "We made a programming error in our use of an LLM, didn't do any QA, and it cost us $10k" doesn't generate the C-suite "oh shit what if ChatGPT fucks up, what's our exposure!?" reaction. There's a million middle and upper management posting this…

>By definition they're not capable of "mistakes" because nothing they generate is remotely guaranteed to be correct or accurate. This makes no sense. Only things that are guaranteed to be correct or accurate can make mistakes? Everyone knows what "mistake" means in this context. Nobody cares what your preferred definition of mistake is.

A good analogy would be nature: Is it making a mistake when something created by it fails in some way? Not really, since there's no conscious intent behind it and thus no correct or incorrect reasoning or a guarantee of either. LLMs share that trait.
Post reply on HN