Skip to main content

CodeSOD: Going Crazy

2 months 2 weeks ago

For months, everything at Yusuf's company was fine. Then, suddenly, he comes in to the office to learn that overnight the log exploded with thousands of panic messages. No software changes had been pushed, no major configurations had happened- just a reboot. What had gone wrong?

This particular function was invoked as part of the application startup:

func (a *App) setupDocDBClient(ctx context.Context) error { docdbClient, err := docdb.NewClient( ctx, a.config.MongoConfig.URI, a.config.MongoConfig.Database, a.config.MongoConfig.EnableTLS, ) if err != nil { return nil } a.DocDBClient = docdbClient return nil }

This is Go, which passes errors as part of the return. You can see an example where docdb.NewClient returns a client and an err object. At one point in the history of this function, it did the same thing- if connecting to the database failed, it returned an error.

But a few months earlier, an engineer changed it to swallow the error- if an error occurred, it would return nil.

As an organization, they did code reviews. Multiple people looked at this and signed off- or, more likely, multiple people clicked a button to say they'd looked at it, but hadn't.

Most of the time, there weren't any connection issues. But sometimes there were. One reboot had a flaky moment with connecting, and the error was ignored. Later on in execution, downstream modules started failing, which eventually led to a log full of panic level messages.

The change was part of a commit tagged merely: "Refactoring". Something got factored, good and hard, all right.

[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.
Remy Porter

Rare 'Upper Atmosphere Lightning' Photographed From ISS

2 months 2 weeks ago
Take a look at what being called "a stunning phenomenon," captured in a photo taken from the International Space Station as it passed above a thunderstorm over Mexico and the American Southwest. So what was it? "A rare form of Transient Luminous Event (TLE) called a gigantic jet," according to a new blog post at Notebookcheck.net: A gigantic jet happens above thunderstorms, firing powerful bursts of electrical charge from the top of the thunderstorm (about 20 km [12.4 miles] above the ground) into the upper atmosphere (about 100 km [62.1 miles] above the ground). The upper part of gigantic jets produces red emissions identical to sprites [large-scale electric discharges above thunderclouds]. But while gigantic jets burst directly from the top of thunderstorms, sprites form independently, much higher in the atmosphere, appearing around 50 miles (80 km) above the Earth's surface. "If ordinary lightning seems pretty ordinary, upper-atmosphere lightning is something else — an entire zoo of various upper-atmosphere electrical discharges," writes the Severe Weather Europe site. And NASA made a request in a new blog post this week to any aspiring citizen scientists. "Have you captured an image of a jet, sprite, or other type of TLE? Submit your photos to Spritacular.org to help scientists study these fascinating night sky phenomena!" Click here to see some of the photos from around the world that have already been uploaded and collected at Spritacular.org.

Read more of this story at Slashdot.

EditorDavid

India's PM laments missing out on global chipmaking dominance – in 1964!

2 months 2 weeks ago
Prime Minister promises first local silicon will appear this year, decades after Fairchild Semi's Robert Noyce made polite inquiries

Indian prime minister Narendra Modi has celebrated the nation’s independence day by pointing out that the nation is finally becoming a global chipmaking contender – 60 years after blowing the chance to be a global leader.…

Simon Sharwood

Google's 'AI Overview' Pointed Him to a Customer Service Number. It Was a Scam

2 months 2 weeks ago
A real estate developer searched Google for a cruise ship company's customer service number, reports the Washington Post, calling the number in Google's AI Overview. "He chatted with a knowledgeable representative and provided his credit card details," the Post's reporter notes — but the next day he "saw fishy credit card charges and realized that he'd been fooled by an impostor for Royal Caribbean customer service." And the Post's reporter found the same phone number "appearing to impersonate other cruise company hotlines and popping up in Google and ChatGPT" (including Disney and Carnival's Princess line): He'd encountered an apparent AI twist on a classic scam targeting travelers and others searching Google for customer help lines of airlines and other businesses... The rep knew the cost and pickup locations for Royal Caribbean shuttles in Venice. [And "had persuasive explanations" when questioned about paying certain fees and gratuities.] The rep offered to waive the shuttle fees... Here's how a scam like this typically works: Bad guys write on online review sites, message boards and other websites claiming that a number they control belongs to a company's customer service center. When you search Google, its technology looks for clues to relevant and credible information, including online advice. If scammer-controlled numbers are repeated as truth often enough online, Google may suggest them to people searching for a business. Google is a patsy for scammers — and we're the ultimate victims. Google's AI Overviews and OpenAI's ChatGPT may use similar clues as Google's search engine to spit out information gleaned from the web. That makes them new AI patsies for the old impostor number scams. "I've seen so many versions of similar trickery targeting Google users that I largely blame the company for not doing enough to safeguard its essential gateway to information," the reporter concludes, (adding "So did two experts in Google's inner workings.") The Post is now advising its reader to "be suspicious of phone numbers in Google results or in chatbots." Reached for comment, a Google spokesman told the Post they'd "taken action" on several impostor numbers identified by the reporter. That spokesman also said Google continues to "work on broader improvements" to "address rarer queries like these." OpenAI said that many of the webpages that ChatGPT referenced with the bogus cruise number appear to have been removed, and that it can take time for its information to update "after abusive content is removed at the source." Meanwhile, the man with the bogus charges has now canceled his credit card, the Post reports, with the charges being reversed. Reflecting on his experience, he tells the Post's readers "I can't believe that I fell for it. Be careful."

Read more of this story at Slashdot.

EditorDavid