Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Posting addresses ends up in 500 Server Error #174

Open
KoenBrouwer opened this issue Nov 24, 2021 · 1 comment
Open

Posting addresses ends up in 500 Server Error #174

KoenBrouwer opened this issue Nov 24, 2021 · 1 comment

Comments

@KoenBrouwer
Copy link

KoenBrouwer commented Nov 24, 2021

Describe the bug
Posting addresses ends up in 500 Server Error

To Reproduce
Execute this HTTP request to the contactcatalogus:
(In my case it's running on port 8006)

POST http://localhost:8006/addresses
Accept: application/json
Content-Type: application/json
Authorization: 45c1a4b6-59d3-4a6e-86bf-88a872f35845

{
  "street": "Teststraat",
  "houseNumber": "123A",
  "postalCode": "9999ZZ",
  "locality": "Sloothuizen"
}

Expected behavior
A 201 Created is exepected.

Additional context
Total output:

POST http://localhost:8006/addresses

HTTP/1.1 500 Internal Server Error
Server: nginx/1.21.3
Content-Type: application/problem+json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/7.4.8
Set-Cookie: PHPSESSID=j1213ingmuiae3vvrna5a7clqm; path=/; HttpOnly; SameSite=lax
X-Content-Type-Options: nosniff
X-Frame-Options: deny
Cache-Control: max-age=0, must-revalidate, private
Date: Wed, 24 Nov 2021 09:44:18 GMT
X-Debug-Token: 8ddda1
X-Debug-Token-Link: http://localhost:8006/_profiler/8ddda1
X-Robots-Tag: noindex
Link: <http://localhost:8006/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
X-Previous-Debug-Token: a57290
Expires: Wed, 24 Nov 2021 09:44:18 GMT

{
  "type": "https:\/\/tools.ietf.org\/html\/rfc2616#section-10", "title": "An error occurred", "detail": "Invalid key length.", "trace": [
  {
	"namespace": "",
	"short_class": "",
	"class": "",
	"type": "",
	"function": "",
	"file": "\/srv\/api\/vendor\/web-token\/jwt-framework\/src\/SignatureAlgorithm\/HMAC\/HS256.php",
	"line": 38,
	"args": []
  },
  {
	"namespace": "Jose\\Component\\Signature\\Algorithm",
	"short_class": "HS256",
	"class": "Jose\\Component\\Signature\\Algorithm\\HS256",
	"type": "->",
	"function": "getKey",
	"file": "\/srv\/api\/vendor\/web-token\/jwt-framework\/src\/SignatureAlgorithm\/HMAC\/HMAC.php",
	"line": 36,
	"args": [["object", "Jose\\Component\\Core\\JWK"]]
  },
  {
	"namespace": "Jose\\Component\\Signature\\Algorithm",
	"short_class": "HMAC",
	"class": "Jose\\Component\\Signature\\Algorithm\\HMAC",
	"type": "->",
	"function": "hash",
	"file": "\/srv\/api\/vendor\/web-token\/jwt-framework\/src\/Component\/Signature\/JWSBuilder.php",
	"line": 170,
	"args": [
	  ["object", "Jose\\Component\\Core\\JWK"],
	  [
		"string",
		"eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIiLCJpYXQiOjE2Mzc3NDcwNTgsImNsaWVudF9pZCI6IiIsInVzZXJfaWQiOiJjb250YWN0Y2F0YWxvZ3VzIiwidXNlcl9yZXByZXNlbnRhdGlvbiI6ImNvbnRhY3RjYXRhbG9ndXMifQ"
	  ]
	]
  },
  {
	"namespace": "Jose\\Component\\Signature",
	"short_class": "JWSBuilder",
	"class": "Jose\\Component\\Signature\\JWSBuilder",
	"type": "->",
	"function": "build",
	"file": "\/srv\/api\/vendor\/conduction\/commongroundbundle\/Service\/AuthenticationService.php",
	"line": 111,
	"args": []
  },
  {
	"namespace": "Conduction\\CommonGroundBundle\\Service",
	"short_class": "AuthenticationService",
	"class": "Conduction\\CommonGroundBundle\\Service\\AuthenticationService",
	"type": "->",
	"function": "getJwtToken",
	"file": "\/srv\/api\/vendor\/conduction\/commongroundbundle\/Service\/AuthenticationService.php",
	"line": 125,
	"args": [
	  [
		"array",
		{
		  "location": ["string", "https:\/\/nrc.zuid-drecht.nl"],
		  "auth": ["string", "jwt"],
		  "id": ["string", ""],
		  "secret": ["string", ""],
		  "accept": ["string", "application\/json"],
		  "autowire": ["boolean", false],
		  "code": ["string", "nrc"]
		}
	  ]
	]
  },
  {
	"namespace": "Conduction\\CommonGroundBundle\\Service",
	"short_class": "AuthenticationService",
	"class": "Conduction\\CommonGroundBundle\\Service\\AuthenticationService",
	"type": "->",
	"function": "setAuthorization",
	"file": "\/srv\/api\/vendor\/conduction\/commongroundbundle\/Service\/CommonGroundService.php",
	"line": 612,
	"args": [
	  [
		"array",
		{
		  "body": [
			"string",
			"{\"action\":\"Create\",\"topic\":\"contactcatalogus\\\/addresses\",\"resource\":\"http:\\\/\\\/localhost\\\/addresses\\\/cbaaa290-bfcd-4669-ad05-1b1d3331e199\"}"
		  ],
		  "headers": [
			"array",
			{
			  "Accept": ["string", "application\/json"],
			  "Content-Type": ["string", "application\/json"],
			  "Authorization": ["string", "45c1a4b6-59d3-4a6e-86bf-88a872f35845"],
			  "Accept-Crs": ["string", "EPSG:4326"],
			  "Content-Crs": ["string", "EPSG:4326"]
			}
		  ],
		  "auth": ["boolean", false],
		  "http_errors": ["boolean", true]
		}
	  ],
	  [
		"array",
		{
		  "location": ["string", "https:\/\/nrc.zuid-drecht.nl"],
		  "auth": ["string", "jwt"],
		  "id": ["string", ""],
		  "secret": ["string", ""],
		  "accept": ["string", "application\/json"],
		  "autowire": ["boolean", false],
		  "code": ["string", "nrc"]
		}
	  ]
	]
  },
  {
	"namespace": "Conduction\\CommonGroundBundle\\Service",
	"short_class": "CommonGroundService",
	"class": "Conduction\\CommonGroundBundle\\Service\\CommonGroundService",
	"type": "->",
	"function": "createResource",
	"file": "\/srv\/api\/vendor\/conduction\/commongroundbundle\/Subscriber\/ResourceSubscriber.php",
	"line": 102,
	"args": [
	  [
		"array",
		{
		  "action": ["string", "Create"],
		  "topic": ["string", "contactcatalogus\/addresses"],
		  "resource": ["string", "http:\/\/localhost\/addresses\/cbaaa290-bfcd-4669-ad05-1b1d3331e199"]
		}
	  ],
	  ["array", {"component": ["string", "nrc"], "type": ["string", "notifications"]}],
	  ["boolean", false],
	  ["boolean", true],
	  ["boolean", false]
	]
  },
  {
	"namespace": "Conduction\\CommonGroundBundle\\Subscriber",
	"short_class": "ResourceSubscriber",
	"class": "Conduction\\CommonGroundBundle\\Subscriber\\ResourceSubscriber",
	"type": "->",
	"function": "notify",
	"file": "\/srv\/api\/vendor\/symfony\/event-dispatcher\/Debug\/WrappedListener.php",
	"line": 117,
	"args": [
	  ["object", "Symfony\\Component\\HttpKernel\\Event\\ViewEvent"],
	  ["string", "kernel.view"],
	  ["object", "Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher"]
	]
  },
  {
	"namespace": "Symfony\\Component\\EventDispatcher\\Debug",
	"short_class": "WrappedListener",
	"class": "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener",
	"type": "->",
	"function": "__invoke",
	"file": "\/srv\/api\/vendor\/symfony\/event-dispatcher\/EventDispatcher.php",
	"line": 230,
	"args": [
	  ["object", "Symfony\\Component\\HttpKernel\\Event\\ViewEvent"],
	  ["string", "kernel.view"],
	  ["object", "Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher"]
	]
  },
  {
	"namespace": "Symfony\\Component\\EventDispatcher",
	"short_class": "EventDispatcher",
	"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
	"type": "->",
	"function": "callListeners",
	"file": "\/srv\/api\/vendor\/symfony\/event-dispatcher\/EventDispatcher.php",
	"line": 59,
	"args": [
	  [
		"array",
		[
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"],
		  ["object", "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener"]
		]
	  ],
	  ["string", "kernel.view"],
	  ["object", "Symfony\\Component\\HttpKernel\\Event\\ViewEvent"]
	]
  },
  {
	"namespace": "Symfony\\Component\\EventDispatcher",
	"short_class": "EventDispatcher",
	"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
	"type": "->",
	"function": "dispatch",
	"file": "\/srv\/api\/vendor\/symfony\/event-dispatcher\/Debug\/TraceableEventDispatcher.php",
	"line": 151,
	"args": [["object", "Symfony\\Component\\HttpKernel\\Event\\ViewEvent"], ["string", "kernel.view"]]
  },
  {
	"namespace": "Symfony\\Component\\EventDispatcher\\Debug",
	"short_class": "TraceableEventDispatcher",
	"class": "Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher",
	"type": "->",
	"function": "dispatch",
	"file": "\/srv\/api\/vendor\/symfony\/http-kernel\/HttpKernel.php",
	"line": 162,
	"args": [["object", "Symfony\\Component\\HttpKernel\\Event\\ViewEvent"], ["string", "kernel.view"]]
  },
  {
	"namespace": "Symfony\\Component\\HttpKernel",
	"short_class": "HttpKernel",
	"class": "Symfony\\Component\\HttpKernel\\HttpKernel",
	"type": "->",
	"function": "handleRaw",
	"file": "\/srv\/api\/vendor\/symfony\/http-kernel\/HttpKernel.php",
	"line": 79,
	"args": [["object", "Symfony\\Component\\HttpFoundation\\Request"], ["integer", 1]]
  },
  {
	"namespace": "Symfony\\Component\\HttpKernel",
	"short_class": "HttpKernel",
	"class": "Symfony\\Component\\HttpKernel\\HttpKernel",
	"type": "->",
	"function": "handle",
	"file": "\/srv\/api\/vendor\/symfony\/http-kernel\/Kernel.php",
	"line": 199,
	"args": [["object", "Symfony\\Component\\HttpFoundation\\Request"], ["integer", 1], ["boolean", true]]
  },
  {
	"namespace": "Symfony\\Component\\HttpKernel",
	"short_class": "Kernel",
	"class": "Symfony\\Component\\HttpKernel\\Kernel",
	"type": "->",
	"function": "handle",
	"file": "\/srv\/api\/public\/index.php",
	"line": 25,
	"args": [["object", "Symfony\\Component\\HttpFoundation\\Request"]]
  }
]
}

Response code: 500 (Internal Server Error); Time: 2594ms; Content length: 7472 bytes

Reference to this issue in our GitLab: https://gitlab.com/commonground/huishoudboekje/app-new/-/issues/687

@rjzondervan
Copy link
Contributor

Hi Koen,

This seems to be a problem in sending a notification to the notification service. The configured notification service seems to be a service that is no longer there. Is this a local install or a k8s installation of the contactcatalogus?

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

No branches or pull requests

2 participants