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

Download Profile Summaries by Department throws exception when downloading with 0 associated individuals. #461

Open
1 task done
kaladay opened this issue Jan 23, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@kaladay
Copy link

kaladay commented Jan 23, 2025

  1. What is the type of this issue?
    • Operational

When a probile, such as say Lubbock, is selected, there are no individuals/people associated.
The zip returned should likely be an empty zip file.
However, rather than returning an empty zip file, an error is thrown on the back end.
No error is printed on the front-end (but one does appear in the console log).

The back end probably should be fixed to handle cases where there is no array result (perform appropriate NULL checks).

The following is the error from the back end.

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.isArray()" because "reference" is null] with root cause

java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.isArray()" because "reference" is null
	at edu.tamu.scholars.middleware.export.service.AbstractDocxExporter.extractIds(AbstractDocxExporter.java:145) ~[classes/:na]
	at edu.tamu.scholars.middleware.export.service.ZipDocxExporter.lambda$streamIndividual$1(ZipDocxExporter.java:91) ~[classes/:na]
	at org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBodyReturnValueHandler$StreamingResponseBodyTask.call(StreamingResponseBodyReturnValueHandler.java:111) ~[spring-webmvc-5.3.27.jar:5.3.27]
	at org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBodyReturnValueHandler$StreamingResponseBodyTask.call(StreamingResponseBodyReturnValueHandler.java:98) ~[spring-webmvc-5.3.27.jar:5.3.27]
	at org.springframework.web.context.request.async.WebAsyncManager.lambda$startCallableProcessing$4(WebAsyncManager.java:337) ~[spring-web-5.3.27.jar:5.3.27]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[na:na]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

The front end console error shows

{
  "headers": {
    "normalizedNames": {},
    "lazyUpdate": null
  },
  "status": 500,
  "statusText": "OK",
  "url": "http://localhost:9000/individual/n0e8d3d7e/export?type=zip&name=Last%205%20Years",
  "ok": false,
  "name": "HttpErrorResponse",
  "message": "Http failure response for http://localhost:9000/individual/n0e8d3d7e/export?type=zip&name=Last%205%20Years: 500 OK",
  "error": {}
}
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
Status: 📋 Backlog
Development

No branches or pull requests

2 participants