Error map

Unable to cast object of type System.InvalidCastException: Unable to cast object of type 'X' to type 'Y'

.NET · layer 4, Application & API

Open the full error page →

Centre: this error. First ring: errors it is linked with (12). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

Unable to cast object of type — System.InvalidCastException: Unable to cast object of type 'X' to type 'Y' (.NET)Unable to c…SIGABRT — Thread 1: signal SIGABRT (app crashes with "libc++abi: terminating") (iOS)SIGABRTIllegalArgumentException — java.lang.IllegalArgumentException (Java)IllegalArgumentExce…IllegalStateException — java.lang.IllegalStateException (Java)IllegalStateExcepti…TypeError — Fatal error: Uncaught TypeError: foo(): Argument #1 ($x) must be of type int, string given (PHP)TypeErrorUncaught Exception — Fatal error: Uncaught Exception: message in file.php:12 (PHP)Uncaught ExceptionClassCastException — java.lang.ClassCastException: class A cannot be cast to class B (Java)ClassCastExceptionUnsupported operand types — Fatal error: Uncaught TypeError: Unsupported operand types: string + int (PHP)Unsupported operand…Input string was not in a correct format — System.FormatException: Input string was not in a correct format (.NET)Input string was no…ERR_INVALID_ARG_TYPE — TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined (Node.js)ERR_INVALID_ARG_TYPEImplicit float to int — Deprecated: Implicit conversion from float 2.5 to int loses precision (PHP)Implicit float to i…terminate called after throwing an instance of — C++: terminate called after throwing an instance of 'std::out_of_range' — what(): vector::_M_range_check (C/C++)terminate called af…AttributeError — AttributeError: 'X' object has no attribute 'y' (Python)AttributeErrorUnexpectedly found nil — Fatal error: Unexpectedly found nil while unwrapping an Optional value (iOS)Unexpectedly found …ArithmeticException — java.lang.ArithmeticException: / by zero (Java)ArithmeticExceptionNoSuchElementException — java.util.NoSuchElementException: No value present (Java)NoSuchElementExcept…422 — HTTP 422 Unprocessable Content (HTTP)422NumberFormatException — java.lang.NumberFormatException: For input string: "x" (Java)NumberFormatExcepti…MethodArgumentNotValidException — MethodArgumentNotValidException: Validation failed for argument [0] (Java)MethodArgumentNotVa…409 — HTTP 409 Conflict (HTTP)409read-only property — TypeError: Cannot assign to read only property 'x' of object (JavaScript)read-only propertysetState during render — Warning: Cannot update a component (`Parent`) while rendering a different component (`Child`) (React)setState during ren…Allowed memory size exhausted — PHP Fatal error: Allowed memory size of X bytes exhausted (PHP)Allowed memory size…Call to undefined function — PHP Fatal error: Uncaught Error: Call to undefined function (PHP)Call to undefined f…Cannot redeclare — Fatal error: Cannot redeclare function foo() (previously declared in …) (PHP)Cannot redeclare500 — HTTP 500 Internal Server Error (HTTP)500Call to member function on null — Fatal error: Uncaught Error: Call to a member function x() on null (PHP)Call to member func…ArgumentCountError — Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 1 passed and exactly 2 expected (PHP)ArgumentCountErrorStringIndexOutOfBoundsException — java.lang.StringIndexOutOfBoundsException: begin 0, end 10, length 5 (Java)StringIndexOutOfBou…UnsupportedOperationException — java.lang.UnsupportedOperationException (List.of / Arrays.asList is immutable) (Java)UnsupportedOperatio…Stream closed — java.io.IOException: Stream closed (Java)Stream closedArray to string conversion — Warning: Array to string conversion (PHP)Array to string con…Deprecated null to internal — Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated (PHP)Deprecated null to …Dynamic property deprecated — Deprecated: Creation of dynamic property Foo::$bar is deprecated (PHP)Dynamic property de…DateTimeParseException — java.time.format.DateTimeParseException: Text '31/12/2024' could not be parsed at index 2 (Java)DateTimeParseExcept…Unparseable date — java.text.ParseException: Unparseable date: "x" (Java)Unparseable dateInputMismatchException — java.util.InputMismatchException (Scanner) (Java)InputMismatchExcept…redirect_uri_mismatch — OAuth Error: redirect_uri_mismatch (Authentication)redirect_uri_mismat…divergent branches — hint: You have divergent branches and need to specify how to reconcile them. (Git)divergent branchesgpg failed to sign — error: gpg failed to sign the data — fatal: failed to write commit object (Git)gpg failed to signDEP0005 — DeprecationWarning: Buffer() is deprecated due to security and usability issues (DEP0005) (Node.js)DEP0005Cannot use object as array — Fatal error: Uncaught Error: Cannot use object of type stdClass as array (PHP)Cannot use object a…the attribute version is obsolete — WARN: the attribute `version` is obsolete, it will be ignored (Docker)the attribute versi…SIGSEGV — Segmentation fault (core dumped) (Linux)SIGSEGVrecovery mode — FATAL: the database system is in recovery mode (PostgreSQL)recovery modeIllegal instruction — Illegal instruction (core dumped) (SIGILL) (Linux)Illegal instructionTypeError: not a function — TypeError: x is not a function (JavaScript)TypeError: not a fu…ImportError — ImportError: cannot import name 'x' from 'y' (Python)ImportErrorKeyError — KeyError: 'x' (Python)KeyError

Directly related (12)

SIGABRTiOS

Thread 1: signal SIGABRT (app crashes with "libc++abi: terminating")

The app deliberately aborted — an uncaught exception, failed assertion or fatalError. The console above the crash has the real me…

IllegalArgumentExceptionJava

java.lang.IllegalArgumentException

A method rejected an argument value as invalid.

IllegalStateExceptionJava

java.lang.IllegalStateException

A method was called when the object wasn’t in the right state for it.

TypeErrorPHP

Fatal error: Uncaught TypeError: foo(): Argument #1 ($x) must be of type int, string given

A function received a value of the wrong type for a typed parameter.

Uncaught ExceptionPHP

Fatal error: Uncaught Exception: message in file.php:12

An exception was thrown and nothing caught it, so PHP stopped the script.

ClassCastExceptionJava

java.lang.ClassCastException: class A cannot be cast to class B

An object was cast to a type it isn’t.

Unsupported operand typesPHP

Fatal error: Uncaught TypeError: Unsupported operand types: string + int

An arithmetic or array operator was used with incompatible types (PHP 8 is stricter than PHP 7).

Input string was not in a correct format.NET

System.FormatException: Input string was not in a correct format

int.Parse/decimal.Parse/Convert.ToInt32 got a string that isn’t a valid number — empty, contains text, or uses another culture’s…

ERR_INVALID_ARG_TYPENode.js

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

A Node API got an argument of the wrong type — usually undefined because an env var or config value is missing.

Implicit float to intPHP

Deprecated: Implicit conversion from float 2.5 to int loses precision

PHP 8.1+ warns when a float with a fractional part is silently converted to int (array keys, % operator, int parameters).

terminate called after throwing an instance ofC/C++

C++: terminate called after throwing an instance of 'std::out_of_range' — what(): vector::_M_range_check

A C++ exception wasn’t caught anywhere, so std::terminate aborted the program. what() tells you the reason.

AttributeErrorPython

AttributeError: 'X' object has no attribute 'y'

You accessed an attribute or method that doesn’t exist on that object type.

Two steps away (36)

Unexpectedly found niliOS

Fatal error: Unexpectedly found nil while unwrapping an Optional value

Swift force-unwrapped (`!`) an optional that was nil, crashing the app.

ArithmeticExceptionJava

java.lang.ArithmeticException: / by zero

Integer division or modulo by zero.

NoSuchElementExceptionJava

java.util.NoSuchElementException: No value present

Code asked for an element that doesn’t exist — Optional.get() on empty, iterator.next() past the end, Scanner with no input.

422HTTP

HTTP 422 Unprocessable Content

The request is well-formed, but the data fails validation (e.g. invalid email, missing required field).

NumberFormatExceptionJava

java.lang.NumberFormatException: For input string: "x"

A string couldn’t be parsed as a number — it’s empty, has spaces/commas, is too large, or isn’t numeric.

MethodArgumentNotValidExceptionJava

MethodArgumentNotValidException: Validation failed for argument [0]

Bean Validation (@Valid with @NotNull, @Email, @Size…) rejected the request body.

409HTTP

HTTP 409 Conflict

The request conflicts with the current state of the resource — e.g. a duplicate or an edit based on an outdated version.

read-only propertyJavaScript

TypeError: Cannot assign to read only property 'x' of object

Code tried to modify a frozen object, a getter-only property, or immutable state.

setState during renderReact

Warning: Cannot update a component (`Parent`) while rendering a different component (`Child`)

A child component updated a parent’s state during its render instead of in an effect or event handler.

Allowed memory size exhaustedPHP

PHP Fatal error: Allowed memory size of X bytes exhausted

The script tried to use more memory than PHP’s `memory_limit` allows.

Call to undefined functionPHP

PHP Fatal error: Uncaught Error: Call to undefined function

PHP can’t find the function you called — usually a missing extension, missing include, or namespace issue.

Cannot redeclarePHP

Fatal error: Cannot redeclare function foo() (previously declared in …)

The same function (or class) was defined twice — usually a file included more than once.

500HTTP

HTTP 500 Internal Server Error

The server hit an unexpected condition — usually an unhandled exception or misconfiguration in the application.

Call to member function on nullPHP

Fatal error: Uncaught Error: Call to a member function x() on null

Code called a method on a variable that is null instead of an object.

ArgumentCountErrorPHP

Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 1 passed and exactly 2 expected

A function was called with fewer arguments than it requires.

StringIndexOutOfBoundsExceptionJava

java.lang.StringIndexOutOfBoundsException: begin 0, end 10, length 5

substring()/charAt() used an index outside the string.

UnsupportedOperationExceptionJava

java.lang.UnsupportedOperationException (List.of / Arrays.asList is immutable)

Code tried to modify an immutable or fixed-size collection.

Stream closedJava

java.io.IOException: Stream closed

Code read or wrote a stream after it was closed — often by a try-with-resources block or a wrapper closing the underlying stream.

Array to string conversionPHP

Warning: Array to string conversion

An array was used where a string is expected — echoing it, concatenating it, or passing it to a string function.

Deprecated null to internalPHP

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated

PHP 8.1+ warns when null is passed to a built-in function that expects a string/int.

Dynamic property deprecatedPHP

Deprecated: Creation of dynamic property Foo::$bar is deprecated

PHP 8.2+ deprecates creating properties that aren’t declared in the class.

DateTimeParseExceptionJava

java.time.format.DateTimeParseException: Text '31/12/2024' could not be parsed at index 2

A java.time parse call got text that doesn’t match the expected format.

Unparseable dateJava

java.text.ParseException: Unparseable date: "x"

SimpleDateFormat couldn’t parse the string with its pattern.

InputMismatchExceptionJava

java.util.InputMismatchException (Scanner)

Scanner.nextInt()/nextDouble() read a token that isn’t that type.

redirect_uri_mismatchAuthentication

OAuth Error: redirect_uri_mismatch

The redirect URI in your OAuth request doesn’t exactly match one registered for the client in the provider’s console.

divergent branchesGit

hint: You have divergent branches and need to specify how to reconcile them.

Git 2.27+ asks you to choose merge, rebase or fast-forward-only when local and remote both have new commits.

gpg failed to signGit

error: gpg failed to sign the data — fatal: failed to write commit object

Commit signing is enabled but GPG couldn’t sign — no TTY for the passphrase, wrong key, or agent not running.

DEP0005Node.js

DeprecationWarning: Buffer() is deprecated due to security and usability issues (DEP0005)

Code (yours or a dependency) uses the deprecated new Buffer() constructor.

Cannot use object as arrayPHP

Fatal error: Uncaught Error: Cannot use object of type stdClass as array

Code used array syntax (`$x['key']`) on an object.

the attribute version is obsoleteDocker

WARN: the attribute `version` is obsolete, it will be ignored

A harmless Compose v2 warning: the top-level version: line in docker-compose.yml is no longer used.

SIGSEGVLinux

Segmentation fault (core dumped)

A program accessed memory it wasn’t allowed to, and the kernel killed it with SIGSEGV (exit code 139).

recovery modePostgreSQL

FATAL: the database system is in recovery mode

PostgreSQL crashed (often OOM-killed) and is replaying WAL to recover.

Illegal instructionLinux

Illegal instruction (core dumped) (SIGILL)

The program used a CPU instruction your processor doesn’t support — typically AVX/AVX2 in prebuilt binaries (TensorFlow, MongoDB…

TypeError: not a functionJavaScript

TypeError: x is not a function

You called something as a function, but its value is not a function (it’s undefined, a string, an object…).

ImportErrorPython

ImportError: cannot import name 'x' from 'y'

The module was found, but the name you’re importing from it doesn’t exist — usually a version change or a circular import.

KeyErrorPython

KeyError: 'x'

You accessed a dictionary key that doesn’t exist.