-
Notifications
You must be signed in to change notification settings - Fork 0
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
Error while adding a Project via the API #5
Comments
Hi Peter, I have several questions regarding this issue:
When you say that the project "keeps hanging in this state", do you mean the "In progress" state? Would you like it to be in the "Not yet started" state? |
Could you try to create directly with the swagger by using the POST/core/Project with this file: I would like to know whether the problem comes from the file, the swagger or the client. |
Another possibility is that the swagger does not handle empty tables. { |
Hi Isabelle, Thanks for your reply so far. FYI: After some further investigations I think I now have a quite clear picture about where the errors come from (there are multiple different issues), but in order to prevent confusing communication, I'll dig to the bottom of it, provide a detailed list of scenarios and their effects. I'll also try to list possible solutions. But due to urgent other work that might take until the end of today or tomorrow. |
About your 1st question: that was just confusion from my side. I didn't realize that icons were used for the project state, and because indeed In progress didn't seem to match with the start and end date, I thought this was probably the state of saving the entry in the database. Not yet started would indeed be clearer, but that's a minor issue now that I understand what this state means. |
The 2nd issue is much more fundamental. You seem to work around the opensilexClientToolsPython library, which is why you see different things. But the nature of the problem is that I cannot do that from my code... By systematically trying a whole range of scenarios, I tried to get clear what is going on. See the attached Word document. It's good to be critical, because in the confusing range of things I tried, I might well have made some mistakes, but what it looks like is this:
Summarizing:
Regarding possible solutions:
The fact that even prefilled uri's don't work here is an issue in itself. I have to think if I can do anything to get more clarity on this, but it has probably to be debugged by the webservice-team. Attachment: |
Hi Peter, Thank you very much for the investigation. I struggle a bit to reproduce the errors. I'm testing in the demo instance that is in a later version. There seem to be a lot less issues and exceptions are not happening. `# TEST debug pythonClient = opensilexClientTools.ApiClient() |
To complete what Jean-Eudes said, we have just published a new release. I haven't had time to communicate on it yet, but you can find it here : https://github.com/OpenSILEX/opensilex/releases/tag/1.0.0-beta%2B2 You can update your instance with it. - Scripts for datafiles : |
Hi Jean-Eudes, Are you suggesting updating the clientTools or the PHIS-installation on the server? The clientTools seem to be the latest tagged version (opensilexClientToolsPython 2.0.0b0), so most likely that will not help. I'm not sure what version our PHIS-installation is, but I believe it's the beta release from April. Sven is currently handling these things, and because his time is limited it may take some time to update that version if there is a new one. But in the meantime, I'm a bit puzzled by your code because you refer to 'import opensilexClientTools.api'. I use opensilexClientToolsPython. Is that different? There are various clientTools in your repository and I cannot find one called opensilexClientTools. If i just rename the library in your code to opensilexClientToolsPython, I get an error: But is it an option that I redirect my own logic to your demo-installation and try it there? I already have a username password for it. I can cleanup what I add afterwards. I'm not planning any changes besides adding a Project and perhaps Facility. By the way, I've now tried to upload a lot of entity-types (most of them in a very basic way, without much associated entities) and most of that went ok. So the Project (Issue #5) and Facility (Issue #2) seem to be the only ones left that gives some problem. Next week, I'll try some more realistic scenarios. |
I was reffering updating the PHIS install with web services update. The web services handle these errors, as far as I see.
It's me sorry, I didn't use the correct spelling. Code stands up to date below. I'm sorry
This is the option I use, to make sure my test don't pollute any database. I can erase afterward. So maybe when you try figure out, what is the correct approach, you can also use this one. And finally when the solution suits you, use it on your local installation. `# TEST debug pythonClient = opensilexClientToolsPython.ApiClient() |
Ok, I'll try that, then I can cross-test various combinations of logic and installations and find out what caused the issue. |
Peter, |
Sorry, it appears that this was a bug at my side. Effectively, I sent a request without a body, which obviously made it impossible to store anything. Only thing at the PHIS-side is that it would be good to have a better error-handling. For that reason, I'll not yet close the issue myself, I'll leave it to the PHIS-team to look if anything can be improved and close the issue if you consider that appropriate. Regarding the new release as announced by Isabelle, I didn't yet try that, because I have to wait until Sven has time to install it. So it is possible that this version already fixes the issue, but I cannot yet test that. Up to this point, thanks for your help. |
Not sure what’s going on here.
When trying to add a Project like this:
I get an error like this:
(500) Reason: HTTP response headers: HTTPHeaderDict({'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'origin, content-type, accept, authorization', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS, HEAD', 'Vary': 'accept-encoding,accept-encoding', 'Content-Type': 'application/json', 'Content-Length': '5226', 'Date': 'Mon, 05 Jul 2021 12:35:14 GMT', 'Connection': 'close'}) HTTP response body: { "metadata" : { "pagination" : { "pageSize" : 0, "currentPage" : 0, "totalCount" : 0, "totalPages" : 0 }, "status" : [ ], "datafiles" : [ ] }, "result" : { "title" : "Unexpected internal error - java.lang.NullPointerException", "message" : null, "stack" : [ "org.opensilex.core.project.api.ProjectAPI.createProject(ProjectAPI.java:107)" ], "fullstack" : [ "org.opensilex.core.project.api.ProjectAPI.createProject(ProjectAPI.java:107)", "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)", "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)", "java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)", "java.base/java.lang.reflect.Method.invoke(Method.java:566)", "org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)", "org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)", "org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)", "org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)", "org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)", "org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469)", "org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391)", "org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80)", "org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)", "org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)", "org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)", "org.glassfish.jersey.internal.Errors.process(Errors.java:292)", "org.glassfish.jersey.internal.Errors.process(Errors.java:274)", "org.glassfish.jersey.internal.Errors.process(Errors.java:244)", "org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)", "org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)", "org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)", "org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)", "org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)", "org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)", "org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)", "org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)", "org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)", "org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)", "org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)", "org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)", "org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)", "org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)", "org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)", "org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)", "org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206)", "org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:295)", "org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)", "org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)", "org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)", "org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:552)", "org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)", "org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)", "org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)", "org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)", "org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)", "org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)", "org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)", "org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)", "org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)", "java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)", "java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)", "org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)", "java.base/java.lang.Thread.run(Thread.java:829)" ] } }
This time there is a manually generated uri. Some fields are not filled at all, but I tried all kinds of things and nothing helps.
The strange thing is: if I try to add (more or less) the same project via the web-interface, it keeps hanging in this state:
I have to say that both our PHIS installation and my download of the openClientTools might not be up to date. But this seems to be in the server logic.
The text was updated successfully, but these errors were encountered: