SShortSingh.
Back to feed

Postgres lock bug from unclean shutdown took down entire Next.js site

0
·2 views

A developer's Next.js site began returning HTTP 500 errors on every request after a Postgres lock conflict caused the background worker to fail on boot. The root cause was a leftover lock on the pgboss.queue table from a previous unclean database shutdown, triggering error code 55P03 (lock_not_available) each time the worker tried to initialize. Because the worker was booted inside the web process via Next.js's instrumentation hook, its failure brought down the entire site rather than degrading gracefully. The fix involved catching worker boot errors so the web server stays up regardless, and adding a retry loop with exponential backoff so the worker self-heals once the lock clears. A secondary bug was also identified where the 'started' flag was set before a successful boot, permanently blocking any retries after a failure.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Unverified Claim About Mistral AI Hosting Third-Party Models Prompts Enterprise Caution

An unconfirmed claim suggests Mistral AI may be expanding its platform to host third-party open models, starting with GLM-5.2, but Mistral has published no official announcement or documentation supporting this. The company currently distributes only its own models through established cloud partners such as Azure AI, Amazon Bedrock, and Google Vertex AI, while MCP connectors enable third-party service integrations without constituting model hosting. GLM-5.2 is associated with the THUDM or Zhipu AI ecosystem and does not appear in Mistral's documented portfolio. Enterprise teams are advised not to treat GLM-5.2 as a supported Mistral-hosted model until formal product details are released. Should such an expansion be confirmed, businesses would still need clear answers on data governance, regional inference, commercial terms, and operational support responsibilities before adoption.

0
ProgrammingDEV Community ·

Tool Exposes Which Short-Video Clipping Campaigns Actually Pay Out

A developer has built a scraper tool that analyzes all active campaigns on Whop Content Rewards, a platform paying creators per 1,000 views on short-form video clips. The tool reveals that 21% of the platform's roughly 456 live campaigns have never paid out a single cent, despite displaying large listed budgets. By calculating daily spend rate, estimated days of budget remaining, and average payout per creator, the tool assigns each campaign an opportunity score to help clippers prioritize their work. The developer notes that high headline budgets are misleading without payout velocity data, citing two campaigns both showing around $30,000 in budget but with vastly different daily burn rates of $255 versus $19. The scraper runs via Apify and is designed to be scheduled once daily, returning ranked results to guide creators toward campaigns that demonstrably pay.

0
ProgrammingDEV Community ·

AI Agents Vulnerable to Prompt Injection Attacks Hidden in GitHub READMEs

A developer discovered a prompt injection attack embedded in a GitHub repository's README file during a research session with Claude Code, where plain text mimicked a legitimate system message by falsely claiming the date had changed. Rather than using obvious jailbreak phrases, the attacker exploited how AI agents process fetched web content, causing the agent to re-evaluate information based on a fabricated timestamp. A March 2026 study by ReadSecBench tested 500 open-source README files and found that direct embedded commands successfully manipulated AI models roughly 84% of the time, with instructions buried in linked files like CONTRIBUTING.md succeeding at around 91%. Human reviewers fared little better, with the majority of 15 testers failing to detect any problem in flagged documents. Security researchers note that legitimate system instructions are never delivered inside fetched page content, making any system-style markup found within a web page a reliable indicator of a forged or malicious command.