Developer errors: error fixes

Errors developers hit in browsers, curl and Node.js: CORS, framing, certificate and connection failures.

Error fix · Developer errorsCannot connect to the Docker daemon" Fix: Is the Daemon Running?Fix "Cannot connect to the Docker daemon at unix:///var/run/docker.sock": start the service, fix socket permissions and group, and check DOCKER_HOST.4 min readError fix · Developer errorsCertificate Hostname Mismatch: Fix SAN and Name ErrorsFix "certificate is not valid for" and hostname mismatch errors by reading the certificate's SAN list, then reissuing for the right names or serving the right site.4 min readError fix · Developer errorsCORS Error: "No Access-Control-Allow-Origin header is present" FixFix the browser CORS error "No Access-Control-Allow-Origin header is present" with server header examples, preflight handling and credentials rules.4 min readError fix · Developer errorsCORS Preflight Response Failed: "Does Not Have HTTP OK Status" FixFix CORS preflight failures: OPTIONS requests returning 404, 405, 401 or redirects, missing Allow headers, and auth middleware that runs before CORS.4 min readError fix · Developer errorscurl (28) Operation Timed Out: Find Which Phase StalledFix curl error 28 "Operation timed out" and "Connection timed out" by using curl timing variables to see whether DNS, connect, TLS or the server response stalled.5 min readError fix · Developer errorscurl (35) SSL connect error: What Each Variant Meanscurl exit code 35 is a generic TLS handshake failure. Read the OpenSSL text after it to separate protocol, cipher, reset and wrong-port causes.4 min readError fix · Developer errorscurl (7) Failed to Connect to Host: Port Closed or BlockedFix curl error 7 "Failed to connect to host port 443: Connection refused" by checking the listener, firewall, IPv6 and proxy settings, in a clear order.4 min readError fix · Developer errorscurl Error 60: SSL Certificate Problem (Unable to Get Local Issuer)Fix curl error 60 "SSL certificate problem: unable to get local issuer certificate" by finding whether the server chain, CA bundle, proxy or clock is at fault.5 min readError fix · Developer errorsDNS SERVFAIL Explained: Causes and How to Diagnose It with digSERVFAIL means a resolver could not get a usable answer. Use dig, +cd and +trace to separate DNSSEC failures, dead nameservers and broken delegation, then fix the right layer.4 min readError fix · Developer errorsDocker "bind: address already in use" and "port is already allocatedFix Docker "Bind for 0.0.0.0:80 failed: port is already allocated" and "address already in use": find the process or container holding the port and remap it.4 min readError fix · Developer errorsDocker "no space left on device": Find What Filled the DiskFix Docker "no space left on device" during pulls, builds and writes: check disk and inodes, run docker system df, prune safely and move the data root.4 min readError fix · Developer errorsGit "SSL certificate problem": unable to get local issuer certificateFix git "SSL certificate problem: unable to get local issuer certificate" and "self signed certificate": find the cause, add the CA, never disable verification.4 min readError fix · Developer errorsJava PKIX path building failed: Fix the TruststoreFix Java's "PKIX path building failed: unable to find valid certification path to requested target" with keytool, a custom truststore and the right JDK cacerts file.4 min readError fix · Developer errorsKubernetes CrashLoopBackOff: How to Debug a Restarting PodDebug Kubernetes CrashLoopBackOff step by step: read previous logs, check exit codes, OOMKilled, probes, config and commands, then fix and verify the pod.4 min readError fix · Developer errorsKubernetes Ingress 502 Bad Gateway and 503 Service UnavailableFix 502 and 503 from a Kubernetes Ingress: check endpoints, selectors, readiness, ports, controller logs and backend protocol, in a clear order.5 min readError fix · Developer errorsMongoDB "connect ECONNREFUSED 127.0.0.1:27017": Causes and FixesFix MongoDB ECONNREFUSED on port 27017: start mongod, repair bindIp, handle the IPv6 localhost trap in Node, and fix Docker, Compose and firewall issues.4 min readError fix · Developer errorsMongoServerSelectionError: Server Selection Timed Out - FixesFix MongoDB server selection timed out errors. Check Atlas IP access lists, DNS SRV, TLS, bindIp, replica set hostnames, firewalls and serverSelectionTimeoutMS.5 min readError fix · Developer errorsMySQL ERROR 1062: Duplicate Entry for Key - Causes and FixesFix MySQL ERROR 1062 Duplicate entry for key. Find the clashing row, use ON DUPLICATE KEY UPDATE or INSERT IGNORE, and repair exhausted AUTO_INCREMENT keys.4 min readError fix · Developer errorsMySQL ERROR 1114 (HY000): The Table Is Full - Causes and FixesFix MySQL and MariaDB ERROR 1114 The table is full. Check disk space, tmpdir, max_heap_table_size, tmp_table_size and InnoDB tablespace limits step by step.5 min readError fix · Developer errorsMySQL ERROR 1205: Lock Wait Timeout Exceeded - Find the BlockerFix MySQL ERROR 1205 Lock wait timeout exceeded. Find the blocking transaction, tune innodb_lock_wait_timeout, and stop long transactions and missing indexes.4 min readError fix · Developer errorsMySQL ERROR 1213: Deadlock Found When Trying to Get LockUnderstand MySQL ERROR 1213 deadlocks. Read the InnoDB deadlock report, fix lock ordering and indexes, log every deadlock, and retry transactions safely.4 min readError fix · Developer errorsMySQL ERROR 1215: Cannot Add Foreign Key Constraint - ChecklistFix MySQL ERROR 1215 Cannot add foreign key constraint. Check column types, signedness, collation, indexes, engines, existing data and Laravel foreignId.4 min readError fix · Developer errorsMySQL ERROR 1366: Incorrect String Value for Column (utf8mb4 Fix)Fix MySQL ERROR 1366 Incorrect string value for emoji and 4-byte characters. Convert to utf8mb4, set the connection charset, and avoid index length traps.4 min readError fix · Developer errorsMySQL ERROR 2013: Lost Connection to Server During QueryFix MySQL ERROR 2013 Lost connection to MySQL server during query. Check net_read_timeout, packet size, crashes and OOM kills, and proxy or firewall idle limits.4 min readError fix · Developer errorsNode.js "certificate has expired" (CERT_HAS_EXPIRED) FixFix Node.js "Error: certificate has expired" (CERT_HAS_EXPIRED): renew the server certificate, replace an expired intermediate, or fix the system clock.4 min readError fix · Developer errorsNode.js "Error: connect ECONNREFUSED" 127.0.0.1: Causes and FixesFix Node.js ECONNREFUSED errors for databases, APIs and localhost: confirm the service listens, handle IPv6 localhost, Docker networking and startup order.5 min readError fix · Developer errorsNode.js "getaddrinfo ENOTFOUND" Error: Causes and FixesFix Node.js "getaddrinfo ENOTFOUND hostname" and EAI_AGAIN by checking the hostname string, DNS, container DNS, proxies and environment variables.5 min readError fix · Developer errorsNode.js "JavaScript heap out of memory" Fix and DiagnosisFix "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory". Raise --max-old-space-size, find leaks and tune builds and containers.4 min readError fix · Developer errorsNode.js EADDRINUSE: address already in use :::3000 FixFix Node.js "Error: listen EADDRINUSE: address already in use" by finding the process holding the port with lsof, ss or netstat, then stopping it or changing ports.5 min readError fix · Developer errorsNode.js ECONNRESET: read ECONNRESET and "socket hang up" FixFix Node.js "read ECONNRESET" and "socket hang up". Learn why keep-alive reuse, proxies and idle timeouts reset sockets, and how to retry safely.4 min readError fix · Developer errorsNode.js ENOMEM "Cannot Allocate Memory": Find What Ran OutFix Node.js spawn ENOMEM and "Cannot allocate memory" errors: tell OS memory exhaustion from heap limits, check the OOM killer, swap and container limits.4 min readError fix · Developer errorsNode.js EPIPE: write EPIPE (broken pipe) Causes and FixesFix Node.js "Error: write EPIPE". Understand broken pipes from closed sockets, piped output like head, and dead child processes, and handle them correctly.4 min readError fix · Developer errorsNode.js ERR_SSL_WRONG_VERSION_NUMBER: Causes and FixesFix "write EPROTO ... ssl3_get_record:wrong version number" in Node.js. It usually means HTTPS was spoken to a plain HTTP port, or a proxy URL is wrong.4 min readError fix · Developer errorsNXDOMAIN vs SERVFAIL vs REFUSED: DNS Response Codes ComparedLearn what the DNS response codes NXDOMAIN, SERVFAIL, REFUSED and NOERROR with no data mean, how to read them in dig, and what to check first for each one.4 min readError fix · Developer errorsopenssl s_client "Verify return code": Every Code ExplainedRead openssl s_client output correctly: what Verify return code 0, 10, 18, 19, 20, 21 and 62 mean, the right flags to use, and the fix for each result.5 min readError fix · Developer errorsPHP "Call to undefined function": Missing Extension or Removed FunctionFix PHP's "Uncaught Error: Call to undefined function" by checking for a missing extension, a function removed in PHP 7 or 8, or a missing include.4 min readError fix · Developer errorsPHP "Class not found" Error: Autoload, Namespace and Case FixesFix PHP's 'Class "App\Foo" not found' error: regenerate the Composer autoloader, correct namespaces and filename case, and install missing extensions.4 min readError fix · Developer errorsPHP "Maximum execution time of 30 seconds exceeded" FixFix PHP's "Maximum execution time exceeded" fatal error: raise max_execution_time where it really applies, and find out why the script is slow in the first place.4 min readError fix · Developer errorsPHP failed to open stream: Permission denied - Fix OwnershipFix PHP's failed to open stream: Permission denied warning by checking file owner, directory execute bits, the PHP-FPM user, SELinux and open_basedir.4 min readError fix · Developer errorsPHP Fatal error: Uncaught TypeError - Causes and FixesFix PHP's Uncaught TypeError by reading the message: wrong argument or return type, null passed to a function, or unsupported operands after a PHP 8 upgrade.4 min readError fix · Developer errorsPHP Headers Already Sent: Find the Output and Fix ItFix PHP's headers already sent warning by finding the file and line where output started: BOM, stray whitespace, echo, or notices. Includes ob_start use.4 min readError fix · Developer errorsPHP Warning: Undefined array key - What It Means and How to Fix ItFix PHP's Undefined array key warning with isset(), the null coalescing operator and array_key_exists(), and learn why PHP 8 replaced Undefined index.4 min readError fix · Developer errorsPHP-FPM Primary Script Unknown: Fix the nginx SCRIPT_FILENAME PathFix the nginx and PHP-FPM Primary script unknown error by correcting root, SCRIPT_FILENAME, try_files, chroot paths and file permissions. Includes tests.4 min readError fix · Developer errorsPHP-FPM Server Reached pm.max_children: Size Your Pool CorrectlyFix the PHP-FPM warning server reached pm.max_children by measuring worker memory, setting pm.max_children from real RAM, and finding slow requests.4 min readError fix · Developer errorsPostgreSQL "ERROR: deadlock detected" - Find the Cycle and Fix ItUnderstand PostgreSQL deadlock detected (SQLSTATE 40P01). Read the log, tune deadlock_timeout and log_lock_waits, order locks, and add safe retries.5 min readError fix · Developer errorsPostgreSQL "sorry, too many clients already" - Causes and FixesFix FATAL sorry, too many clients already in PostgreSQL. Find who holds connections, tune max_connections, use PgBouncer, and stop connection leaks.4 min readError fix · Developer errorsRedis "Connection Refused" on Port 6379: Causes and FixesFix Redis Could not connect to Redis at 127.0.0.1:6379 Connection refused: check the service, bind address, protected mode, firewalls and Docker networking.4 min readError fix · Developer errorsRedis MISCONF "unable to persist to disk" - Causes and FixesFix the Redis MISCONF error when BGSAVE fails. Check disk space, directory permissions, fork memory and vm.overcommit_memory, then handle stop-writes-on-bgsave-error.4 min readError fix · Developer errorsRefused to Display in a Frame: X-Frame-Options Fix (iframe Blocked)Fix "Refused to display in a frame because it set X-Frame-Options" by changing frame-ancestors or X-Frame-Options on the framed site, or by using an embed URL.4 min readError fix · Developer errorsself signed certificate in certificate chain: Causes and FixesFix "self signed certificate in certificate chain" in npm, Node, git and curl: identify the proxy or private CA behind it and trust it safely.4 min readError fix · Developer errorsSQLite "database is locked" (SQLITE_BUSY) - Causes and FixesFix SQLite database is locked errors. Enable WAL mode, set busy_timeout, use BEGIN IMMEDIATE, shorten transactions, and avoid network filesystems.5 min readError fix · Developer errorsSSH "Permission denied (publickey)": How to Fix ItFix SSH Permission denied (publickey) by checking which key is offered, authorized_keys, file permissions, usernames, sshd settings and agent problems.4 min readError fix · Developer errorsSSL wrong version number: Why It Happens and How to Fix ItThe OpenSSL error wrong version number means a TLS client got non-TLS bytes back. Find the plain-HTTP port, the HTTPS-to-HTTP proxy setting or STARTTLS mix-up behind it.4 min read