Live data from Hacker News

A ChatGPT mistake cost us $10k

asim.bearblog.dev

211–220 of 526 posts

Re: A ChatGPT mistake cost us $10k

#212
post #5

On one hand, thanks for being honest about a story of how this bug came to be. On the other hand, I don’t think advertising the fact that the company introduced a major bug from copy and pasting ChatGPT code around and that they spent a week being unable to even debug why it was failing. I don’t know much about this startup, but this blog post had the opposite effect of all of the other high quality post-mortem posts…

It read like no one really knew what they were doing. "We just let it generate the code and everything seemed to work" is certainly not a good way to market your company.

> We just let it generate the code and everything seemed to work

Everyone using C++20 compilers: side-glancing monkey.

Re: A ChatGPT mistake cost us $10k

#213

Earlier quoted context omitted.

> I don't think this is indicative of people who don't know what they're doing. I think this is indicative of people using "AI" tools to help with programming at all. I think using AI tools to write production code is probably indicative of people who don't really know what they are doing. The best way not to have subtle bugs is to think deeply about your code, not subcontract it out -- whether that is to people far…

> I think using AI tools to write production code is probably indicative of people who don't really know what they are doing. People said the same to me for using Microsoft IntelliSense 20 years ago. AI tools for programming are absolutely the future.

But not the now, quite obviously.

Colour me cynical but I don't feel like pretending the future is here only to have to have to fix its blind incompetence.

Re: A ChatGPT mistake cost us $10k

#214
post #137

Earlier quoted context omitted.

> I don't think this is indicative of people who don't know what they're doing. I think this is indicative of people using "AI" tools to help with programming at all. I think using AI tools to write production code is probably indicative of people who don't really know what they are doing. The best way not to have subtle bugs is to think deeply about your code, not subcontract it out -- whether that is to people far…

> And where is the benefit in doing this repeatedly? You're just going to end up with a codebase nobody really owns on a cognitive level. You could say the same about the output of a compiler. No one owns that at a cognitive level. They own it at a higher level - the source code. Same thing here. You own the output of the AI at a cognitive level, because you own the prompts that created it.

>No one owns that at a cognitive level

Notwithstanding the fact that compilers did not fall out of the sky and very much have people that own them at the cognitive level, I think this is still a different situation.

With a compiler you can expect a more or less one to one translation between source code and the operation of the resulting binary with some optimizations. When some compiler optimization causes undesired behavior, this too is a very difficult problem to solve.

Intentionally 10xing this type of problem by introducing a fuzzy translation between human language and source code then 1000xing it by repeating it all over the codebase just seems like a bad decision.

Re: A ChatGPT mistake cost us $10k

#215

Earlier quoted context omitted.

They spent 5 days. The bug type is pretty common and could easily be done by a developer. (It's a similar class to the singleton default argument issue that many people complain about) Meh, I don't mind the cautionary tale and don't think chatgpt was even relevant. It's actually a tricky bug, because usual tests wouldn't catch it (db wiped for good isolation) and many ways of manual testing would restart the service…

looking at the query logs for the nighttime period should have made the bug fairly obvious

They even said they had sentry set up.. they'd notice the duplicate key error immediately.

Re: A ChatGPT mistake cost us $10k

#216
I made a bug like this once where a database default was set to a value evaluated at runtime instead of on every insert. Oops

However, luckily in my case, it was caught immediately in the staging env since collisions caused exceptions.

Realizing when an expression is evaluated is pretty easy to miss. That code is probably live somewhere else right now surreptitiously causing issues.

Re: A ChatGPT mistake cost us $10k

#217
post #5

On one hand, thanks for being honest about a story of how this bug came to be. On the other hand, I don’t think advertising the fact that the company introduced a major bug from copy and pasting ChatGPT code around and that they spent a week being unable to even debug why it was failing. I don’t know much about this startup, but this blog post had the opposite effect of all of the other high quality post-mortem posts…

They spent 5 days. The bug type is pretty common and could easily be done by a developer. (It's a similar class to the singleton default argument issue that many people complain about) Meh, I don't mind the cautionary tale and don't think chatgpt was even relevant. It's actually a tricky bug, because usual tests wouldn't catch it (db wiped for good isolation) and many ways of manual testing would restart the service…

A functioning dev env would have caught this if they manually tested more than once. Typically you dont run 40 dev instances. Or a staging environment.

Re: A ChatGPT mistake cost us $10k

#218
post #137

Earlier quoted context omitted.

> And where is the benefit in doing this repeatedly? You're just going to end up with a codebase nobody really owns on a cognitive level. You could say the same about the output of a compiler. No one owns that at a cognitive level. They own it at a higher level - the source code. Same thing here. You own the output of the AI at a cognitive level, because you own the prompts that created it.

>No one owns that at a cognitive level Notwithstanding the fact that compilers did not fall out of the sky and very much have people that own them at the cognitive level, I think this is still a different situation. With a compiler you can expect a more or less one to one translation between source code and the operation of the resulting binary with some optimizations. When some compiler optimization causes undesired…

Right. I mean... I sometimes think that Webpack is a malign, inscrutable intelligence! :-)

But at least it's supposed to be deterministic. And there's a chance someone else will be able to explain the inner workings in a way I can repeatably test.

Re: A ChatGPT mistake cost us $10k

#219

Earlier quoted context omitted.

I was wondering that too. Why wouldn’t the error be in the logs?

Guess: the logs were on an ec2 instance that was thrown away regularly, and the overnight reports didn't give reproduce steps or timestamps; so when they checked it "works fine". There's value in having your backtrace surfaced to end users rather than swallowing an exception and displaying "didn't work".

I don't think showing stack traces to users is good practice? Every time one of my users gets a didn't work message I log the stack trace instead.

Re: A ChatGPT mistake cost us $10k

#220

It is strange that this took 5 days to find. Simply because of logs. Go to logs. Filter by errors. Oh, errors in insert subscription. Seems relevant. I could understand if the errors were somewhere else. Even if logs didn't exist. Problematic endpoint generating 50 emails per day? I would have immediately thrown a try catch and rendered the error to the user if logging was impossible. Then your very next bug report s…

ChatGPT gives the following: The code snippet has a subtle but significant issue in the default value of the id column. Here is the problematic part: ... In this line, default=str(uuid.uuid4()) is evaluated only once at the time of the class definition, not each time a new StripeCustomer instance is created....

Presumably that's easy enough given just the snippet in question, but they hadn't narrowed the issue down to that snippet because they had no idea it was happening on the user creation, because they didn't have the logs.

I expect ChatGPT wouldn't have been able to solve the issue given the entire codebase.

Post reply on HN