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.
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.
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.
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.
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.
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.
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.
Postgres 28P01: password authentication failed
Fix PostgreSQL 28P01 password authentication failed by checking pg_hba.conf rules, password encoding, and connection string parameters.
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.
PostgreSQL Serialization Failure 40001 — Retry the Transaction
Handle PostgreSQL 40001 serialization failures by retrying the whole transaction at SERIALIZABLE/REPEATABLE READ isolation.
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.
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.
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.
Django DisallowedHost — Invalid HTTP_HOST Header
Fix Django DisallowedHost Invalid HTTP_HOST header by configuring ALLOWED_HOSTS and understanding the proxy forwarded-host header.
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.
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.
Python IndentationError — Unexpected Indent
Resolve IndentationError unexpected indent by matching block indentation to the preceding colon and eliminating mixed tabs inside a single file.
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.
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.
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.
pandas SettingWithCopyWarning / Chained Assignment
Eliminate pandas SettingWithCopyWarning and FutureWarning on chained assignment by using .loc on a real DataFrame copy instead of slicing.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Rails ActiveRecord::PendingMigrationError — Migrations Not Run
Fix PendingMigrationError by running pending migrations, understanding db:prepare, and resolving migration conflicts before deploy.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
SSH: Host key verification failed
Fix SSH "Host key verification failed" safely by comparing fingerprints instead of disabling StrictHostKeyChecking.
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.
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.
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.
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.
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.
TypeScript TS18046 — Error Is of Type unknown
Fix TS18046 by narrowing unknown values with type guards, using instanceof Error, and opting into useUnknownInCatchVariables deliberately.
TypeScript TS2304 — Cannot Find Name
Fix TS2304 by correcting the identifier, importing the missing symbol, or declaring globals and library types in the tsconfig.
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.
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.
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.
TypeScript TS2564 — Property Has No Initializer
Fix TS2564 by initializing class fields, using definite assignment assertions only when safe, or assigning in the constructor.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
XSS via dangerouslySetInnerHTML — Unescaped HTML
Fix XSS from dangerouslySetInnerHTML by rendering text normally, sanitizing any required HTML, and relying on React escaping by default.
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.
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.
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.
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.
DNS — NXDOMAIN response for a name that should exist
Diagnose NXDOMAIN by checking the queried name, search domains, resolver configuration and record presence.
Docker — build cache invalidated on every build
Fix repeated cache invalidation by ordering Dockerfile layers and avoiding changes that invalidate early layers.
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.
Docker — container marked unhealthy by its healthcheck
Fix Docker unhealthy containers by correcting the healthcheck command, timing and the endpoint it probes.
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.
Express — Cannot set headers after they are sent
Fix "headers already sent" by ensuring each request sends exactly one response and guarding asynchronous paths.
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.
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.
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.
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.
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.