Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 400 Bad Request when no internet access on INFO_ORDER receipt (DE) #385

Open
MarkHaakman opened this issue Jan 23, 2025 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@MarkHaakman
Copy link

MarkHaakman commented Jan 23, 2025

Describe the bug

When I send an Info-order receipt for Germany (ftReceiptCase=4445000000000010) to the middleware with a Swissbit Cloud TSE while there is no active internet connection, the middleware responds with an HTTP 400 Bad Request instead of going in failed mode as described in https://docs.fiskaltrust.cloud/docs/poscreators/middleware-doc/general/cash-register-integration/failure-scenarios. Other receipts cases, such as Pos-receipt and Start-transaction-receipt, do correctly result in the middleware going to failed mode, with the caption in the signature "Kommunikation mit der technischen Sicherheitseinrichtung (TSE) fehlgeschlagen". I expected the same for the Info-order receipt.

When this is the correct behavior for this receipt case, I would expect another error message.

To Reproduce

The REST request I sent was (after disabling the internet connection):
POST 'http://localhost:14002/rest/json/v1/Sign' with body {"ftCashBoxID":"45e53699-7c88-4c07-bd92-babc3620d248","ftPosSystemId":"59fcf7a7-0c47-4592-ac67-832ba79aeee3","cbTerminalID":"MARK01","cbReceiptReference":"30f3c19f-bf04-4eed-b5ab-25e76c49193e","cbReceiptMoment":"2025-01-23T09:56:17.524Z","cbChargeItems":[{"Position":0,"Quantity":1.0,"Description":"1Euro","Amount":1.0,"VATRate":19.0,"ftChargeItemCase":4919338167972134929,"ftChargeItemCaseData":"{\"ProductGroupId\": \"000\"}","VATAmount":0.16,"AccountNumber":"","ProductGroup":"Algemeen","ProductNumber":"1Euro","ProductBarcode":"1Euro","Moment":"2025-01-23T09:56:18.745Z"}],"cbPayItems":[],"ftReceiptCase":4919338167972134928,"ftReceiptCaseData":"{\"UserId\": \"0\"}","cbUser":"Povis","cbArea":"Tafel 01"}

Exceptions (if any)

ApiCallResponseException{reasonPhrase='Bad Request', statusCode=400, responseBody='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Fout in aanvraag</title><style>BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; } #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; } A:link { color: #336699; font-weight: bold; text-decoration: underline; } A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; } A:active { color: #336699; font-weight: bold; text-decoration: underline; } .heading1 { background-color: #003366; border-bottom: #336699 6px solid; color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal;margin: 0em 0em 10px -20px; padding-bottom: 8px; padding-left: 30px;padding-top: 16px;} pre { font-size:small; background-color: #e5e5cc; padding: 5px; font-family: Courier New; margin-top: 0px; border: 1px #f0f0e0 solid; white-space: pre-wrap; white-space: -pre-wrap; word-wrap: break-word; } table { border-collapse: collapse; border-spacing: 0px; font-family: Verdana;} table th { border-right: 2px white solid; border-bottom: 2px white solid; font-weight: bold; background-color: #cecf9c;} table td { border-right: 2px white solid; border-bottom: 2px white solid; background-color: #e5e5cc;}</style></head><body><div id="content"><p class="heading1">Fout in aanvraag</p><p>Tijdens de verwerking van de aanvraag is een fout opgetreden op de server. Het uitzonderingsbericht is SQL logic errortable FailedFinishTransaction has no column named Request. Raadpleeg de serverlogboeken voor meer informatie. De stacktracering van de uitzondering is: </p><p> bij fiskaltrust.Middleware.Queue.SignProcessor.&lt;InternalSign&gt;d__15.MoveNext()--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()bij fiskaltrust.Middleware.Queue.SignProcessor.&lt;InternalSign&gt;d__15.MoveNext()--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)bij fiskaltrust.Middleware.Queue.SignProcessor.&lt;ProcessAsync&gt;d__14.MoveNext()--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()bij fiskaltrust.Middleware.QueueSynchronizer.LocalQueueSynchronizationDecorator.&lt;ProcessReceipts&gt;d__6.MoveNext()--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()bij fiskaltrust.Middleware.QueueSynchronizer.LocalQueueSynchronizationDecorator.&lt;ProcessAsync&gt;d__5.MoveNext()--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)bij fiskaltrust.Middleware.Queue.Queue.&lt;SignAsync&gt;d__17.MoveNext()--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)bij System.ServiceModel.Dispatcher.TaskMethodInvoker.&lt;InvokeAsync&gt;d__16.MoveNext()--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)bij System.ServiceModel.Dispatcher.TaskMethodInvoker.InvokeEnd(Object instance, Object[]&amp; outputs, IAsyncResult result)bij System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc&amp; rpc)bij System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc&amp; rpc)bij System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</p></div></body></html>'}

The relevant part of the exception seems to be SQL logic errortable FailedFinishTransaction has no column named Request.

An unrelated question I have is whether it is possible to leave out the CSS in the API error response, to make the errors more readable in the logs.

Further technical details & context

  • Version of the Middleware Launcher: Version 1
  • Configuration, e.g. used packages and versions: fiskaltrust.Middleware.Queue.SQLite (1.3.66), fiskaltrust.Middleware.SCU.DE.SwissbitCloud (1.3.66)
  • Operating system: Windows
@MarkHaakman MarkHaakman added the bug Something isn't working label Jan 23, 2025
@forsthug forsthug self-assigned this Jan 27, 2025
@forsthug
Copy link
Contributor

Hi @MarkHaakman, thank you for reporting this issue. We found the course and will provide a fix in the next release. We will keep you posted. Best regards Gerti

@forsthug
Copy link
Contributor

forsthug commented Jan 28, 2025

HI @MarkHaakman, in sandbox this version should fix the error. The production release will follow end of this week. When changing version rebuild of configuration is needed. Feel free to reach out if you encounter further issues.

Image

@MarkHaakman
Copy link
Author

@forsthug I just tested the SQLite version you specified and it seems to work great!

@StefanKert StefanKert added this to the Next milestone milestone Jan 29, 2025
forsthug added a commit that referenced this issue Feb 4, 2025
…en-no-internet-access-on-INFO_ORDER-receipt

#385 http 400 bad request when no internet access on info order receipt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants