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

Test API service: INTERNAL_SERVER_ERROR #893

Closed
1 of 2 tasks
LukeHirst opened this issue Apr 29, 2022 · 22 comments
Closed
1 of 2 tasks

Test API service: INTERNAL_SERVER_ERROR #893

LukeHirst opened this issue Apr 29, 2022 · 22 comments

Comments

@LukeHirst
Copy link

Bug report

You must read the information below before you submit a bug report.

The MTD API team cannot help if your bug report is about:

  • Fraud Prevention Headers
  • Issues relating to OAuth2
  • Subscribing or registering to use the API Platform, MTD enrolment, de-enrolment, registration for VAT, Beta services, etc.
  • Issues integrating with the API Platform (e.g. setting up an application/access)
  • Code examples in a given programming language
  • Business-related questions or processes pre MTD
  • Scheduled maintenance windows and days
  • Onboarding (e.g. registering, obtaining keys)
  • Performance metrics

For any of the above, you must contact the Software Developer Support Team directly at SDSTeam@hmrc.gov.uk. The SDS Team do not monitor this repository.

This repository is for bug reports relating to VAT API code in this repository only.

Fill in the sections below to submit your bug report:

  • Documentation
  • API

Describe the bug
When submitting a VAT return within the sandbox an INTERNAL_SERVER_ERROR response is returned.

VRN and other data mentioned in this issue is for a test organisations so I haven't removed it

To Reproduce
Send a HTTP POST to following endpoint:

https://test-api.service.hmrc.gov.uk/organisations/vat/239746230/returns

With following request body:

{"periodKey":"18A2","vatDueSales":1905.64,"vatDueAcquisitions":0.00,"totalVatDue":1905.64,"vatReclaimedCurrPeriod":990.00,"netVatDue":915.64,"totalValueSalesExVAT":13598.0,"totalValuePurchasesExVAT":6467.0,"totalValueGoodsSuppliedExVAT":0.0,"totalAcquisitionsExVAT":0.0,"finalised":true}

Following response is returned:

{"code":"INTERNAL_SERVER_ERROR","message":"An internal server error occurred"}

Expected behavior
The VAT return to be submitted without error.
Workflow to return obligations and send fraud prevention headers works without error however the submission fails

Screenshots / Requests / Responses
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@LukeHirst
Copy link
Author

LukeHirst commented Apr 29, 2022

I have looked through the closed issues and seen this post:

/issues/873

I therefore tried to do a submission with an organisation created from the following URL:

https://developer.service.hmrc.gov.uk/api-test-user

I still get internal server error (endpoint, request body and response are below):

https://test-api.service.hmrc.gov.uk/organisations/vat/722605949/returns

{"periodKey":"18A2","vatDueSales":1905.64,"vatDueAcquisitions":0.00,"totalVatDue":1905.64,"vatReclaimedCurrPeriod":990.00,"netVatDue":915.64,"totalValueSalesExVAT":13598.0,"totalValuePurchasesExVAT":6467.0,"totalValueGoodsSuppliedExVAT":0.0,"totalAcquisitionsExVAT":0.0,"finalised":true}

{"code":"INTERNAL_SERVER_ERROR","message":"An internal server error occurred"}

I do have my own code to create an organisation which only adds the "mtd-vat" scope however this was previously working when we last tested using the sandbox.

@DDCTLS-DEV-TEAM
Copy link

Good Morning @LukeHirst

Apologies for the late reply on this one.
We would be more than happy to help get to the bottom of this one.
We have had a look at the errors in the sandbox environment and it looks like the only ones we are getting are Unauthorised insufficient enrolments or unsupported enrolments.

We have created a user with mtd-vat only and used your JSON above and it looks like it works for us. Could you do me a favor please and hit it again can you make a note of the exact time you hit it and hopefully we can narrow down your request and iron out this issue for you.

Kind Regards
DDCTLS Team

@LukeHirst
Copy link
Author

@DDCTLS-DEV-TEAM

It is still returning error 500, below is the correlationId which should unique to the request:

CorrelationId = d19a7cea-cf61-438b-b8fb-adfcd0693b46

Would this be good enough to track it?

@peckover
Copy link
Contributor

peckover commented May 11, 2022

Good morning Luke,

The correlationId was helpful, thank you. We have just pushed out a change that will hopefully solve your issue. Could you try again and see if the issue is resolved please?

Cheers,
Johnny
DDCTLS Team

@LukeHirst
Copy link
Author

@DDCTLS-DEV-TEAM Hello Johnny,

I am still get the error 500, correlation ID as below:

a8de603a-28c0-46ee-ab97-126322ff45a5

Is this fix conditional on creating a new organisation or something?

@peckover
Copy link
Contributor

Hi Luke
Thank you for the quick reply. We think we have identified a separate issue. We are working on this as a priority and will update when a new fix is out.
Cheers
Johnny
DDCTLS Team

@bcroston
Copy link

I'm also having exactly the same problem with a 500 error when submitting a return to the sandbox.

@DDCTLS-DEV-TEAM
Copy link

Good Morning @LukeHirst and @bcroston,

We have implemented a change that should fix the issue.
Can you please try again and update us.

Thank you in advance.

DDCTLS Team

@hmrc hmrc deleted a comment from DDCTLS-DEV-TEAM May 13, 2022
@bcroston
Copy link

I'm still getting the same 500 error

@DDCTLS-DEV-TEAM
Copy link

@bcroston Can you please provide correlation-id or VRN ?

@bcroston
Copy link

VRN ix 646015553
It's giving me a 500 error before I get a correlation-id

@DDCTLS-DEV-TEAM
Copy link

Hello @bcroston
Looking at the logs you are getting a 500 response when authenticating. This is most likely why you don't get to the correlation-id part of the vat-API service.

Can you confirm how you're setting up a user please and whether this has worked for you in the past?

Thank you in advance
DDCTLS Team

@bcroston
Copy link

I created the test user a long time ago (1 year plus) and can't remember doing it. I will create a new test user using the API and see what happens.

@DDCTLS-DEV-TEAM
Copy link

@bcroston thank you

@bcroston
Copy link

A new test user has fixed the problem for me.

@DDCTLS-DEV-TEAM
Copy link

@bcroston Happy to hear it.
Thank you for reaching out to us.

@LukeHirst do you have an update on your side?

Thank you in advance
DDCTLS Team

@LukeHirst
Copy link
Author

@DDCTLS-DEV-TEAM I have regenerated my user from both website and my own test program but still get internal server error, correlation ID as below:

624f2da2-4ccd-48be-a1f7-d9245598dad2

@DDCTLS-DEV-TEAM
Copy link

Hello @LukeHirst ,

Can you tell us the headers you are using please?

Thank you

@LukeHirst
Copy link
Author

LukeHirst commented May 13, 2022

@DDCTLS-DEV-TEAM

I am using the following URL:

https://test-api.service.hmrc.gov.uk/organisations/vat/589531983/returns

Headers:

  • Authorization = Bearer VALIDTOKEN
  • Accept = {application/vnd.hmrc.1.0+json}
  • Gov-Test-Scenario = ""

I am also sending fraud prevention headers however I am not sure if it's relevant to list them as we don't usually get a response about them on this github

@LukeHirst
Copy link
Author

@DDCTLS-DEV-TEAM

I have managed to submit a return successfully by removing the blank Gov-Test-Scenario header. This used to work previously with an empty string but now needs to be omitted if there is no value

@DDCTLS-DEV-TEAM
Copy link

@LukeHirst
Perfect we were about to suggest "-" on the Gov-Test-Scenario header.
If you would like to try that as well that would work too. (Or should)
If you are happy we will close the issue?
Thank you.
DDCTLS Team

@LukeHirst
Copy link
Author

LukeHirst commented May 13, 2022

Yes, I have closed this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants