问:
*unrelated to my classes* java.lang.IllegalStateException: Cannot create a session after the response has been committed
I know this kind of question is quite present on StackOverflow, but I cannot find a case similar to mine, so please read along.

The stacktrace does not contain at all any of my classes, but only java, org.apache or org.sprintframework related classes.

I know for sure that the error is caused by a valid client, making requests every 15 seconds, but I cannot obtain the same result in any environment that isn't production, probably because of some specific characteristics (Headers, probably) on the specific client, that I cannot access.

I need some clues to what to look for in my classes to at least capture the exception, if not solving it at all.

```<code>2022-12-16 14:41:17.625 ERROR 2111869 --- [nio-8889-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Cannot create a session after the response has been committed] with root cause

java.lang.IllegalStateException: Cannot create a session after the response has been committed
    at org.apache.catalina.connector.Request.doGetSession(Request.java:2983) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.connector.Request.getSession(Request.java:2416) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:908) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.context.request.ServletRequestAttributes.getSession(ServletRequestAttributes.java:116) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.context.request.ServletRequestAttributes.obtainSession(ServletRequestAttributes.java:138) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.context.request.ServletRequestAttributes.setAttribute(ServletRequestAttributes.java:181) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.bind.support.DefaultSessionAttributeStore.storeAttribute(DefaultSessionAttributeStore.java:55) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.method.annotation.SessionAttributesHandler.lambda$storeAttributes$0(SessionAttributesHandler.java:117) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:na]
    at org.springframework.web.method.annotation.SessionAttributesHandler.storeAttributes(SessionAttributesHandler.java:115) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.method.annotation.ModelFactory.updateModel(ModelFactory.java:197) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.getModelAndView(RequestMappingHandlerAdapter.java:1001) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:897) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:394) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
</code>```

Body:
I know this kind of question is quite present on StackOverflow, but I cannot find a case similar to mine, so please read along.

The stacktrace does not contain at all any of my classes, but only java, org.apache or org.sprintframework related classes.

I know for sure that the error is caused by a valid client, making requests every 15 seconds, but I cannot obtain the same result in any environment that isn't production, probably because of some specific characteristics (Headers, probably) on the specific client, that I cannot access.

I need some clues to what to look for in my classes to at least capture the exception, if not solving it at all.

2022-12-16 14:41:17.625 ERROR 2111869 --- [nio-8889-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Cannot create a session after the response has been committed] with root cause

java.lang.IllegalStateException: Cannot create a session after the response has been committed
    at org.apache.catalina.connector.Request.doGetSession(Request.java:2983) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.connector.Request.getSession(Request.java:2416) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:908) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.context.request.ServletRequestAttributes.getSession(ServletRequestAttributes.java:116) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.context.request.ServletRequestAttributes.obtainSession(ServletRequestAttributes.java:138) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.context.request.ServletRequestAttributes.setAttribute(ServletRequestAttributes.java:181) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.bind.support.DefaultSessionAttributeStore.storeAttribute(DefaultSessionAttributeStore.java:55) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.method.annotation.SessionAttributesHandler.lambda$storeAttributes$0(SessionAttributesHandler.java:117) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:na]
    at org.springframework.web.method.annotation.SessionAttributesHandler.storeAttributes(SessionAttributesHandler.java:115) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.method.annotation.ModelFactory.updateModel(ModelFactory.java:197) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.getModelAndView(RequestMappingHandlerAdapter.java:1001) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:897) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) ~[spring-webmvc-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:394) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
    at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]


来源: stackexchange

问:
Android xamarin MVVM device PM451 barcode scanner
have any of you written a PM451 scanner handler or similar to handle the barcode scanner read event call in android xamarin MVVM.  Unfortunately I am not able to handle this device. I would greatly appreciate your help.

Operation of a barcode scanner

ContentLicense: CC BY-SA 4.0


问:
Fix wrong names in rows of two dataframes
I have two dataframes that should have the same number of rows and the same cities names inside each row.
However, the names of the cities in a df have different spellings.
For example, a city is called "Aglie" in one and in the other it is called "Agliè"; in a df appear cities names with alternative names in German, as in "Fortezza/Franzensfeste".

Clearly there is a utf-8 encoding error. The pattern of these errors are of two kinds:

There are slashes (/) after the official name suggesting alternative names in german,

Names ending in à, è, ì, ù appear with a', e', i', u',

My problem to solve is how to arrange these names in the dataframe (there are 271 wrong names). How could I code in python using pandas to fix these wrong cities names in order to make both names of the cities equals?

I wrote this code, however it does anything in my code:

```<code>for city in df1['NOM_COM']:
    if city.endswith("a'"):
        a = city.replace("a'", "à", -1)
    elif city.endswith("e'"):
        e = city.replace("e'", "è", -1)
    elif city.endswith("i'"):
        i = city.replace("i'", "ì", -1)
    elif city.endswith("o'"):
        o = city.replace("o'", "ò", -1)
    elif city.endswith("u'"):
        u = city.replace("u'", "ù", -1)
    else:
        pass
</code>```

The variables don't make any change in my df. Where am I wrong?

Body:
I have two dataframes that should have the same number of rows and the same cities names inside each row.
However, the names of the cities in a df have different spellings.
For example, a city is called "Aglie" in one and in the other it is called "Agliè"; in a df appear cities names with alternative names in German, as in "Fortezza/Franzensfeste".

Clearly there is a utf-8 encoding error. The pattern of these errors are of two kinds:

There are slashes (/) after the official name suggesting alternative names in german,

Names ending in à, è, ì, ù appear with a', e', i', u',

My problem to solve is how to arrange these names in the dataframe (there are 271 wrong names). How could I code in python using pandas to fix these wrong cities names in order to make both names of the cities equals?

I wrote this code, however it does anything in my code:

for city in df1['NOM_COM']:
    if city.endswith("a'"):
        a = city.replace("a'", "à", -1)
    elif city.endswith("e'"):
        e = city.replace("e'", "è", -1)
    elif city.endswith("i'"):
        i = city.replace("i'", "ì", -1)
    elif city.endswith("o'"):
        o = city.replace("o'", "ò", -1)
    elif city.endswith("u'"):
        u = city.replace("u'", "ù", -1)
    else:
        pass

The variables don't make any change in my df. Where am I wrong?


问:
Custom date selector in android
I want to implement date selector like this in my app but I don't know how to do it I have searched a lot but couldn't find any solution
enter image description here

I tried different libraries but can not achieve the exact output

Title: Custom date selector in android


问:
How to call C function from Matlab that return enum type data?
I try to work with C DLL for a camera (SDK here https://astronomy-imaging-camera.com/software-drivers) in Matlab 2021b with MinGV compiler.
Functions that have numeric arguments and pointers to it works fine. For example:

```<code>if not(libisloaded('ASICamera2'))
    loadlibrary('ASICamera2')
end
iCameraID = int32(0); % set camera ID to 0
calllib('ASICamera2','ASIOpenCamera', iCameraID) % Open camera
calllib('ASICamera2','ASIInitCamera', iCameraID) % init camera
piNumberOfControls = libpointer('int32Ptr', iNumberOfControls)
calllib('ASICamera2','ASIGetNumOfControls', iCameraID, piNumberOfControls) % get the number of controls
</code>```

The problem appears when function argument is a pointer to enum variable:

```<code>ASIGetControlValue
Syntax
ASI_ERROR_CODE ASIGetControlValue (int iCameraID, ASI_CONTROL_TYPE
ControlType, long *plValue, ASI_BOOL *pbAuto)
Usage
get a specific control type's value as currently set for a specific camera ID
Description
int iCameraID camera I D
ASI_CONTROL_TYPE ControlType control type
long *plValue pointer to the current value
ASI_BOOL *pbAuto return whether the control is auto adjusted
</code>```

where

```<code>typedef enum ASI_BOOL
{
ASI_FALSE =0,
ASI_TRUE
}ASI_BOOL; True or false
</code>```

How can I call such a function?

I tried to call

```<code>calllib('ASICamera2','ASIGetControlValue', iCameraID, ASI_CONTROL_TYPE.ASI_GAIN, pGain, pGainAuto)
</code>```

with various definitions for pGainAuto using libpointer, but the error appears:

```<code>Error using calllib
Pointer types must match data type.
</code>```

Body:
I try to work with C DLL for a camera (SDK here https://astronomy-imaging-camera.com/software-drivers) in Matlab 2021b with MinGV compiler.
Functions that have numeric arguments and pointers to it works fine. For example:

if not(libisloaded('ASICamera2'))
    loadlibrary('ASICamera2')
end
iCameraID = int32(0); % set camera ID to 0
calllib('ASICamera2','ASIOpenCamera', iCameraID) % Open camera
calllib('ASICamera2','ASIInitCamera', iCameraID) % init camera
piNumberOfControls = libpointer('int32Ptr', iNumberOfControls)
calllib('ASICamera2','ASIGetNumOfControls', iCameraID, piNumberOfControls) % get the number of controls

The problem appears when function argument is a pointer to enum variable:

ASIGetControlValue
Syntax
ASI_ERROR_CODE ASIGetControlValue (int iCameraID, ASI_CONTROL_TYPE
ControlType, long *plValue, ASI_BOOL *pbAuto)
Usage
get a specific control type's value as currently set for a specific camera ID
Description
int iCameraID camera I D
ASI_CONTROL_TYPE ControlType control type
long *plValue pointer to the current value
ASI_BOOL *pbAuto return whether the control is auto adjusted

where

typedef enum ASI_BOOL
{
ASI_FALSE =0,
ASI_TRUE
}ASI_BOOL; True or false

How can I call such a function?

I tried to call

calllib('ASICamera2','ASIGetControlValue', iCameraID, ASI_CONTROL_TYPE.ASI_GAIN, pGain, pGainAuto)

with various definitions for pGainAuto using libpointer, but the error appears:

Error using calllib
Pointer types must match data type.


问:
Wordpress on synology rest .api gives 401 error
I have Wordpress 5.8.3 (from package center) installed om my synology nas. Also installed "Application passwords" plugin to create passwords.

I created this simple python script:

```<code>import requests
import base64

wordpress_user = "blabla"
wordpress_password = "6xxx xxx xxxx xxxt xxx xxxx"
wordpress_credentials = wordpress_user + ":" + wordpress_password
wordpress_token = base64.b64encode(wordpress_credentials.encode())
wordpress_header = {'Authorization': 'Basic ' + wordpress_token.decode('utf-8')}

def read_wordpress_posts():
 api_url = 'http://192.xxx.x.x/wordpress/wp-json/wp/v2/posts'
 response = requests.get(api_url)
 response_json = response.json()
 print(response_json)

def create_wordpress_post():
 api_url = 'http://192.xxx.x.x/wordpress/wp-json/wp/v2/posts'
 data = {
   'title' : 'Example wordpress post',
   'status': 'publish',
   'slug' : 'example-post',
   'content': 'This is the content of the post'
 }
 response = requests.post(api_url,headers=wordpress_header, json=data)
 print(response)

#read_wordpress_posts()
create_wordpress_post()
</code>```

The read works but the create gives an 401 error
My nas uses an http connection

What could be the problem here?

Body:
I have Wordpress 5.8.3 (from package center) installed om my synology nas. Also installed "Application passwords" plugin to create passwords.

I created this simple python script:

import requests
import base64

wordpress_user = "blabla"
wordpress_password = "6xxx xxx xxxx xxxt xxx xxxx"
wordpress_credentials = wordpress_user + ":" + wordpress_password
wordpress_token = base64.b64encode(wordpress_credentials.encode())
wordpress_header = {'Authorization': 'Basic ' + wordpress_token.decode('utf-8')}

def read_wordpress_posts():
 api_url = 'http://192.xxx.x.x/wordpress/wp-json/wp/v2/posts'
 response = requests.get(api_url)
 response_json = response.json()
 print(response_json)

def create_wordpress_post():
 api_url = 'http://192.xxx.x.x/wordpress/wp-json/wp/v2/posts'
 data = {
   'title' : 'Example wordpress post',
   'status': 'publish',
   'slug' : 'example-post',
   'content': 'This is the content of the post'
 }
 response = requests.post(api_url,headers=wordpress_header, json=data)
 print(response)

#read_wordpress_posts()
create_wordpress_post()

The read works but the create gives an 401 error
My nas uses an http connection

What could be the problem here?


问:
MySQL auto increments ID reset after removing data from MySQL
I would like to reset MySQL auto increments ID after removing data from MySQL something like that always ID will keep 1,2,3,4,5,6,7,8,9,10. If i remove 4,5,6 ID data then ID will show 1,2,3,4,5,6,7 but not 1,2,3,7,8,9,10 So, the ID will work as serial number not unique ID for each data.

Something like the command but i want to excude the command by php or if have any option from the mysql dashboard

```<code>SET  @num := 0;

UPDATE your_table SET id = @num := (@num+1);

ALTER TABLE your_table AUTO_INCREMENT =1;
</code>```

I did try the command from php but now working!

Body:
I would like to reset MySQL auto increments ID after removing data from MySQL something like that always ID will keep 1,2,3,4,5,6,7,8,9,10. If i remove 4,5,6 ID data then ID will show 1,2,3,4,5,6,7 but not 1,2,3,7,8,9,10 So, the ID will work as serial number not unique ID for each data.

Something like the command but i want to excude the command by php or if have any option from the mysql dashboard

SET  @num := 0;

UPDATE your_table SET id = @num := (@num+1);

ALTER TABLE your_table AUTO_INCREMENT =1;

I did try the command from php but now working!


问:
While executing the stored procedure from backend(MSSQL 2012).Unable to open a few modules from pb12.5 desktop application
We have an stored procedure to transfer the data(contract data) from database 1 to database 2(interfacing with SAP to Intermeidate Database , then our database), and this contain loops and more that one table in the execution.And we have an PB12.5 desktop application with several modules like procurement,crewing, employee etc.The issue is here while executing the stored procedure from MSSQL using exec, it will take nearly 2 minutes depend on the recieved data from SAP.During the execution I'm unable to open procurement window and it is opening once the stored procedure completed the execution.The other side employee window is opening without any issue.The below are my findings/comments

Procurement module is using table1 and table2 , but in the stored procedure we are not using any of this tables.We are using table 3 and table 4(but later we will use the table from procurement module in proc)
2.While executing the proc Im able to select the tables from procurement module using select * from table1.
3.None of the table is locking from proc.
4.We have tried the same scenarios from different PC same issue exist.
5.Later we will extend the stored procedure with more tables and multiple loops(cursor)

Below are the small part of procedure(we have to extend more and it is hold now because of this issue)

Many thanks in advance.

```<code>
alter PROC [spectwosuite].[CST_GENERATE_IPurchase_contract]
as begin

SET NOCOUNT ON;
/**/

--truncate table spectwosuite.CUSTOM_SAP_CONTRACT_ITEM;
--truncate table spectwosuite.CUSTOM_SAP_CONTRACT_header;
--truncate table spectwosuite.CUSTOM_SAP_PROC_LOG;

--Variable declaration
DECLARE @MATERIALNO VARCHAR(20);
DECLARE @PURCHASEDOCNO VARCHAR(20);
DECLARE @PORTID NUMERIC(15);
DECLARE @PRICE DECIMAL(11,2);
DECLARE @PKID NUMERIC(16);

DECLARE @STOCKTYPEID NUMERIC(15);
DECLARE @STOCKTYPECODE VARCHAR(50);
DECLARE @STNAME VARCHAR(50);
DECLARE @UNITID NUMERIC(15);
DECLARE @BUSFLOWID NUMERIC(15);
DECLARE @BUSSTATUSID NUMERIC(15);

DECLARE @ITEMNO VARCHAR(5);
DECLARE @SUBITEMNO VARCHAR(10);
DECLARE @STOCKDISID NUMERIC(15);

DECLARE @PURCONTRACTID NUMERIC(15);
DECLARE @REVISIONNO NUMERIC(15);
DECLARE @DESCR NVARCHAR(100);
DECLARE @ADDRESSID NUMERIC(15);
DECLARE @DELTERMSID NUMERIC(15);
DECLARE @PAYTERMSID NUMERIC(15);
DECLARE @VALIDSTART DATETIME;
DECLARE @VALIDEND DATETIME;
DECLARE @CURRENCY NCHAR(3);
DECLARE @PRODUCTGROUPID NUMERIC(15);
DECLARE @PURCONTRACTPRODUCTGROUPID NUMERIC(15);
DECLARE @MATERIALGRP NVARCHAR(20);
DECLARE @NETPRICE NUMERIC(16,6);
DECLARE @BASEPRICE NUMERIC(16,6);
DECLARE @PRODUCTGROUPLINEID NUMERIC(15);
DECLARE @SECTION VARCHAR(20);
DECLARE @PUREXIST NUMERIC(1);
DECLARE @HEADERPKID NUMERIC(16);

DECLARE @ITEMPRICE NUMERIC(16,6);
DECLARE @BASEITEMPRICE NUMERIC(16,2);
DECLARE @PURCONTRACTVARIABLEID NUMERIC(15);
DECLARE @FACTORVALUE NUMERIC(9,4);
DECLARE @ITEMPERCENTAGE NUMERIC(15,2);
DECLARE @ITEMPRICEDIFF1 NUMERIC(15,2);
DECLARE @ITEMPRICEDIFF2 NUMERIC(15,2);
DECLARE @ITEMPKID NUMERIC(16);

/*CONT1: Transfering all the portid and purchase document number to different table */

--PRINT 'CONT1 START'
--PRINT GETDATE();

BEGIN TRY
--BEGIN TRANSACTION

--BEGIN
    SET @SECTION='CONT1';
        BEGIN TRANSACTION CONT1
            INSERT INTO SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_PORT
                       (PORTID
                       ,PURCHASE_DOC_NO
                        )

                SELECT DISTINCT PORTID,PURCHASE_DOC_NO FROM SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE IMPORT_STATUS IS NULL and DELETION_IND  NOT IN('L','1')
                and portid>0 and MATERIAL_NO<>''  and  FACTOR>0 and
                       not exists (select PORTID from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_PORT where PORTID=SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_PORT.PORTID
                       and PURCHASE_DOC_NO =SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_PORT.PURCHASE_DOC_NO) ORDER BY PURCHASE_DOC_NO,PORTID ASC;

        COMMIT TRANSACTION CONT1
--END

----INSERT INTO spectwosuite.CUSTOM_SAP_PROC_LOG
----           (STATUS
----           ,DESCRIPTION
----           ,PROCESSEDDATE
----           ,RECORDCOUNT)
----     VALUES
----           (1,
----           'CONT1'
----           ,GETDATE()
----           ,@@ROWCOUNT
----           );

--PRINT 'CONT1 END'
--PRINT GETDATE();
/* CONT1 END */

/*CONT2 Inserting new item which one dont have price in all ports*/

/*Variable declaration*/

--PRINT 'CONT2 START'
--PRINT GETDATE();

    --  BEGIN
                SET @SECTION='CONT2';

                --SELECT DISTINCT CAST(MATERIAL_NO AS VARCHAR(20))AS MATERIAL_NO,PURCHASE_DOC_NO FROM SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE  PURCHASE_DOC_NO='4600000820' and IMPORT_STATUS IS NULL  and MATERIAL_NO<>'' and DELETION_IND NOT IN('L','1') and len(material_no)>0 and factor>0 and portid>0 ORDER BY MATERIAL_NO,PURCHASE_DOC_NO ASC;
                DECLARE CONT2CR CURSOR FOR
                SELECT DISTINCT CAST(MATERIAL_NO AS VARCHAR(20))AS MATERIAL_NO,PURCHASE_DOC_NO FROM SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE IMPORT_STATUS IS NULL  and MATERIAL_NO<>'' and DELETION_IND NOT IN('L','1') and len(material_no)>0 and factor>0 and portid>0 ORDER BY MATERIAL_NO,PURCHASE_DOC_NO ASC;
                OPEN CONT2CR
                FETCH NEXT FROM CONT2CR INTO @MATERIALNO,@PURCHASEDOCNO

                WHILE @@FETCH_STATUS=0
                    BEGIN
                            BEGIN TRAN CONT2
                                        select @PKID=MIN(pk_id),@PRICE=MIN(NET_PRICE) from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE MATERIAL_NO=@MATERIALNO AND PURCHASE_DOC_NO=@PURCHASEDOCNO and  IMPORT_STATUS IS NULL and DELETION_IND NOT IN('L','1') and factor>0 and portid>0;
                                    /*Retreiving port details table*/
                                        DECLARE CONT2PORTCR CURSOR FOR
                                        SELECT DISTINCT portid FROM SAP_INTERFACE.spectwosuite.custom_sap_contract_port WITH(NOLOCK) WHERE (SAP_INTERFACE.spectwosuite.custom_sap_contract_port.purchase_doc_no = @PURCHASEDOCNO) and ( custom_sap_contract_port.portid > 0 )  ;
                                        OPEN CONT2PORTCR
                                        FETCH NEXT FROM CONT2PORTCR INTO @PORTID
                                        WHILE @PORTID>0
                                        BEGIN

                                            IF @PORTID>0
                                            BEGIN
                                                BEGIN TRAN
                                                    /*Insert Script*/
                                                    SET @SECTION='ITEM_ADDITION';

                                                    IF (select COUNT(*) from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) where  MATERIAL_NO=CAST(@MATERIALNO AS varchar(20)) AND PORTID=@PORTID and PURCHASE_DOC_NO=@PURCHASEDOCNO and IMPORT_STATUS IS NULL and DELETION_IND NOT IN('L','1') and factor>0 and portid>0)<=0
                                                    BEGIN
                                                        INSERT INTO SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM
                                                                                (DELETION_IND,PURCHASE_DOC_NO,ITEM_NO,MATERIAL_NO,SHORT_TEXT,MATERIAL_GRP,QTY,UOM,NET_PRICE,PORTID,TEMPPORTID,FACTOR)
                                                        select DELETION_IND,PURCHASE_DOC_NO,ITEM_NO,MATERIAL_NO,SHORT_TEXT,MATERIAL_GRP,QTY,UOM,NET_PRICE,@PORTID,1252,FACTOR  from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE pk_id=@PKID and DELETION_IND<>'1'  and IMPORT_STATUS IS NULL;
                                                    END

                                                    SET @PORTID=0;
                                                COMMIT TRAN
                                            END
                                            FETCH NEXT FROM CONT2PORTCR INTO @PORTID
                                        END
                                        CLOSE CONT2PORTCR
                                        DEALLOCATE CONT2PORTCR
                            COMMIT TRAN CONT2
                        FETCH NEXT FROM CONT2CR INTO @MATERIALNO,@PURCHASEDOCNO
                    END

                    CLOSE CONT2CR
                    DEALLOCATE CONT2CR

--END

--INSERT INTO spectwosuite.CUSTOM_SAP_PROC_LOG
--           (STATUS
--           ,DESCRIPTION
--           ,PROCESSEDDATE
--           ,RECORDCOUNT)
--     VALUES
--           (1,
--         'CONT2'
--         ,GETDATE()
--         ,@@ROWCOUNT
--         );

--PRINT 'CONT2 END'
--PRINT GETDATE();

/*CONT2 END*/

        /*CONT3*/

--PRINT 'CONT3 START'
--PRINT GETDATE();

SET @SECTION='CONT3';
            BEGIN TRAN CONT3
                INSERT INTO spectwosuite.CUSTOM_SAP_CONTRACT_HEADER
                           (TABLEPKID
                           ,PURCHASE_DOC_NO
                           ,COMPANY_CODE
                           ,CREATED_ON_DATE
                           ,VENDOR_CODE
                           ,PAYMENT_TERMS
                           ,PURCHASE_GRP
                           ,VALIDITY_START
                           ,VALIDITY_END
                           ,YOUR_REFERENCE
                           ,OUR_REFERNCE
                           ,TARGET_AMOUNT
                           ,CURRENCY
                           ,DESCRIPTION
                           ,SHIPCODE
                           ,STATUS
                           ,CREATEDATE
                           ,VALIDATESTART
                           ,VALIDATEEND
                           ,INTERNAL_STATUS
                           ,INTERNAL_MESSAGE
                           )
                    SELECT
                        PK_ID
                       ,PURCHASE_DOC_NO
                      ,COMPANY_CODE
                      ,CREATED_ON_DATE
                      ,VENDOR_CODE
                      ,PAYMENT_TERMS
                      ,PURCHASE_GRP
                      ,VALIDITY_START
                      ,VALIDITY_END
                      ,YOUR_REFERENCE
                      ,OUR_REFERNCE
                      ,TARGET_AMOUNT
                      ,CURRENCY
                      ,DESCRIPTION
                      ,SHIPCODE
                      ,STATUS
                      ,CREATEDATE
                      ,VALIDATESTART
                      ,VALIDATEEND
                      ,INTERNAL_STATUS
                      ,INTERNAL_MESSAGE
                  FROM SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_HEADER WITH(NOLOCK)
                  where import_status is null and purchase_doc_no<>'' and validity_start<>'' and validity_end<>'' and currency<>''and status>0
                  and not exists(select pk_id from spectwosuite.CUSTOM_SAP_CONTRACT_HEADER WHERE TABLEPKID= SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_HEADER.PK_ID)
            COMMIT TRAN CONT3
    --INSERT INTO spectwosuite.CUSTOM_SAP_PROC_LOG
 --          (STATUS
 --          ,DESCRIPTION
 --          ,PROCESSEDDATE
 --          ,RECORDCOUNT)
 --    VALUES
 --          (1,
    --     'CONT3'
    --     ,GETDATE()
    --     ,@@ROWCOUNT
    --     );

--PRINT 'CONT3 END'
--PRINT GETDATE();
        /*CONT3 END*/

        /*CONT4*/

--PRINT 'CONT4 START'
--PRINT GETDATE();
SET @SECTION='CONT4';
            BEGIN TRAN CONT4
                    INSERT INTO spectwosuite.CUSTOM_SAP_CONTRACT_ITEM
                               (TABLEPKID,PURCHASE_DOC_NO
                               ,ITEM_NO
                               ,DELETION_IND
                               ,MATERIAL_NO
                               ,SHORT_TEXT
                               ,MATERIAL_GRP
                               ,QTY
                               ,UOM
                               ,NET_PRICE
                               ,PORTID
                               ,STOCKTYPEID
                               ,INTERNAL_MESSAGE
                               ,INTERNAL_STATUS
                                ,CONTRACTTYPE
                                ,AGREEMENTSUBITEMNO
                                ,FACTOR
                    )

            select  PK_ID,PURCHASE_DOC_NO
                  ,ITEM_NO
                  ,DELETION_IND
                  ,MATERIAL_NO
                  ,SHORT_TEXT
                  ,MATERIAL_GRP
                  ,QTY
                  ,UOM
                  ,NET_PRICE
                  ,PORTID
                  ,STOCKTYPEID
                  ,INTERNAL_MESSAGE
                  ,INTERNAL_STATUS
                    ,CONTRACTTYPE
                    ,AGREEMENTSUBITEMNO
                    ,FACTOR
                      from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK)
                       where IMPORT_STATUS is null and MATERIAL_NO<>'' and DELETION_IND<>'L' AND PORTID>0 and FACTOR>0 and  LEN(SHORT_TEXT)>0 AND LEN(PURCHASE_DOC_NO)>0 AND
                       not exists (select PK_ID from spectwosuite.CUSTOM_SAP_CONTRACT_ITEM where TABLEPKID= SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM.PK_ID )  ORDER BY PK_ID ASC;
        COMMIT TRAN CONT4

--      /*Inserting History*/

--      /*Transfering process status to interface table.*/
    TRUNCATE TABLE spectwosuite.CUSTOM_SAP_CONTRACT_HEADER;
    TRUNCATE TABLE spectwosuite.CUSTOM_SAP_CONTRACT_ITEM;

    DELETE FROM spectwosuite.CUSTOM_SAP_PROC_LOG WHERE STATUS=99;
    COMMIT
--      /*PURCHASE CONTRACT CREATION END*/
--      SET NOCOUNT OFF;
--      --COMMIT TRANSACTION
END TRY
    BEGIN CATCH
        DECLARE @ERRORNUMBER VARCHAR(20);
        DECLARE @ERRMSG VARCHAR(MAX);
        SET @ERRORNUMBER=CAST(ERROR_LINE() AS VARCHAR(20));
        SET @ERRMSG=ERROR_MESSAGE();

        BEGIN TRAN ER
            INSERT INTO spectwosuite.CUSTOM_SAP_PROC_LOG
                   (STATUS
                   ,DESCRIPTION
                   ,PROCESSEDDATE
                   ,RECORDCOUNT
                   ,ERRORMSG)
             VALUES
                   (
                   88,
                   @SECTION
                   ,getdate()
                   ,1
                   ,@ERRORNUMBER +','+ @ERRMSG
                   );
        COMMIT TRAN ER
    END CATCH
END

</code>```

Try to add Begin tran and commit Tran without success

Body:
We have an stored procedure to transfer the data(contract data) from database 1 to database 2(interfacing with SAP to Intermeidate Database , then our database), and this contain loops and more that one table in the execution.And we have an PB12.5 desktop application with several modules like procurement,crewing, employee etc.The issue is here while executing the stored procedure from MSSQL using exec, it will take nearly 2 minutes depend on the recieved data from SAP.During the execution I'm unable to open procurement window and it is opening once the stored procedure completed the execution.The other side employee window is opening without any issue.The below are my findings/comments

Procurement module is using table1 and table2 , but in the stored procedure we are not using any of this tables.We are using table 3 and table 4(but later we will use the table from procurement module in proc)
2.While executing the proc Im able to select the tables from procurement module using select * from table1.
3.None of the table is locking from proc.
4.We have tried the same scenarios from different PC same issue exist.
5.Later we will extend the stored procedure with more tables and multiple loops(cursor)

Below are the small part of procedure(we have to extend more and it is hold now because of this issue)

Many thanks in advance.

alter PROC [spectwosuite].[CST_GENERATE_IPurchase_contract]
as begin

SET NOCOUNT ON;
/**/

--truncate table spectwosuite.CUSTOM_SAP_CONTRACT_ITEM;
--truncate table spectwosuite.CUSTOM_SAP_CONTRACT_header;
--truncate table spectwosuite.CUSTOM_SAP_PROC_LOG;

--Variable declaration
DECLARE @MATERIALNO VARCHAR(20);
DECLARE @PURCHASEDOCNO VARCHAR(20);
DECLARE @PORTID NUMERIC(15);
DECLARE @PRICE DECIMAL(11,2);
DECLARE @PKID NUMERIC(16);

DECLARE @STOCKTYPEID NUMERIC(15);
DECLARE @STOCKTYPECODE VARCHAR(50);
DECLARE @STNAME VARCHAR(50);
DECLARE @UNITID NUMERIC(15);
DECLARE @BUSFLOWID NUMERIC(15);
DECLARE @BUSSTATUSID NUMERIC(15);

DECLARE @ITEMNO VARCHAR(5);
DECLARE @SUBITEMNO VARCHAR(10);
DECLARE @STOCKDISID NUMERIC(15);

DECLARE @PURCONTRACTID NUMERIC(15);
DECLARE @REVISIONNO NUMERIC(15);
DECLARE @DESCR NVARCHAR(100);
DECLARE @ADDRESSID NUMERIC(15);
DECLARE @DELTERMSID NUMERIC(15);
DECLARE @PAYTERMSID NUMERIC(15);
DECLARE @VALIDSTART DATETIME;
DECLARE @VALIDEND DATETIME;
DECLARE @CURRENCY NCHAR(3);
DECLARE @PRODUCTGROUPID NUMERIC(15);
DECLARE @PURCONTRACTPRODUCTGROUPID NUMERIC(15);
DECLARE @MATERIALGRP NVARCHAR(20);
DECLARE @NETPRICE NUMERIC(16,6);
DECLARE @BASEPRICE NUMERIC(16,6);
DECLARE @PRODUCTGROUPLINEID NUMERIC(15);
DECLARE @SECTION VARCHAR(20);
DECLARE @PUREXIST NUMERIC(1);
DECLARE @HEADERPKID NUMERIC(16);

DECLARE @ITEMPRICE NUMERIC(16,6);
DECLARE @BASEITEMPRICE NUMERIC(16,2);
DECLARE @PURCONTRACTVARIABLEID NUMERIC(15);
DECLARE @FACTORVALUE NUMERIC(9,4);
DECLARE @ITEMPERCENTAGE NUMERIC(15,2);
DECLARE @ITEMPRICEDIFF1 NUMERIC(15,2);
DECLARE @ITEMPRICEDIFF2 NUMERIC(15,2);
DECLARE @ITEMPKID NUMERIC(16);

/*CONT1: Transfering all the portid and purchase document number to different table */

--PRINT 'CONT1 START'
--PRINT GETDATE();

BEGIN TRY
--BEGIN TRANSACTION

--BEGIN
    SET @SECTION='CONT1';
        BEGIN TRANSACTION CONT1
            INSERT INTO SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_PORT
                       (PORTID
                       ,PURCHASE_DOC_NO
                        )

                SELECT DISTINCT PORTID,PURCHASE_DOC_NO FROM SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE IMPORT_STATUS IS NULL and DELETION_IND  NOT IN('L','1')
                and portid>0 and MATERIAL_NO<>''  and  FACTOR>0 and
                       not exists (select PORTID from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_PORT where PORTID=SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_PORT.PORTID
                       and PURCHASE_DOC_NO =SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_PORT.PURCHASE_DOC_NO) ORDER BY PURCHASE_DOC_NO,PORTID ASC;

        COMMIT TRANSACTION CONT1
--END

----INSERT INTO spectwosuite.CUSTOM_SAP_PROC_LOG
----           (STATUS
----           ,DESCRIPTION
----           ,PROCESSEDDATE
----           ,RECORDCOUNT)
----     VALUES
----           (1,
----           'CONT1'
----           ,GETDATE()
----           ,@@ROWCOUNT
----           );

--PRINT 'CONT1 END'
--PRINT GETDATE();
/* CONT1 END */

/*CONT2 Inserting new item which one dont have price in all ports*/

/*Variable declaration*/

--PRINT 'CONT2 START'
--PRINT GETDATE();

    --  BEGIN
                SET @SECTION='CONT2';

                --SELECT DISTINCT CAST(MATERIAL_NO AS VARCHAR(20))AS MATERIAL_NO,PURCHASE_DOC_NO FROM SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE  PURCHASE_DOC_NO='4600000820' and IMPORT_STATUS IS NULL  and MATERIAL_NO<>'' and DELETION_IND NOT IN('L','1') and len(material_no)>0 and factor>0 and portid>0 ORDER BY MATERIAL_NO,PURCHASE_DOC_NO ASC;
                DECLARE CONT2CR CURSOR FOR
                SELECT DISTINCT CAST(MATERIAL_NO AS VARCHAR(20))AS MATERIAL_NO,PURCHASE_DOC_NO FROM SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE IMPORT_STATUS IS NULL  and MATERIAL_NO<>'' and DELETION_IND NOT IN('L','1') and len(material_no)>0 and factor>0 and portid>0 ORDER BY MATERIAL_NO,PURCHASE_DOC_NO ASC;
                OPEN CONT2CR
                FETCH NEXT FROM CONT2CR INTO @MATERIALNO,@PURCHASEDOCNO

                WHILE @@FETCH_STATUS=0
                    BEGIN
                            BEGIN TRAN CONT2
                                        select @PKID=MIN(pk_id),@PRICE=MIN(NET_PRICE) from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE MATERIAL_NO=@MATERIALNO AND PURCHASE_DOC_NO=@PURCHASEDOCNO and  IMPORT_STATUS IS NULL and DELETION_IND NOT IN('L','1') and factor>0 and portid>0;
                                    /*Retreiving port details table*/
                                        DECLARE CONT2PORTCR CURSOR FOR
                                        SELECT DISTINCT portid FROM SAP_INTERFACE.spectwosuite.custom_sap_contract_port WITH(NOLOCK) WHERE (SAP_INTERFACE.spectwosuite.custom_sap_contract_port.purchase_doc_no = @PURCHASEDOCNO) and ( custom_sap_contract_port.portid > 0 )  ;
                                        OPEN CONT2PORTCR
                                        FETCH NEXT FROM CONT2PORTCR INTO @PORTID
                                        WHILE @PORTID>0
                                        BEGIN

                                            IF @PORTID>0
                                            BEGIN
                                                BEGIN TRAN
                                                    /*Insert Script*/
                                                    SET @SECTION='ITEM_ADDITION';

                                                    IF (select COUNT(*) from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) where  MATERIAL_NO=CAST(@MATERIALNO AS varchar(20)) AND PORTID=@PORTID and PURCHASE_DOC_NO=@PURCHASEDOCNO and IMPORT_STATUS IS NULL and DELETION_IND NOT IN('L','1') and factor>0 and portid>0)<=0
                                                    BEGIN
                                                        INSERT INTO SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM
                                                                                (DELETION_IND,PURCHASE_DOC_NO,ITEM_NO,MATERIAL_NO,SHORT_TEXT,MATERIAL_GRP,QTY,UOM,NET_PRICE,PORTID,TEMPPORTID,FACTOR)
                                                        select DELETION_IND,PURCHASE_DOC_NO,ITEM_NO,MATERIAL_NO,SHORT_TEXT,MATERIAL_GRP,QTY,UOM,NET_PRICE,@PORTID,1252,FACTOR  from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK) WHERE pk_id=@PKID and DELETION_IND<>'1'  and IMPORT_STATUS IS NULL;
                                                    END

                                                    SET @PORTID=0;
                                                COMMIT TRAN
                                            END
                                            FETCH NEXT FROM CONT2PORTCR INTO @PORTID
                                        END
                                        CLOSE CONT2PORTCR
                                        DEALLOCATE CONT2PORTCR
                            COMMIT TRAN CONT2
                        FETCH NEXT FROM CONT2CR INTO @MATERIALNO,@PURCHASEDOCNO
                    END

                    CLOSE CONT2CR
                    DEALLOCATE CONT2CR

--END

--INSERT INTO spectwosuite.CUSTOM_SAP_PROC_LOG
--           (STATUS
--           ,DESCRIPTION
--           ,PROCESSEDDATE
--           ,RECORDCOUNT)
--     VALUES
--           (1,
--         'CONT2'
--         ,GETDATE()
--         ,@@ROWCOUNT
--         );

--PRINT 'CONT2 END'
--PRINT GETDATE();

/*CONT2 END*/

        /*CONT3*/

--PRINT 'CONT3 START'
--PRINT GETDATE();

SET @SECTION='CONT3';
            BEGIN TRAN CONT3
                INSERT INTO spectwosuite.CUSTOM_SAP_CONTRACT_HEADER
                           (TABLEPKID
                           ,PURCHASE_DOC_NO
                           ,COMPANY_CODE
                           ,CREATED_ON_DATE
                           ,VENDOR_CODE
                           ,PAYMENT_TERMS
                           ,PURCHASE_GRP
                           ,VALIDITY_START
                           ,VALIDITY_END
                           ,YOUR_REFERENCE
                           ,OUR_REFERNCE
                           ,TARGET_AMOUNT
                           ,CURRENCY
                           ,DESCRIPTION
                           ,SHIPCODE
                           ,STATUS
                           ,CREATEDATE
                           ,VALIDATESTART
                           ,VALIDATEEND
                           ,INTERNAL_STATUS
                           ,INTERNAL_MESSAGE
                           )
                    SELECT
                        PK_ID
                       ,PURCHASE_DOC_NO
                      ,COMPANY_CODE
                      ,CREATED_ON_DATE
                      ,VENDOR_CODE
                      ,PAYMENT_TERMS
                      ,PURCHASE_GRP
                      ,VALIDITY_START
                      ,VALIDITY_END
                      ,YOUR_REFERENCE
                      ,OUR_REFERNCE
                      ,TARGET_AMOUNT
                      ,CURRENCY
                      ,DESCRIPTION
                      ,SHIPCODE
                      ,STATUS
                      ,CREATEDATE
                      ,VALIDATESTART
                      ,VALIDATEEND
                      ,INTERNAL_STATUS
                      ,INTERNAL_MESSAGE
                  FROM SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_HEADER WITH(NOLOCK)
                  where import_status is null and purchase_doc_no<>'' and validity_start<>'' and validity_end<>'' and currency<>''and status>0
                  and not exists(select pk_id from spectwosuite.CUSTOM_SAP_CONTRACT_HEADER WHERE TABLEPKID= SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_HEADER.PK_ID)
            COMMIT TRAN CONT3
    --INSERT INTO spectwosuite.CUSTOM_SAP_PROC_LOG
 --          (STATUS
 --          ,DESCRIPTION
 --          ,PROCESSEDDATE
 --          ,RECORDCOUNT)
 --    VALUES
 --          (1,
    --     'CONT3'
    --     ,GETDATE()
    --     ,@@ROWCOUNT
    --     );

--PRINT 'CONT3 END'
--PRINT GETDATE();
        /*CONT3 END*/

        /*CONT4*/

--PRINT 'CONT4 START'
--PRINT GETDATE();
SET @SECTION='CONT4';
            BEGIN TRAN CONT4
                    INSERT INTO spectwosuite.CUSTOM_SAP_CONTRACT_ITEM
                               (TABLEPKID,PURCHASE_DOC_NO
                               ,ITEM_NO
                               ,DELETION_IND
                               ,MATERIAL_NO
                               ,SHORT_TEXT
                               ,MATERIAL_GRP
                               ,QTY
                               ,UOM
                               ,NET_PRICE
                               ,PORTID
                               ,STOCKTYPEID
                               ,INTERNAL_MESSAGE
                               ,INTERNAL_STATUS
                                ,CONTRACTTYPE
                                ,AGREEMENTSUBITEMNO
                                ,FACTOR
                    )

            select  PK_ID,PURCHASE_DOC_NO
                  ,ITEM_NO
                  ,DELETION_IND
                  ,MATERIAL_NO
                  ,SHORT_TEXT
                  ,MATERIAL_GRP
                  ,QTY
                  ,UOM
                  ,NET_PRICE
                  ,PORTID
                  ,STOCKTYPEID
                  ,INTERNAL_MESSAGE
                  ,INTERNAL_STATUS
                    ,CONTRACTTYPE
                    ,AGREEMENTSUBITEMNO
                    ,FACTOR
                      from SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM WITH(NOLOCK)
                       where IMPORT_STATUS is null and MATERIAL_NO<>'' and DELETION_IND<>'L' AND PORTID>0 and FACTOR>0 and  LEN(SHORT_TEXT)>0 AND LEN(PURCHASE_DOC_NO)>0 AND
                       not exists (select PK_ID from spectwosuite.CUSTOM_SAP_CONTRACT_ITEM where TABLEPKID= SAP_INTERFACE.spectwosuite.CUSTOM_SAP_CONTRACT_ITEM.PK_ID )  ORDER BY PK_ID ASC;
        COMMIT TRAN CONT4

--      /*Inserting History*/

--      /*Transfering process status to interface table.*/
    TRUNCATE TABLE spectwosuite.CUSTOM_SAP_CONTRACT_HEADER;
    TRUNCATE TABLE spectwosuite.CUSTOM_SAP_CONTRACT_ITEM;

    DELETE FROM spectwosuite.CUSTOM_SAP_PROC_LOG WHERE STATUS=99;
    COMMIT
--      /*PURCHASE CONTRACT CREATION END*/
--      SET NOCOUNT OFF;
--      --COMMIT TRANSACTION
END TRY
    BEGIN CATCH
        DECLARE @ERRORNUMBER VARCHAR(20);
        DECLARE @ERRMSG VARCHAR(MAX);
        SET @ERRORNUMBER=CAST(ERROR_LINE() AS VARCHAR(20));
        SET @ERRMSG=ERROR_MESSAGE();

        BEGIN TRAN ER
            INSERT INTO spectwosuite.CUSTOM_SAP_PROC_LOG
                   (STATUS
                   ,DESCRIPTION
                   ,PROCESSEDDATE
                   ,RECORDCOUNT
                   ,ERRORMSG)
             VALUES
                   (
                   88,
                   @SECTION
                   ,getdate()
                   ,1
                   ,@ERRORNUMBER +','+ @ERRMSG
                   );
        COMMIT TRAN ER
    END CATCH
END

Try to add Begin tran and commit Tran without success


问:
Having problems to get correct properties with Find and MongoDB
I have these collections:

```<code>const { Schema, model } = require("mongoose");

const TaskToDoSchema = Schema({

    equipo: {
        type: Schema.ObjectId,
        ref: "Equipo",
        autopopulate: {select: "codigo"}
    },
    tarea: {
            type: Schema.ObjectId,
            ref: "Task",
            autopopulate: {select: "tipotarea"}
        },
    encargado: {
            type: Schema.ObjectId,
            ref: "User",
            autopopulate: {select: "name dni"}
        },
    frecuencia: String

});
TaskToDoSchema.plugin(require("mongoose-autopopulate"));
module.exports = model("TaskToDo", TaskToDoSchema, "taskstodo");
</code>```
```<code>const {Schema, model} = require("mongoose");

const TaskDoneSchema = Schema({
    tasktodo: {
        type: Schema.ObjectId,
        ref: "TaskToDo",
        autopopulate: true
    },
    fechaDone: {
        type: Date,
        default: Date.now
    }
})
TaskDoneSchema.plugin(require("mongoose-autopopulate"));
module.exports = model("TaskDone", TaskDoneSchema, "tasksdone");
</code>```

The first model defines a determined task that must be performed in a determined machine, by a determined person, all this info is taken from other collections.

The second model is used to define that a tasktodo is done, so I save a new record with the tasktodo Id and the date this task was performed.

I wish to list all the tasks done in a specific machine, by its ID, so, I defined this route:

```<code>router.get("/listbyequipo/:id", check.auth, TaskDoneController.listbyequipo);
</code>```

where check.auth is an authentication middleware.

To perform the query I tried with:

```<code>const listbyequipo = async (req, res, next) => {
    try {
        let equipo = req.params.id;
        let taskDone = await TaskDone.find({'tasktodo.equipo._id': equipo})
                                     .exec()
        console.log(taskDone)
        res.send({
            status:"Succes",
            message:"Consulta de registros exitosa",
            taskDone
        })

    } catch (error) {
        res.send({
            status: "Error",
            message: "Error al mostrar los registros"
        });
        next(error);
    }
}
</code>```

But the result is an empty array.

I´m not sure where is the problem, I also tried defining 'tasktodo.equipo._id': mongoose.type.objectId(equipo) but the problem persists.

Probably, this image can help to understand how levels are defined in the collection:

I have also tried this:

```<code>//Metodo para listar todas las tareas realizadas en un equipo especifico
const listbyequipo = async (req, res, next) => {
    try {
        const id = (req.params.id);
        const query ={'tasktodo.equipo._id': mongoose.Types.ObjectId(id)}
        console.log(id);
        let taskDone = await TaskDone.find({query})

        res.send({
            status:"Succes",
            message:"Consulta de registros exitosa",
            taskDone
        })

    } catch (error) {
        res.send({
            status: "Error",
            message: "Error al mostrar los registros"
        });
        next(error);
    }
}
</code>```

But the result is a list with all the registers in the collection.

Body:
I have these collections:

const { Schema, model } = require("mongoose");

const TaskToDoSchema = Schema({

    equipo: {
        type: Schema.ObjectId,
        ref: "Equipo",
        autopopulate: {select: "codigo"}
    },
    tarea: {
            type: Schema.ObjectId,
            ref: "Task",
            autopopulate: {select: "tipotarea"}
        },
    encargado: {
            type: Schema.ObjectId,
            ref: "User",
            autopopulate: {select: "name dni"}
        },
    frecuencia: String

});
TaskToDoSchema.plugin(require("mongoose-autopopulate"));
module.exports = model("TaskToDo", TaskToDoSchema, "taskstodo");

const {Schema, model} = require("mongoose");

const TaskDoneSchema = Schema({
    tasktodo: {
        type: Schema.ObjectId,
        ref: "TaskToDo",
        autopopulate: true
    },
    fechaDone: {
        type: Date,
        default: Date.now
    }
})
TaskDoneSchema.plugin(require("mongoose-autopopulate"));
module.exports = model("TaskDone", TaskDoneSchema, "tasksdone");

The first model defines a determined task that must be performed in a determined machine, by a determined person, all this info is taken from other collections.

The second model is used to define that a tasktodo is done, so I save a new record with the tasktodo Id and the date this task was performed.

I wish to list all the tasks done in a specific machine, by its ID, so, I defined this route:

router.get("/listbyequipo/:id", check.auth, TaskDoneController.listbyequipo);

where check.auth is an authentication middleware.

To perform the query I tried with:

const listbyequipo = async (req, res, next) => {
    try {
        let equipo = req.params.id;
        let taskDone = await TaskDone.find({'tasktodo.equipo._id': equipo})
                                     .exec()
        console.log(taskDone)
        res.send({
            status:"Succes",
            message:"Consulta de registros exitosa",
            taskDone
        })

    } catch (error) {
        res.send({
            status: "Error",
            message: "Error al mostrar los registros"
        });
        next(error);
    }
}

But the result is an empty array.

I´m not sure where is the problem, I also tried defining 'tasktodo.equipo._id': mongoose.type.objectId(equipo) but the problem persists.

Probably, this image can help to understand how levels are defined in the collection:

I have also tried this:

//Metodo para listar todas las tareas realizadas en un equipo especifico
const listbyequipo = async (req, res, next) => {
    try {
        const id = (req.params.id);
        const query ={'tasktodo.equipo._id': mongoose.Types.ObjectId(id)}
        console.log(id);
        let taskDone = await TaskDone.find({query})

        res.send({
            status:"Succes",
            message:"Consulta de registros exitosa",
            taskDone
        })

    } catch (error) {
        res.send({
            status: "Error",
            message: "Error al mostrar los registros"
        });
        next(error);
    }
}

But the result is a list with all the registers in the collection.


问:
Stuck at this step sudo make import-sql area=planet-latest
As described here: https://community.openstreetmap.org/t/stuck-at-this-step-sudo-make-import-sql-area-planet-latest/6843 ,

I followed the indications found here: https://www.linuxbabe.com/ubuntu/basemap-tileserver-gl-openmaptiles-ubuntu-22-04

I first tried the whole process for a small data, the Isle of Man, and everything works fine

But with the data of the entire world, I'm stuck at this sub-step, of step 8 :

```<code>root@vmi1046457:~/openmaptiles# sudo make import-sql area=planet-latest

Time: 1.587 ms
psql:/sql/parallel/water__waterway.sql:1016: NOTICE:  schema "waterway_important" already exists, skipping
CREATE SCHEMA
Time: 9.567 ms
psql:/sql/parallel/water__waterway.sql:1027: NOTICE:  relation "changes" already exists, skipping
CREATE TABLE
Time: 39.958 ms
CREATE FUNCTION
Time: 197.301 ms
psql:/sql/parallel/water__waterway.sql:1048: NOTICE:  relation "updates" already exists, skipping
CREATE TABLE
Time: 1.386 ms
CREATE FUNCTION
Time: 10.781 ms
CREATE FUNCTION
Time: 54.163 ms
CREATE FUNCTION
Time: 13.839 ms
CREATE TRIGGER
Time: 159.570 ms
CREATE TRIGGER
Time: 1100.683 ms (00:01.101)
CREATE TRIGGER
Time: 42.035 ms
CREATE TRIGGER
Time: 71.131 ms
CREATE FUNCTION
Time: 18.919 ms
</code>```

This step is very cpu-intentive : the 10 vcpus usage is within the this range :75% - 99%

The VPS I'm using of a Cloud Service Provider has the following features:

```<code>A 10 core CPU
60 GB RAM
1.6 TB Intel Optane SSD
</code>```

Are these technical features enough for importing into postgresql DB the data of the entire world?
What can I do to make this step : sudo make import-sql speed up and finish?

Body:
As described here: https://community.openstreetmap.org/t/stuck-at-this-step-sudo-make-import-sql-area-planet-latest/6843 ,

I followed the indications found here: https://www.linuxbabe.com/ubuntu/basemap-tileserver-gl-openmaptiles-ubuntu-22-04

I first tried the whole process for a small data, the Isle of Man, and everything works fine

But with the data of the entire world, I'm stuck at this sub-step, of step 8 :

root@vmi1046457:~/openmaptiles# sudo make import-sql area=planet-latest

Time: 1.587 ms
psql:/sql/parallel/water__waterway.sql:1016: NOTICE:  schema "waterway_important" already exists, skipping
CREATE SCHEMA
Time: 9.567 ms
psql:/sql/parallel/water__waterway.sql:1027: NOTICE:  relation "changes" already exists, skipping
CREATE TABLE
Time: 39.958 ms
CREATE FUNCTION
Time: 197.301 ms
psql:/sql/parallel/water__waterway.sql:1048: NOTICE:  relation "updates" already exists, skipping
CREATE TABLE
Time: 1.386 ms
CREATE FUNCTION
Time: 10.781 ms
CREATE FUNCTION
Time: 54.163 ms
CREATE FUNCTION
Time: 13.839 ms
CREATE TRIGGER
Time: 159.570 ms
CREATE TRIGGER
Time: 1100.683 ms (00:01.101)
CREATE TRIGGER
Time: 42.035 ms
CREATE TRIGGER
Time: 71.131 ms
CREATE FUNCTION
Time: 18.919 ms

This step is very cpu-intentive : the 10 vcpus usage is within the this range :75% - 99%

The VPS I'm using of a Cloud Service Provider has the following features:

A 10 core CPU
60 GB RAM
1.6 TB Intel Optane SSD

Are these technical features enough for importing into postgresql DB the data of the entire world?
What can I do to make this step : sudo make import-sql speed up and finish?


问:
git clone is failing in jenkins with fatal: index-pack failed
Git clone fails with the below error in my jenkins pipeline

```<code>Receiving objects:  82% (158102/191432), 4.79 GiB | 4.80 MiB/s
Killed by signal 15.
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed
</code>```

If I manually clone on my machine it works fine, but through pipeline this error occurs.
This error occurs 9 out of 10 times I run the pipeline.

Any idea how this can be resolved?

Jenkinsfile

```<code>stage('SCM') {
            steps {
                script {
                    FAILED_STAGE = env.STAGE_NAME
                }
                node('git') {
                ws( "${MY_DIR}" ) {
                    retry(0) {
                        checkout ([$class: 'GitSCM',
                                   poll: true,
                                   changelog: true,
                                   branches: [[name: params.GitBranch]],
                                   doGenerateSubmoduleConfigurations: false,
                                   extensions: [[$class: 'GitLFSPull'],
                                                [$class: 'CleanBeforeCheckout'],
                                                [$class: 'PruneStaleBranch'],
                                                [$class: 'CheckoutOption', timeout: 120],
                                                [$class: 'SubmoduleOption',
                                                        disableSubmodules: false,
                                                        parentCredentials: false,
                                                        recursiveSubmodules: true,
                                                        reference: '',
                                                        trackingSubmodules: false]
                                               ],
                                   submoduleCfg: [],
                                   userRemoteConfigs: [[credentialsId: 'APPGHEAccessTokenWithUsername',
                                                        url: 'https://github.com/AppDev/front-end.git']]
                        ])
                        sleep (1)
                    }

                }
              }
            }
        }
</code>```

Body:
Git clone fails with the below error in my jenkins pipeline

Receiving objects:  82% (158102/191432), 4.79 GiB | 4.80 MiB/s
Killed by signal 15.
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed

If I manually clone on my machine it works fine, but through pipeline this error occurs.
This error occurs 9 out of 10 times I run the pipeline.

Any idea how this can be resolved?

Jenkinsfile

stage('SCM') {
            steps {
                script {
                    FAILED_STAGE = env.STAGE_NAME
                }
                node('git') {
                ws( "${MY_DIR}" ) {
                    retry(0) {
                        checkout ([$class: 'GitSCM',
                                   poll: true,
                                   changelog: true,
                                   branches: [[name: params.GitBranch]],
                                   doGenerateSubmoduleConfigurations: false,
                                   extensions: [[$class: 'GitLFSPull'],
                                                [$class: 'CleanBeforeCheckout'],
                                                [$class: 'PruneStaleBranch'],
                                                [$class: 'CheckoutOption', timeout: 120],
                                                [$class: 'SubmoduleOption',
                                                        disableSubmodules: false,
                                                        parentCredentials: false,
                                                        recursiveSubmodules: true,
                                                        reference: '',
                                                        trackingSubmodules: false]
                                               ],
                                   submoduleCfg: [],
                                   userRemoteConfigs: [[credentialsId: 'APPGHEAccessTokenWithUsername',
                                                        url: 'https://github.com/AppDev/front-end.git']]
                        ])
                        sleep (1)
                    }

                }
              }
            }
        }


问:
How to build square cells in a SwiftUI LazyVGrid containing dynamic type
I'm trying to build a LazyVGrid, that contains square cells that dynamically size with the text inside them, something like this:

```<code>struct BandView: View {

    let bands: [Band]

    var body: some View {
        LazyVGrid(columns: [GridItem(.adaptive(minimum: 120))]) {
            ForEach(bands, id: \.self) { band in
                BandCell(band: band)
            }
        }
        .frame(maxHeight: .infinity, alignment: .topLeading)
        .padding()
    }
}

struct BandCell: View {

    let band: Band

    var body: some View {
        GroupBox {
            VStack(alignment: .leading, spacing: 8) {
                Text(band.leadSinger)
                    .lineLimit(1)
                Text("\(band.songs) songs")
            }
            .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
        } label: {
                Text(band.name)
                    .lineLimit(2)
        }
        .aspectRatio(1, contentMode: .fill)
    }
}

struct BandView_Previews: PreviewProvider {

    static var bands = [
        Band(name: "Wet Leg", leadSinger: "Rhian Teasdale", songs: 2),
        Band(name: "The Cure", leadSinger: "Robert Smith", songs: 6),
        Band(name: "Dave Dee, Dozy, Beaky, Mick & Tich ", leadSinger: "Dave Dee", songs: 5)
    ]

    static var previews: some View {
        BandView(bands: bands)
    }
}

struct Band: Hashable {
    let name: String
    let leadSinger: String
    let songs: Int
}
</code>```

which gives me the following when using a large dynamic type size:

However, when I increase the font size to accessibility 3 or more the cells take up more space so that they overlap the frame of the grid (and each other):

I was expecting the cells to grow, but as I'm using GridItem(.adaptive) I assumed they would move onto separate rows.

Changing the aspect ratio to fit rather than fill, i.e.

```<code>.aspectRatio(1, contentMode: .fit)
</code>```

and the cells stretch vertically, so don't keep the aspect ratio.

What am I missing?

Body:
I'm trying to build a LazyVGrid, that contains square cells that dynamically size with the text inside them, something like this:

struct BandView: View {

    let bands: [Band]

    var body: some View {
        LazyVGrid(columns: [GridItem(.adaptive(minimum: 120))]) {
            ForEach(bands, id: \.self) { band in
                BandCell(band: band)
            }
        }
        .frame(maxHeight: .infinity, alignment: .topLeading)
        .padding()
    }
}

struct BandCell: View {

    let band: Band

    var body: some View {
        GroupBox {
            VStack(alignment: .leading, spacing: 8) {
                Text(band.leadSinger)
                    .lineLimit(1)
                Text("\(band.songs) songs")
            }
            .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
        } label: {
                Text(band.name)
                    .lineLimit(2)
        }
        .aspectRatio(1, contentMode: .fill)
    }
}

struct BandView_Previews: PreviewProvider {

    static var bands = [
        Band(name: "Wet Leg", leadSinger: "Rhian Teasdale", songs: 2),
        Band(name: "The Cure", leadSinger: "Robert Smith", songs: 6),
        Band(name: "Dave Dee, Dozy, Beaky, Mick & Tich ", leadSinger: "Dave Dee", songs: 5)
    ]

    static var previews: some View {
        BandView(bands: bands)
    }
}

struct Band: Hashable {
    let name: String
    let leadSinger: String
    let songs: Int
}

which gives me the following when using a large dynamic type size:

However, when I increase the font size to accessibility 3 or more the cells take up more space so that they overlap the frame of the grid (and each other):

I was expecting the cells to grow, but as I'm using GridItem(.adaptive) I assumed they would move onto separate rows.

Changing the aspect ratio to fit rather than fill, i.e.

.aspectRatio(1, contentMode: .fit)

and the cells stretch vertically, so don't keep the aspect ratio.

What am I missing?


问:
Telegram bot GetWebhookInfo query: [404] Not Found
I write a telegram bot on Kotlin and run it on my own server. I used to run bots on a Windows laptop, used nginx and a static ip address, everything worked, now I'm moving the server to ubuntu.
I configured nginx and everything else as before, but when I run the jar file, an exception appears

```<code>org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webHookController' defined in URL [jar:file:/home/kartohhka/bots/portfolio-bot.jar!/BOOT-INF/classes!/kartohhka/bot/WebHookController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telegramBot' defined in kartohhka.bot.appconfig.BotConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [kartohhka.bot.appconfig.botapi.PortfolioTelegramBot]: Factory method 'telegramBot' threw exception; nested exception is Error executing org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo query: [404] Not Found
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.16.jar!/:5.3.16]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.16.jar!/:5.3.16]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at kartohhka.bot.PortfolioBotApplicationKt.main(PortfolioBotApplication.kt:21) ~[classes!/:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[portfolio-bot.jar:na]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[portfolio-bot.jar:na]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[portfolio-bot.jar:na]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[portfolio-bot.jar:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telegramBot' defined in kartohhka.bot.appconfig.BotConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [kartohhka.bot.appconfig.botapi.PortfolioTelegramBot]: Factory method 'telegramBot' threw exception; nested exception is Error executing org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo query: [404] Not Found
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.16.jar!/:5.3.16]
        ... 27 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [kartohhka.bot.appconfig.botapi.PortfolioTelegramBot]: Factory method 'telegramBot' threw exception; nested exception is Error executing org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo query: [404] Not Found
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.16.jar!/:5.3.16]
        ... 41 common frames omitted
Caused by: org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException: Error executing org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo query: [404] Not Found
        at org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod.deserializeResponseInternal(PartialBotApiMethod.java:53) ~[telegrambots-meta-6.1.0.jar!/:na]
        at org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod.deserializeResponse(PartialBotApiMethod.java:33) ~[telegrambots-meta-6.1.0.jar!/:na]
        at org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo.deserializeResponse(GetWebhookInfo.java:38) ~[telegrambots-meta-6.1.0.jar!/:na]
        at org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo.deserializeResponse(GetWebhookInfo.java:21) ~[telegrambots-meta-6.1.0.jar!/:na]
        at org.telegram.telegrambots.bots.DefaultAbsSender.sendApiMethod(DefaultAbsSender.java:1045) ~[telegrambots-6.1.0.jar!/:na]
        at org.telegram.telegrambots.meta.bots.AbsSender.getWebhookInfo(AbsSender.java:75) ~[telegrambots-meta-6.1.0.jar!/:na]
        at kartohhka.bot.appconfig.BotConfig.telegramBot(BotConfig.kt:55) ~[classes!/:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.16.jar!/:5.3.16]
        ... 42 common frames omitted
</code>```

Error in the line println(mySuperTelegramBot.webhookInfo)

```<code>mySuperTelegramBot.setBotUserName(conf.botUserName)
mySuperTelegramBot.botToken = conf.botToken
println(mySuperTelegramBot.setWebHookPath(conf.webHookPath))
mySuperTelegramBot.baseUrl = conf.baseUrl
val web = SetWebhook()
web.url = conf.webHookPath
println(mySuperTelegramBot.webhookInfo)
mySuperTelegramBot.setWebhook(web)
println(conf.botUserName)
println(conf.botToken)
println(conf.webHookPath)
return mySuperTelegramBot
</code>```

I can't fully understand what settings I need to change in order for everything to work on the local telegram server.

I had an idea that I didn't need a webhook, since everything runs locally, but if I remove it, the jar file runs without errors, but the bot still doesn't work (if you write to it in a telegram, there is no response, and updates don't appear in the console)Kotlin HttpHostConnectException

Body:
I write a telegram bot on Kotlin and run it on my own server. I used to run bots on a Windows laptop, used nginx and a static ip address, everything worked, now I'm moving the server to ubuntu.
I configured nginx and everything else as before, but when I run the jar file, an exception appears

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webHookController' defined in URL [jar:file:/home/kartohhka/bots/portfolio-bot.jar!/BOOT-INF/classes!/kartohhka/bot/WebHookController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telegramBot' defined in kartohhka.bot.appconfig.BotConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [kartohhka.bot.appconfig.botapi.PortfolioTelegramBot]: Factory method 'telegramBot' threw exception; nested exception is Error executing org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo query: [404] Not Found
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.16.jar!/:5.3.16]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.16.jar!/:5.3.16]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.4.jar!/:2.6.4]
        at kartohhka.bot.PortfolioBotApplicationKt.main(PortfolioBotApplication.kt:21) ~[classes!/:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[portfolio-bot.jar:na]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[portfolio-bot.jar:na]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[portfolio-bot.jar:na]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[portfolio-bot.jar:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'telegramBot' defined in kartohhka.bot.appconfig.BotConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [kartohhka.bot.appconfig.botapi.PortfolioTelegramBot]: Factory method 'telegramBot' threw exception; nested exception is Error executing org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo query: [404] Not Found
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.16.jar!/:5.3.16]
        ... 27 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [kartohhka.bot.appconfig.botapi.PortfolioTelegramBot]: Factory method 'telegramBot' threw exception; nested exception is Error executing org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo query: [404] Not Found
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.16.jar!/:5.3.16]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.16.jar!/:5.3.16]
        ... 41 common frames omitted
Caused by: org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException: Error executing org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo query: [404] Not Found
        at org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod.deserializeResponseInternal(PartialBotApiMethod.java:53) ~[telegrambots-meta-6.1.0.jar!/:na]
        at org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod.deserializeResponse(PartialBotApiMethod.java:33) ~[telegrambots-meta-6.1.0.jar!/:na]
        at org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo.deserializeResponse(GetWebhookInfo.java:38) ~[telegrambots-meta-6.1.0.jar!/:na]
        at org.telegram.telegrambots.meta.api.methods.updates.GetWebhookInfo.deserializeResponse(GetWebhookInfo.java:21) ~[telegrambots-meta-6.1.0.jar!/:na]
        at org.telegram.telegrambots.bots.DefaultAbsSender.sendApiMethod(DefaultAbsSender.java:1045) ~[telegrambots-6.1.0.jar!/:na]
        at org.telegram.telegrambots.meta.bots.AbsSender.getWebhookInfo(AbsSender.java:75) ~[telegrambots-meta-6.1.0.jar!/:na]
        at kartohhka.bot.appconfig.BotConfig.telegramBot(BotConfig.kt:55) ~[classes!/:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.16.jar!/:5.3.16]
        ... 42 common frames omitted

Error in the line println(mySuperTelegramBot.webhookInfo)

mySuperTelegramBot.setBotUserName(conf.botUserName)
mySuperTelegramBot.botToken = conf.botToken
println(mySuperTelegramBot.setWebHookPath(conf.webHookPath))
mySuperTelegramBot.baseUrl = conf.baseUrl
val web = SetWebhook()
web.url = conf.webHookPath
println(mySuperTelegramBot.webhookInfo)
mySuperTelegramBot.setWebhook(web)
println(conf.botUserName)
println(conf.botToken)
println(conf.webHookPath)
return mySuperTelegramBot

I can't fully understand what settings I need to change in order for everything to work on the local telegram server.

I had an idea that I didn't need a webhook, since everything runs locally, but if I remove it, the jar file runs without errors, but the bot still doesn't work (if you write to it in a telegram, there is no response, and updates don't appear in the console)Kotlin HttpHostConnectException