How to Fix : 42601: syntax error at or near "value" When Try To Access Hangfire Dashboard

huangapple go评论77阅读模式
英文:

How to Fix : 42601: syntax error at or near "value" When Try To Access Hangfire Dashboard

问题

I Use Hangfire With Postgresql Storage in .net-6.0 and install this package : Hangfire.PostgreSql version 1.9.10

This is My Code In Program.cs :

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddHangfire(config => config.UsePostgreSqlStorage(builder.Configuration.GetConnectionString("HangfireConnection")));
builder.Services.AddHangfireServer();

var app = builder.Build();

app.UseHangfireDashboard();

This is My Connection string in webconfig :

"ConnectionStrings": {
    "HangfireConnection": "Host=db1.motorazmasamin.com;Port=***;Database=Hangfire;Username=***;Password=***"
},

When Type Dashboard URL(http://localhost/hangfire) , Return This Error:

{"data":null,"status":-1,"message":"42601: syntax error at or near "value"\r\n\r\nPOSITION: 59","statusCode":"500"}

英文:

I Use Hangfire With Postgresql Storage in .net-6.0 and install this package : Hangfire.PostgreSql version 1.9.10

This is My Code In Program.cs :

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddHangfire(config => config.UsePostgreSqlStorage(builder.Configuration.GetConnectionString("HangfireConnection")));
builder.Services.AddHangfireServer();

var app = builder.Build();

app.UseHangfireDashboard();

This is My Connection string in webconfig :

    "ConnectionStrings": {
    "HangfireConnection": "Host=db1.motorazmasamin.com;Port=***;Database=Hangfire;Username=***;Password=***"
},

When Type Dashboard URL(http://localhost/hangfire) , Return This Error:

> {"data":null,"status":-1,"message":"42601: syntax error at or near "value"\r\n\r\nPOSITION: 59","statusCode":"500"}

Show Error Image in Visual Studio

But When Change Connection String to SQL Server and change Package To Hangfire.SqlServer , It's Correct!

答案1

得分: 1

这是1.9.10版本中的一个错误。以下是一些详细信息:https://github.com/hangfire-postgres/Hangfire.PostgreSql/pull/280/files

英文:

This was a bug at 1.9.10. Here are some details https://github.com/hangfire-postgres/Hangfire.PostgreSql/pull/280/files

huangapple
  • 本文由 发表于 2023年3月7日 16:45:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/75659694.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定