btcpayserver / btcpayserver-plugins

A repository storing verified BTCPay Server Plugins.
https://btcpayserver.org
19 stars 5 forks source link

[bug] tickettailor - some tickets are not being issued #35

Open albjeremias opened 2 years ago

albjeremias commented 2 years ago

tickettailor was working ok. some tickets are not being issued...

The user gets stuck with this message: image

On the server we can observe this error: image

Also when going around in the btcpayserver ui, found out this error on the webhooks tab image

albjeremias commented 2 years ago

it seems its not all the tickets.. but only some.. they appear as settled.. but then it won't ever issue the ticket. if there is more info i can provide feel free to request!

Kukks commented 2 years ago

Can you go to server logs and share any errors?

Kukks commented 2 years ago

I just tried to do a quick fix, pushed an update to the plugin. Can you try it out?

decentralizedb commented 2 years ago

I just tried to do a quick fix, pushed an update to the plugin. Can you try it out?

Hi, I'm the admin on the server, I'll try it out and let you know asap, tks.

decentralizedb commented 2 years ago

I updated the plugin to versión Ticktetailor v1.0.2.0. I stopped and started the BTCPayserver and I tried to redeliver the ticket that fails but seems like don't connect to BTCPayserver, in server logs, I didn't see anything after starting the server: ---------------------Server Log------------------------------------------- 2022-08-01 17:19:29.570 +02:00 [INF] Root Path: / 2022-08-01 17:19:30.448 +02:00 [INF] SSH settings detected, testing connection to decentralizedb@192.168.0.30 on port 22 ... 2022-08-01 17:19:30.490 +02:00 [INF] Starting listening NBXplorer (BTC) 2022-08-01 17:19:30.549 +02:00 [INF] Start watching invoices 2022-08-01 17:19:30.655 +02:00 [INF] Starting payment request expiration watcher 2022-08-01 17:19:30.804 +02:00 [INF] BTC: Checking if any pending invoice got paid while offline... 2022-08-01 17:19:30.917 +02:00 [INF] SSH connection succeeded 2022-08-01 17:19:30.952 +02:00 [INF] Starting 2022-08-01 17:19:30.952 +02:00 [INF] 0 pending payment requests being checked since last run 2022-08-01 17:19:31.012 +02:00 [INF] BTC: 0 payments happened while offline 2022-08-01 17:19:31.012 +02:00 [INF] Connected to WebSocket of NBXplorer (BTC) ------------------End Server Log ---------------------------------------------

On the client side I receive a message that says: Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request

Reason: Error reading from remote server Apache/2.4.52 (Ubuntu) Server at pagosinreglas.ddns.net Port 443 image

After that I tried to test the webhook and received a timeout error: InvoiceCreated event could not be delivered. Error message received: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.

image

Now I can't deliver any tickets, should I roll back to the previous version?

Kukks commented 2 years ago

Hi, can you try updating again?

decentralizedb commented 2 years ago

Hi, I tested the new version, and the webhook test and forwarding worked on one of the failed invoices. However, the ticket is still not generated. Any idea? Or because already marked as an error, a refund must be made? Or ticket must be issued manually within the Tickettailor system? In the image more details image image

decentralizedb commented 2 years ago

On BTCPayserver logs I can see this error message: -------------------------------------------------------------------- BTCPayserver log ----------------------------------------------------------- 2022-08-03 12:19:59.754 +02:00 [ERR] Failed to issue ticket BTCPayServer.Client.GreenfieldValidationException: Status: Status can only be marked to invalid or settled within certain conditions.

at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.HandleActionResult(IActionResult result) in /home/decentralizedb/btcpayserver/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 479 at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.GetFromActionResult[T](IActionResult result) in /home/decentralizedb/btcpayserver/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 466 at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.MarkInvoiceStatus(String storeId, String invoiceId, MarkInvoiceStatusRequest request, CancellationToken token) in /home/decentralizedb/btcpayserver/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 863 at BTCPayServer.Plugins.TicketTailor.TicketTailorService.ProcessEvents(CancellationToken cancellationToken) in C:\Git\btcpayserver\Plugins\BTCPayServer.Plugins.TicketTailor\TicketTailorService.cs:line 200 2022-08-03 12:20:05.861 +02:00 [ERR] Failed to issue ticket BTCPayServer.Client.GreenfieldValidationException: Status: Status can only be marked to invalid or settled within certain conditions.

at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.HandleActionResult(IActionResult result) in /home/decentralizedb/btcpayserver/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 479 at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.GetFromActionResult[T](IActionResult result) in /home/decentralizedb/btcpayserver/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 466 at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.MarkInvoiceStatus(String storeId, String invoiceId, MarkInvoiceStatusRequest request, CancellationToken token) in /home/decentralizedb/btcpayserver/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 863 at BTCPayServer.Plugins.TicketTailor.TicketTailorService.ProcessEvents(CancellationToken cancellationToken) in C:\Git\btcpayserver\Plugins\BTCPayServer.Plugins.TicketTailor\TicketTailorService.cs:line 200 -------------------------------------------------------------------- end BTCPayserver log -----------------------------------------------------------

decentralizedb commented 2 years ago

Due to that, the ticket remains with an error status in the Tickettailor system is not possible to issue it automatically from BTCPayserver. The ticket should be issued manually.

The message that is displayed now in the invoice error is: Error Ticket could not be created. You should refund customer. {"status":400, "error_code": "VALIDATION_ERROR", "message": "One or more fields failed validation", "errors":[{"field": "name", "messages":["Please enter a full name"]}]}]} image

The issue could be closed.

Kukks commented 2 years ago

Due to that, the ticket remains with an error status in the Tickettailor system is not possible to issue it automatically from BTCPayserver. The ticket should be issued manually.

The message that is displayed now in the invoice error is: Error Ticket could not be created. You should refund customer. {"status":400, "error_code": "VALIDATION_ERROR", "message": "One or more fields failed validation", "errors":[{"field": "name", "messages":["Please enter a full name"]}]}]} image

The issue could be closed.

Sorry, I missed this notification. Is there a name on the invoice buyer information? If there isn't, then the user tried to bypass the name entry which makes the ticket issuance invalid.

decentralizedb commented 2 years ago

Due to that, the ticket remains with an error status in the Tickettailor system is not possible to issue it automatically from BTCPayserver. The ticket should be issued manually. The message that is displayed now in the invoice error is: Error Ticket could not be created. You should refund customer. {"status":400, "error_code": "VALIDATION_ERROR", "message": "One or more fields failed validation", "errors":[{"field": "name", "messages":["Please enter a full name"]}]}]} image The issue could be closed.

Sorry, I missed this notification. Is there a name on the invoice buyer information? If there isn't, then the user tried to bypass the name entry which makes the ticket issuance invalid.

In the plugin, the fields force you to enter the information. However, I can see first-name filled correctly, but Last-name probably was filled with only three spaces. In the images, you can see what happened, as you can put three spaces and as is saved without it at checkout.

Could spaces be causing the problem?

image

image

Kukks commented 1 year ago

Yes, that's definitely the issue here. We only have some client-side validation currently.