Skip to content

Error "unsupported Unicode escape sequence" after update  #358

@kolyanet

Description

@kolyanet

I had Hangfire.AspNetCore 1.7.36 and Hangfire.PostgreSql 1.19.12. Then I updated to Hangfire.AspNetCore 1.8.12 and Hangfire.PostgreSql 1.20.8 and I get an error.

System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3 | 
Error while executing install/upgrade | 
Npgsql.PostgresException (0x80004005): 22P05: unsupported Unicode escape sequence

DETAIL: \u0000 cannot be converted to text.
   at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
   at Npgsql.NpgsqlDataReader.NextResult()
   at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteNonQuery()
   at Hangfire.PostgreSql.PostgreSqlObjectsInstaller.Install(NpgsqlConnection connection, String schemaName)
  Exception data:
    Severity: ERROR
    SqlState: 22P05
    MessageText: unsupported Unicode escape sequence
    Detail: \u0000 cannot be converted to text.
    Where: JSON data, line 1: ...ed to the next search result","ExceptionDetails":...
    File: json.c
    Line: 882
    Routine: json_lex_string Severity: ERROR;InvariantSeverity: ERROR;SqlState: 22P05;MessageText: unsupported Unicode escape sequence;Detail: \u0000 cannot be converted to text.;Where: JSON data, line 1: ...ed to the next search result","ExceptionDetails":...;File: json.c;Line: 882;Routine: json_lex_string

I discovered that in the "state" table there is an entry with "name" equal to "Failed". In the "data" column

{
   "FailedAt":"2023-10-31T09:50:10.5272314Z",
   "ExceptionType":"System.InvalidOperationException",
   "ExceptionMessage":"Failed to proceed to the next search result",
   "ExceptionDetails":"System.InvalidOperationException: Failed to proceed to the next search result\n ---> LdapException: Operations Error (1) Operations Error\nLdapException: Server Message: 000004DC: LdapErr: DSID-0C090A71, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v3839\u0000\nLdapException: Matched DN: \n   --- End of inner exception stack trace"
}

The \u0000 character is in the ExceptionDetails line

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions