Debugging Guides

Distinguish symptoms from root causes, then verify the fix.

697 published

Page 4 of 7

Oracle ORA-00942: table or view does not exist

Fix Oracle ORA-00942 when a table exists but is not visible due to schema qualification, synonyms, or missing grants.

intermediate
debugging · oracle · database · permissions

PHP Fatal error: Class Not Found — Composer Autoload Miss

Fix "Class not found" fatal errors by regenerating the Composer autoloader, matching PSR-4 namespace to directory, and clearing the opcache.

intermediate
debugging · php · composer · autoload

PHP failed to open stream — allow_url_fopen Disabled

Fix "failed to open stream: HTTP request failed" by enabling allow_url_fopen or switching to cURL with proper error reporting.

intermediate
debugging · php · http · curl

PHP Warning: Undefined Array Key — Missing Index

Fix "Undefined array key" warnings by using the null coalescing operator, array_key_exists, and validating input before access.

beginner
debugging · php · warnings · arrays

Playwright Browser Executable Missing — Install Failed

Fix "Executable doesn't exist" by installing Playwright browsers and their OS dependencies, matching versions, and caching correctly in CI.

beginner
debugging · playwright · testing · ci

PostgreSQL Autovacuum Not Keeping Up — Bloat and XID Wraparound

Diagnose autovacuum lag by checking dead tuples, long transactions, and wraparound age, then tune thresholds and remove blockers.

advanced
debugging · postgresql · vacuum · maintenance

PostgreSQL ERROR 42703 — Column Does Not Exist

Fix PostgreSQL 42703 by checking identifier case, schema search_path, table aliases, and migration state for the referenced column.

beginner
debugging · postgresql · sql · identifiers

Postgres 28P01: password authentication failed

Fix PostgreSQL 28P01 password authentication failed by checking pg_hba.conf rules, password encoding, and connection string parameters.

intermediate
debugging · postgres · auth · database

Postgres 3D000: database does not exist

Fix PostgreSQL 3D000 database does not exist by confirming the database name, connection target, and default-database fallback in tools.

beginner
debugging · postgres · database

PostgreSQL Serialization Failure 40001 — Retry the Transaction

Handle PostgreSQL 40001 serialization failures by retrying the whole transaction at SERIALIZABLE/REPEATABLE READ isolation.

advanced
debugging · postgresql · transactions · concurrency

PostgreSQL ERROR 22001 — Value Too Long for Column

Fix PostgreSQL 22001 by widening varchar columns or using text, and validating length with character-based limits.

beginner
debugging · postgresql · data-types · constraints

Python AttributeError: module has no attribute

Fix AttributeError when a module attribute is missing because of version drift, a shadowing local file, or a wrong import form.

intermediate
debugging · python · imports · dependencies

Python AttributeError: 'NoneType' Object Has No Attribute

Fix AttributeError 'NoneType' object has no attribute by finding the call that returned None and choosing between raising, defaulting, or skipping.

beginner
debugging · python · attributeerror · null

Django DisallowedHost — Invalid HTTP_HOST Header

Fix Django DisallowedHost Invalid HTTP_HOST header by configuring ALLOWED_HOSTS and understanding the proxy forwarded-host header.

intermediate
debugging · python · django · http

Django MigrationConflictError: multiple leaf nodes

Resolve Django migration conflicts when two branches add migrations with the same parent, producing multiple leaf nodes and a blocked migrate.

intermediate
debugging · python · django · database

Python ImportError: cannot import name X from Y

Fix ImportError: cannot import name when a symbol is missing, circular imports bite, or a local file shadows the installed package.

intermediate
debugging · python · imports

Python IndentationError — Unexpected Indent

Resolve IndentationError unexpected indent by matching block indentation to the preceding colon and eliminating mixed tabs inside a single file.

beginner
debugging · python · syntax · indentation

Python IndexError — List Index Out of Range

Fix IndexError list index out of range by checking length before indexing, using at most len-1, and preferring iteration or slicing.

beginner
debugging · python · indexerror · boundary

Python TypeError — Object Is Not JSON Serializable

Fix "Object of type X is not JSON serializable" by providing a default handler or converting dates, sets, and custom objects before dumping.

intermediate
debugging · python · json · serialization

Python NameError: name is not defined

Fix Python NameError when a variable or function is referenced before it is defined, or is out of scope inside a function or class.

beginner
debugging · python · scope

pandas SettingWithCopyWarning / Chained Assignment

Eliminate pandas SettingWithCopyWarning and FutureWarning on chained assignment by using .loc on a real DataFrame copy instead of slicing.

intermediate
debugging · python · pandas · data

Python RuntimeError: dictionary changed size during iteration

Fix RuntimeError when mutating a dict or set while iterating it, and choose between iterating a copy, over list(d), or deferred deletion.

beginner
debugging · python · iteration

Python subprocess.CalledProcessError: returned non-zero exit status

Diagnose subprocess.CalledProcessError by capturing stderr, checking exit codes, and using check=True only where failure should abort.

intermediate
debugging · python · subprocess

Python SyntaxError: invalid syntax

Fix Python SyntaxError by reading the caret location, checking recent edits, and remembering that Python 2 print and async differences still bite.

beginner
debugging · python · syntax

Python TabError — Inconsistent Use of Tabs and Spaces

Fix TabError inconsistent use of tabs and spaces by normalizing one file to spaces and configuring your editor to never emit tabs.

beginner
debugging · python · syntax · tabs

Python: threading deadlock with locks

Diagnose Python threading deadlocks from lock ordering, non-reentrant locks, and forgetting to release, and fix them with timeouts and lock ordering.

advanced
debugging · python · concurrency · threading

Python TypeError: 'NoneType' Object Is Not Subscriptable

Fix TypeError 'NoneType' object is not subscriptable by tracing the function that returned None and guarding before indexing.

beginner
debugging · python · typeerror · null

Python TypeError: unsupported operand type(s)

Fix Python TypeError when operators are applied to incompatible types, such as str + int or None + float, and add explicit conversions or validation.

beginner
debugging · python · types

Python ValueError — Invalid Literal for int()

Fix ValueError invalid literal for int() with base 10 by identifying the non-numeric token and parsing it with explicit handling of whitespace and signs.

beginner
debugging · python · valueerror · parsing

Python ZeroDivisionError — Division by Zero

Fix ZeroDivisionError by validating divisors, computing rates only when the denominator is nonzero, and returning a defined value for empty sets.

beginner
debugging · python · zerodivision · boundary

React Warning — State Update on an Unmounted Component

Fix "Can't perform a React state update on an unmounted component" by aborting in-flight work and cleaning up subscriptions on unmount.

intermediate
debugging · react · effect · cleanup

React: Hooks can only be called inside the body of a function component

Fix React hook order errors by moving hooks out of conditionals, loops, and callbacks, and understanding the render-order invariant they enforce.

intermediate
debugging · react · hooks

React Missing key Prop — List Items Warning

Fix the "Each child in a list should have a unique key" warning by assigning stable keys and understanding why index keys cause bugs.

beginner
debugging · react · lists · keys

React Cannot Update a Component While Rendering Another

Fix "Cannot update a component while rendering a different component" by moving state updates out of render, into effects or event handlers.

intermediate
debugging · react · render · purity

React Too Many Re-Renders — Infinite Update Loop

Fix "Too many re-renders" by never calling setState during render, moving updates into effects or handlers, and breaking dependency cycles.

intermediate
debugging · react · render · state

React useEffect Stale Closure — Missing Dependency

Fix stale values in effects by listing every reactive value used inside, or by reading the latest value from a ref to avoid re-running.

intermediate
debugging · react · hooks · closure

Redis CLUSTERDOWN: the cluster is down

Fix Redis CLUSTERDOWN by restoring slot coverage, fixing a failed slot owner, and understanding the cluster-require-full-coverage setting.

advanced
debugging · redis · cluster · database

Redis OOM command not allowed — maxmemory with noeviction

Fix "OOM command not allowed when used memory > maxmemory" by choosing an eviction policy, setting maxmemory, and sizing the instance.

intermediate
debugging · redis · memory · eviction

Redis WRONGTYPE Operation — Key Holds a Different Type

Fix Redis WRONGTYPE by inspecting the key type, using matching commands, and namespacing keys by data structure.

beginner
debugging · redis · data-types · cache

Regex Catastrophic Backtracking — ReDoS Freezes the Server

Fix ReDoS by removing nested quantifiers, validating input length, and using atomic or possessive patterns and linear-time alternatives.

advanced
debugging · security · regex · redos

Rollup/Rollup-based: Unresolved dependencies warning

Fix Rollup "Unresolved dependencies" warnings by marking externals, adding the node-resolve plugin, and setting the correct output format.

intermediate
debugging · rollup · build · bundler

Bundler Frozen Mode — Gemfile.lock Would Change

Fix "frozen mode" Bundler errors by resolving the lockfile mismatch locally, committing Gemfile.lock, and understanding bundle config frozen.

intermediate
debugging · ruby · bundler · dependencies

Ruby NoMethodError — Undefined Method for Nil

Fix NoMethodError 'undefined method for nil:NilClass' by tracing the nil source and using safe navigation or explicit guards.

beginner
debugging · ruby · nomethoderror · nil

Rails ActiveRecord::PendingMigrationError — Migrations Not Run

Fix PendingMigrationError by running pending migrations, understanding db:prepare, and resolving migration conflicts before deploy.

intermediate
debugging · ruby · rails · migrations

Cargo: not a git repository error

Fix Cargo git dependency errors when building in sandboxes, CI, or submodules where the source directory is not a git repository.

intermediate
debugging · rust · cargo · ci

Cargo Permission Denied — Target Directory Not Writable

Fix cargo build permission denied errors by correcting ownership of target/, avoiding shared target dirs across users, and clearing stale locks.

intermediate
debugging · rust · cargo · permissions

Rust E0282 — Type Annotations Needed

Fix Rust E0282 type-inference failures by annotating the ambiguous value, naming the collection element type, or parsing into a concrete type.

intermediate
debugging · rust · type-inference · e0282

Rust E0425: cannot find value/struct in this scope

Fix Rust E0425 when a name cannot be found in scope due to a missing import, an unlinked crate, or the wrong module path.

beginner
debugging · rust · compiler

Rust E0505 — Cannot Move Out of Value While Borrowed

Fix Rust error E0505 by ending the borrow before moving, reordering operations, or cloning when the borrow must outlive the value.

beginner
debugging · rust · borrow-checker · e0505

Rust E0515 — Cannot Return Reference to Local Value

Fix Rust E0515 by returning an owned value instead of a reference to a local, or by returning a borrowed parameter that outlives the function.

beginner
debugging · rust · lifetimes · e0515

Rust E0597 — Borrowed Value Does Not Live Long Enough

Fix Rust E0597 by extending the borrow scope, returning owned data, or restructuring so the borrowed value outlives all its references.

advanced
debugging · rust · lifetimes · e0597

Rust E0599: no method named found for type

Fix Rust E0599 when a method is not found because its trait is not in scope, the receiver type differs, or the type needs dereferencing.

intermediate
debugging · rust · traits

Rust E0004/E0658 — Match Not Exhaustive

Resolve non-exhaustive match errors by covering every variant or adding a wildcard arm, and understand why adding an enum variant breaks callers.

intermediate
debugging · rust · match · exhaustiveness

Rust: index out of bounds panic

Diagnose Rust "index out of bounds" panics from slicing and Vec indexing, and replace unchecked indexing with get or iterators.

intermediate
debugging · rust · panic

Rust: invalid digit found in string

Fix Rust parse errors "invalid digit found in string" and "cannot parse integer" when input contains whitespace, signs, or non-numeric characters.

beginner
debugging · rust · parsing

Rust proc-macro crate not available — Macro Import Fails

Fix "proc-macro crate not available" and unresolved derive errors by separating the proc-macro crate and importing derives through the facade.

advanced
debugging · rust · proc-macro · cargo

Rust serde_json: EOF while parsing a value

Fix serde_json "EOF while parsing" errors caused by empty bodies, truncated responses, or deserializing into the wrong shape.

intermediate
debugging · rust · json · serde

Serde untagged Enum — No Variant Matched

Fix serde untagged enum failures by checking field overlap, ordering variants from most to least specific, and switching to a tagged representation.

intermediate
debugging · rust · serde · deserialization

Tokio Runtime Shutdown Hangs — Blocking Task or Leaked Spawn

Diagnose a Tokio runtime that never returns from shutdown by finding blocking calls on async threads and detached tasks that keep the runtime alive.

advanced
debugging · rust · tokio · async

SQL Injection via String Concatenation — Parameterize Queries

Eliminate SQL injection by replacing string concatenation with parameterized queries, validating input, and using an allowlist for identifiers.

beginner
debugging · security · sql-injection · owasp

SQLite "file is not a database" — Corrupt or Wrong File

Fix "file is not a database" by checking the SQLite magic header, ruling out an HTML error page or wrong path, and restoring from backup.

beginner
debugging · sqlite · corruption · filesystem

SSH: Host key verification failed

Fix SSH "Host key verification failed" safely by comparing fingerprints instead of disabling StrictHostKeyChecking.

intermediate
debugging · ssh · security · linux

SSRF — Server Fetches Internal or Metadata URLs

Mitigate SSRF by validating URLs against an allowlist, blocking private and link-local ranges, and disabling redirects to internal hosts.

advanced
debugging · security · ssrf · owasp

Thundering Herd — Cache Stampede on Expiry

Fix cache stampedes by using single-flight (request coalescing), jittered TTLs, and stale-while-revalidate so expiry does not overload the origin.

advanced
debugging · concurrency · caching · performance

TypeScript TS1086 — Accessor Cannot Be Declared in Ambient Context

Fix TS1086 by converting interface or declaration accessors to plain properties, since ambient and interface contexts cannot contain get/set bodies.

beginner
debugging · typescript · interfaces · declaration

TypeScript TS1109 — Expression Expected

Fix TS1109 syntax errors by locating the unexpected token, checking for a stray operator or bracket, and correcting the incomplete expression.

beginner
debugging · typescript · syntax · parser

TypeScript TS1208: Cannot find global type after adding an import

Fix TS1208 when a file with no imports becomes a module or when a global type declaration is missing from the compilation.

intermediate
debugging · typescript · types

TypeScript TS18046 — Error Is of Type unknown

Fix TS18046 by narrowing unknown values with type guards, using instanceof Error, and opting into useUnknownInCatchVariables deliberately.

intermediate
debugging · typescript · strict · unknown

TypeScript TS2304 — Cannot Find Name

Fix TS2304 by correcting the identifier, importing the missing symbol, or declaring globals and library types in the tsconfig.

beginner
debugging · typescript · compiler · imports

TypeScript TS2367 — Comparison Appears Unintentional

Fix TS2367 "This comparison appears to be unintentional" by aligning literal and union types and avoiding redundant checks that the type already rules out.

intermediate
debugging · typescript · types · narrowing

TypeScript TS2551 — Property Does Not Exist, Did You Mean

Fix TS2551 by correcting the property name, extending the type, or adding an index signature when dynamic keys are genuinely intended.

beginner
debugging · typescript · types · properties

TypeScript TS2554 — Expected N Arguments but Got M

Fix TS2554 by matching call arity to the signature, understanding optional and rest parameters, and avoiding trailing undefined arguments.

beginner
debugging · typescript · compiler · functions

TypeScript TS2564 — Property Has No Initializer

Fix TS2564 by initializing class fields, using definite assignment assertions only when safe, or assigning in the constructor.

intermediate
debugging · typescript · strict · classes

TypeScript TS5055: Cannot write file because it would overwrite input

Fix TS5055 when the compiler output directory overlaps the source directory or includes previously emitted files.

intermediate
debugging · typescript · build

TypeScript TS6059: File is not under rootDir

Fix TS6059 by aligning rootDir with the actual source locations, or removing it and letting TypeScript infer the common root.

intermediate
debugging · typescript · build · monorepo

Vite import.meta.env.VITE_X Undefined in the Build

Fix undefined Vite env variables by using the VITE_ prefix, providing the variable at build time, and understanding that env is inlined statically.

beginner
debugging · vite · environment · build

Vue Array Mutation Not Reactive — UI Does Not Update

Fix non-reactive array updates in Vue by replacing the array or using reactive-aware methods, and avoid mutating index positions directly.

intermediate
debugging · vue · reactivity · arrays

Vue Cannot Read Properties of null (reading value)

Fix "Cannot read properties of null (reading 'value')" by initializing template refs and reading DOM refs only after mount.

intermediate
debugging · vue · refs · lifecycle

Vue Property Was Accessed but Not Defined on Instance

Fix "Property was accessed during render but is not defined on instance" by declaring data, props, or refs before use and checking template names.

beginner
debugging · vue · template · setup

Vue: mutating a prop warning and one-way data flow

Fix the Vue avoid-mutating-prop warning by emitting events, using local state, and modelling one-way data flow correctly.

beginner
debugging · vue · props · state

Vue: destructured props lose reactivity

Fix Vue 3 reactivity loss when destructuring reactive objects or props, and choose between toRefs, toRef, and reactive-aware destructuring.

intermediate
debugging · vue · reactivity

Vue/Vite: @ alias fails to resolve

Fix Vite and Vue "Failed to resolve import" for the @ alias by configuring resolve.alias and matching tsconfig paths.

beginner
debugging · vite · vue · build

Webpack Module Not Found — Missing resolve Extension or Alias

Fix "Module not found" by adding the file extension to resolve.extensions, defining aliases, and resolving case-sensitive path mismatches.

intermediate
debugging · webpack · build · modules

Windows: The process cannot access the file because it is being used

Diagnose the Windows file-in-use error by finding the locking process with handle or Resource Monitor, and releasing or retrying safely.

beginner
debugging · windows · filesystem

XSS via dangerouslySetInnerHTML — Unescaped HTML

Fix XSS from dangerouslySetInnerHTML by rendering text normally, sanitizing any required HTML, and relying on React escaping by default.

intermediate
debugging · security · xss · react

API — Deep OFFSET Pagination Times Out

Fix list endpoints that degrade as OFFSET grows, understand why the database still scans skipped rows, and switch to keyset pagination with stable cursors.

intermediate
debugging · api · pagination · databases

GraphQL — Deeply Nested Queries Exhaust the Server

Protect GraphQL servers from depth and complexity bombs, read resolver timing to find exponential fan-out, and enforce depth, complexity, and rate limits.

intermediate
debugging · graphql · api · performance

AWS SigV4 — RequestTimeTooSkewed 403 After Clock Drift

Fix AWS SignatureDoesNotMatch and RequestTimeTooSkewed errors by checking NTP synchronization, host clocks in VMs and containers, and credential scope correctness.

beginner
debugging · aws · sigv4 · time

CSP — Refused to Load the Script Because It Violates the Policy

Debug Content Security Policy violations from console reports and report-only mode, read the directive that fired, and fix the policy or the resource delivery.

intermediate
debugging · security · csp · browser

DNS — NXDOMAIN response for a name that should exist

Diagnose NXDOMAIN by checking the queried name, search domains, resolver configuration and record presence.

beginner
debugging · dns · networking

Docker — build cache invalidated on every build

Fix repeated cache invalidation by ordering Dockerfile layers and avoiding changes that invalidate early layers.

intermediate
debugging · docker · build

Docker Compose — service cannot resolve another service name

Fix Compose service resolution by placing services on a shared network with matching names and correct references.

beginner
debugging · docker · compose

Docker — container marked unhealthy by its healthcheck

Fix Docker unhealthy containers by correcting the healthcheck command, timing and the endpoint it probes.

beginner
debugging · docker · healthcheck

Express 4 — Async Route Handlers Swallow Errors and Hang Requests

Find out why Express 4 never delivers rejections from async handlers to error middleware, why requests hang instead of failing, and how to wrap handlers correctly.

intermediate
debugging · express · nodejs · async

Express — Cannot set headers after they are sent

Fix "headers already sent" by ensuring each request sends exactly one response and guarding asynchronous paths.

intermediate
debugging · node · express

Express — error handler never runs for thrown async errors

Fix Express error handling for async routes by forwarding errors to next or using an async wrapper.

intermediate
debugging · node · express

CLS Failures — Font Swap Shifts the Layout

Fix layout shifts caused by late web font swaps and FOUT, reserve space with size-adjust and font metrics overrides, and preload critical fonts with display swap.

beginner
debugging · performance · cls · fonts

Go — fatal error: all goroutines are asleep on an unbuffered channel

Resolve channel deadlocks by matching sends and receives and adding buffering or select with default.

intermediate
debugging · go · concurrency

Go — fatal error: concurrent map writes

Handle fatal error: concurrent map writes, which the race detector may miss, understand why it is unrecoverable, and protect or shard the map correctly.

advanced
debugging · go · concurrency · maps

Go — context canceled Cascade When Clients Disconnect

Tell apart context deadline exceeded from context canceled, trace client disconnects cascading through call chains, and separate user-initiated cancellation from system errors.

intermediate
debugging · go · context · http