text:
Improve the document

Improve the documentation for the Eureka chapter

Codecov Report

Merging #2467 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2467   +/-   ##
=======================================
  Coverage   68.45%   68.45%
=======================================
  Files         236      236
  Lines        8322     8322
  Branches     1032     1032
=======================================
  Hits         5697     5697
  Misses       2238     2238
  Partials      387      387

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e87b50...5059b06. Read the comment docs.

@spencergibb Hello, thanks for your reply. I temporarily restore this paragraph. At the same time I @ Configuration, @ ComponentScan, @ EnableAutoConfiguration note replaced by @ SpinBootApplication. What do you think of this

@spencergibb In addition, there are some places in the document using @ Configuration, @ ComponentScan, @ EnableAutoConfiguration, and in some places using @SpringBootApplication. I want to modify it uniformly into @SpringBootApplication. If you agree, I will be unified modification in this pr, thank you

@fahimfarookme Thank you for your reviewed.If I say so, do you think it is OK?
if self-preservation is turned-off or self-preservation is turned-on and renewed not less the percentage configured for the value (not below than 85% in 15 minutes)

I think you can replace @Configuration, @ComponentScan, @EnableAutoConfigurationwith @springbootapplication.

@ryanjbaxter Thank you for your reply, I will modify it according to your suggestion.

source: gharchive/pull-request

authors: codecov-io holy12345 ryanjbaxter


text:
Spans are continued in Handler Interceptors

without this change an explicit new span is created on the server side. Its name is equal to the method name of the controller. It introduces some nice advantages in terms of readability of trace.
with this change we're continuing a previous span on the server side. We're attaching the tags and logs to that span with information about controller class and controller name. Also events related to start and finish of the controller are there.
fixes #471 #469 #427

Here is an example of the new trace. BTW @adriancole the controller start and finish - they were to be events not tags right?

LGTM

@marcingrzejszczak why does a controller start and finish twice?

AFAIR it's going to error processing to another controller (cause a 404 is thrown or sth).

AFAIR it's going to error processing to another controller (cause a 404 is
thrown or sth).

so this means the controller tag is the "primary controller" then?

Yeah exactly. It's the first controller that started processing the request.

well since it can hop controllers, is it possible to rename the annotation
to the controller name start/stop? that might make it more clear what's
going on.

ps I think there's a lot of detail we are trying to cram into a single
span.. personally, if there are multiple controllers being called, I'd
make them local spans (and not copy any irrelevant tags to them such
as http tags)

Current coverage is 74.60% (diff: 86.84%)

Merging #474 into 1.0.x will increase coverage by 0.32%

@@              1.0.x       #474   diff @@
==========================================
  Files           130        130
  Lines          2963       2981    +18
  Methods           0          0
  Messages          0          0
  Branches        415        415
==========================================
+ Hits           2201       2224    +23
- Misses          577        579     +2
+ Partials        185        178     -7

Powered by Codecov. Last update 0f4427b...41bafdf

authors: adriancole codecov-io dsyer marcingrzejszczak

repo: spring-cloud/spring-cloud-sleuth

license_type: permissive

license_source: github-api


text:
Add the ability for the binder to detect ChainedKafkaTransactionManager bean

Currently, the binder creates a default transaction manager internally. If an application creates a bean of type ChainedKafkaTransactionManager, then the binder should use that in order to properly synchronize with other transaction managers such as a JPA based one.

@sobychacko It turns out we don't need this; you can use a listener container customizer to inject a ChainedTransactionManager bean.
@Bean
public ListenerContainerCustomizer<AbstractMessageListenerContainer<?, ?>> customizer() {
	return (container, dest, group) -> container.getContainerProperties().setTransactionManager(myChainedTm());
}

Actually, no; forget that.

Is this fix available in spring-cloud-stream-binder-kafka:3.0.3.RELEASE?  I'm currently using this release and facing issue in writing chained transaction on JpaTM and KafkaTM.  The transaction used to work fine with spring boot 2.1.11 and dependent cloud libraries.  After upgrading the kafka consumer is able to receive the messages even if the jpa transaction is till under process.

Your question is not clear; there is no way to use a chained transaction manager with consumers before this fix is available.
I presume your question is related to https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/869.

source: gharchive/issue

authors: garyrussell santhoshpt sobychacko


text:
Injection of ObjectMapper in ChannelBindingServiceConfiguration causes eager initialization

One of the observable effects is that the resulting ObjectMapper is not properly configured for HATEOAS.

How to reproduce: https://github.com/spring-cloud/spring-cloud-stream/pull/496#issuecomment-213470417

repo: spring-cloud/spring-cloud-stream

license_source: bigquery


text:
Unable to resolve org.springframework:spring-jdbc:5.0.6.RELEASR

In the "Accessing Relational Data using JDBC with Spring" example:
I imported the project and found the following problem.
Unable to resolve org.springframework:spring-jdbc:5.0.6.RELEASR

How to solve this warning?

Works for me. Maybe you have a bad jar?

@dsyer
Thank you, I solved it.

@dsyer
Thank you, I solved it.

how to resolve it , I meet the same problem

authors: ChildrenGreens allentofight dsyer

repo: spring-guides/gs-accessing-data-mysql


text:
Problems with displaying several code snippets on the guide page

Bugs with displaying several code examples on https://spring.io/guides/gs/authenticating-ldap/ (inside "Set up Spring Security" & "Set up user data" paragraphs):
build.gradle - Unresolved directive in  - include::complete/build.gradle[tag=security,indent=0]
pom.xml - Unresolved directive in  - include::complete/pom.xml[tag=security,indent=0]
src/main/java/hello/WebSecurityConfig.java - Unresolved directive in <stdin> - include::complete/src/main/java/hello/WebSecurityConfig.java[]
src/main/resources/test-server.ldif - Unresolved directive in <stdin> - include::complete/src/main/resources/test-server.ldif[]
Btw, Ascii plugin in IDEA shows all of them correctly.

I cleared a cache. Looks OK now.

authors: amseager dsyer

repo: spring-guides/gs-authenticating-ldap


text:
Include reference to Thymeleaf bug

In the current version of the example (since Migrate to Spring Boot 3.0.0), the following is included in build.gradle:
	//  Temporary explicit version to fix Thymeleaf bug
	implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6:3.1.1.RELEASE'

It would be useful with a reference to what that bug is, so one can know whether it is relevant for a particular use case and to be able to follow it.

@rwinch Can you identify the exact issue in Thymeleaf's issue tracker? It would make sense to let people know which issue it is, and maybe we can remove that comment if it has been fixed. Thanks.

I could not find the reference to the Thymeleaf bug, but I did run the guide locally and can confirm that the additional dependency is still needed. As such, I merged PR #76 and will allow dependabot to continue to manage the version of the temporary dependency for now.

authors: Buzzardo robertmcnees skagedal

repo: spring-guides/gs-securing-web


text:
RabbitMQ Super Streams with Single Active Consumer

Add support for super streams.

I'm reopening this one since it fails on CI https://build.spring.io/chain/result/viewChainResult.action?planKey=AMQP-MAIN&buildNumber=1656 and locally for me as well.
Somehow this super stream is not consumed at all.
When I make this change to the test:
			container.setQueueNames("ss.sac.test-0");
//			container.superStream("ss.sac.test", "test");

I got some interactivity:
(Body:'foo' MessageProperties [headers={}, contentType=text/plain, contentEncoding=UTF-8, contentLength=0, deliveryMode=PERSISTENT, expiration=0, priority=0, deliveryTag=0])
(Body:'foo' MessageProperties [headers={}, contentType=text/plain, contentEncoding=UTF-8, contentLength=0, deliveryMode=PERSISTENT, expiration=0, priority=0, deliveryTag=0])
(Body:'foo' MessageProperties [headers={}, contentType=text/plain, contentEncoding=UTF-8, contentLength=0, deliveryMode=PERSISTENT, expiration=0, priority=0, deliveryTag=0])

Which means that setup is OK, but super stream feature doesn't work.
Perhaps something else has to be configured in the environment...
I'm disabling SuperStreamSACTests for time being.
Thank you!

@artembilan The test passes on my machine with
./gradlew :spring-rabbit-stream:test --tests "org.springframework.rabbit.stream.listener.SuperStreamSACTests"

I suspect you're having an old Docker image in your cache, try to delete it and run the test again:
docker rmi pivotalrabbitmq/rabbitmq-stream

It may be the same on CI.

Thank you, @acogoluegnes !
That really works.
I had to do it manually though:
docker rmi pivotalrabbitmq/rabbitmq-stream
docker logout
docker pull pivotalrabbitmq/rabbitmq-stream

Because Testcontainers somehow cannot pull the image for me - invalid credentials 😢 .
Will ask Trevor to remove that image from our CI Docker.

@artembilan maybe time to upgrade from testcontainers 1.15.3 to 1.17.3. IIRC the issue you are having should be solved by now.

Thank you, @eddumelendez !
That really makes sense: I do use the latest Testcontainers in other projects.
Will update here shortly.
And will double check the anonymous image pull respectively 😉

authors: acogoluegnes artembilan eddumelendez garyrussell

repo: spring-projects/spring-amqp


text:
Fix PublishCallCh.afterAckCallback race condition

Related to https://stackoverflow.com/questions/66071476/impossible-nullpointerexception-springframework-rabbitmq-failed-to-invoke
When we have several pending confirms, we handle them concurrently
in the doHandleConfirm().
The afterAckCallback can be set null in one thread and
another will fail with NPE after acquiring a monitor from the
getPendingConfirmsCount().

Extract a local variable for the callback inside an if block
Initialize it with this.afterAckCallback only if
getPendingConfirmsCount() == 0 is true,
and set this.afterAckCallback to null inside synchronized (this)
block
Call callback.accept(this) when local variable is not null
and outside of synchronized for better performance on end-user callback

Cherry-pick to 2.2.x

Resolves https://github.com/spring-projects/spring-amqp/issues/1305

Cherry-picked as 67e587061

authors: artembilan garyrussell


text:
GH-2532: Ignore Kotlin Continuation Parameter

Resolves https://github.com/spring-projects/spring-amqp/issues/2532
The presence of the parameter caused the inferred type to be set to null due to ambiguous parameters present.
It must be considered an ineligible type when inferring conversion types.
cherry-pick to 3.0.x (#2533), 2.4.x (#2534)

... and cherry-picked to 3.0.x & 2.4.x


text:
The limitation of /graphql/schema

User still can get all the detail about the definition of schema by IntrospectionQuery, and not only ‘Type’ definition but also directive definition.
/graphql/schema seems to be redundant, or IntrospectionQuery also need to be limited as well.

Enabling/disabling the schema endpoint is not about security, but convenience. In that sense, I don't think we necessarily need to align schema introspection and schema exposure in text format.
People might still want to easily disable introspection, so I've created spring-projects/spring-boot#29248 since the auto-configuration has now moved to the Spring Boot project.
In the meantime, you should be able to achieve just that with the following:
@Bean
public RuntimeWiringConfigurer disableFieldInstrospectionWiringConfigurer() {
	return builder -> builder.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY);
}

I'm closing this issue as it's superseded by the Spring Boot one.

repo: spring-projects/spring-graphql


text:
Exception Translator and Exception Renderer not invoked. I get html response with an error instead of JSON

Hello,
I have the problem stated in the subject. Here I posted the code and the description of the problem: http://stackoverflow.com/questions/40697688/spring-security-oauth-2-0-exception-translator-and-exception-renderer-not-invo . Can you help me?

Ok, I think I am starting to understand what happens here. My oAuth2CookieFilter throws AuthenticationException, but this happens before BASIC_AUTH_FILTER, so it is not handled by my custom exception translator and renderer injected into clientAuthenticationEntryPoint. What I don't understand is that I have access-denied-handler which also uses those two classes, but when I throw AccessDeniedException from oAuth2CookieFilter, it is still not processed by those classes. Why is that?

did your problem solved ? i have same problem

repo: spring-projects/spring-security-oauth


text:
Keys of type different than "aes256-gcm" throw exception when method VaultTransitOperations.getKey(...) is called

I created a key of type ecdsa-p256 using the following code:
VaultTransitKeyCreationRequest keyCreateRequest = VaultTransitKeyCreationRequest.builder()
    .type("ecdsa-p256").build();
vaultOperations.createKey(KEY_NAME, keyCreateRequest);

Key creation is fine, but when I try to get the details of the key I get the exception:
Can not deserialize instance of java.lang.Long out of START_OBJECT token at [Source: java.io.PushbackInputStream@705b2e8d; line: 1, column: 185] (through reference chain: org.springframework.vault.support.VaultResponseSupport["data"]->org.springframework.vault.core.VaultTransitKeyImpl["keys"]->java.util.LinkedHashMap["1"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.Long out of START_OBJECT token at [Source: java.io.PushbackInputStream@705b2e8d; line: 1, column: 185] (through reference chain: org.springframework.vault.support.VaultResponseSupport["data"]->org.springframework.vault.core.VaultTransitKeyImpl["keys"]->java.util.LinkedHashMap["1"])

The exception is thrown because the response comes in the format:
"keys": {
    "1": {
        "creation_time": "2017-09-28T09:49:55.450882832Z",
        "name": "P-256",
        "public_key": "-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----\n"
    }
}

Instead of the standard format for aes256-gcm key which is:
"keys": {
    "1": 1442851412
}

A fix should include first reading the format of the key before trying to parse the keys field.

Thanks for reporting the issue. It just proves the general impression of the transit backend true, that it's not mature enough and things are quite in flux. The only possibility how to fix the issue is by changing VaultTransitKey.getKeys() from Map<String, Long> to Map<String, Object>.

That's fixed now.

repo: spring-projects/spring-vault


text:
[Bug]When I use @ApiOperation on void method and @GetMapping has consumes same time, it will throw NullPointerException

[springfox 3.0.0]

[ ] Bug report.
When I use @ApiOperation on void method and @GetMapping has consumes same time, request http://localhost:8081/doc.html  it will throw NullPointerException

@ApiOperation(value = "get2")
@GetMapping(value = "/get2", consumes = APPLICATION_JSON_VALUE)
public void get2() throws HttpMediaTypeNotAcceptableException {
    throw new HttpMediaTypeNotAcceptableException("HttpMediaTypeNotAcceptableException");
}

exception:
java.lang.NullPointerException: null
	at springfox.documentation.oas.mappers.SchemaMapper.model(SchemaMapper.java:97) ~[springfox-oas-3.0.0.jar:3.0.0]
	at springfox.documentation.oas.mappers.SchemaMapper.mapModel(SchemaMapper.java:85) ~[springfox-oas-3.0.0.jar:3.0.0]
	at springfox.documentation.oas.mappers.ServiceModelToOpenApiMapperImpl.fromRepresentation(ServiceModelToOpenApiMapperImpl.java:187) ~[springfox-oas-3.0.0.jar:3.0.0]
	at springfox.documentation.oas.mappers.ServiceModelToOpenApiMapper.map(ServiceModelToOpenApiMapper.java:216) ~[springfox-oas-3.0.0.jar:3.0.0]
	at springfox.documentation.oas.mappers.ServiceModelToOpenApiMapperImpl.mapOperation(ServiceModelToOpenApiMapperImpl.java:113) ~[springfox-oas-3.0.0.jar:3.0.0]
	at springfox.documentation.oas.mappers.ServiceModelToOpenApiMapper.mapOperations(ServiceModelToOpenApiMapper.java:283) ~[springfox-oas-3.0.0.jar:3.0.0]
	at springfox.documentation.oas.mappers.ServiceModelToOpenApiMapper.lambda$mapPaths$4(ServiceModelToOpenApiMapper.java:264) ~[springfox-oas-3.0.0.jar:3.0.0]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[na:na]
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274) ~[na:na]
	at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.forEachOrdered(ReferencePipeline.java:502) ~[na:na]
	at springfox.documentation.oas.mappers.ServiceModelToOpenApiMapper.mapPaths(ServiceModelToOpenApiMapper.java:260) ~[springfox-oas-3.0.0.jar:3.0.0]
	at springfox.documentation.oas.mappers.ServiceModelToOpenApiMapperImpl.mapDocumentation(ServiceModelToOpenApiMapperImpl.java:83) ~[springfox-oas-3.0.0.jar:3.0.0]
	at springfox.documentation.oas.web.OpenApiControllerWebMvc.getDocumentation(OpenApiControllerWebMvc.java:88) ~[springfox-oas-3.0.0.jar:3.0.0]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[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:566) ~[na:na]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) ~[spring-web-5.3.4.jar:5.3.4]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) ~[spring-web-5.3.4.jar:5.3.4]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1060) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:962) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:626) ~[tomcat-embed-core-9.0.43.jar:4.0.FR]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.4.jar:5.3.4]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[tomcat-embed-core-9.0.43.jar:4.0.FR]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.4.jar:5.3.4]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.4.jar:5.3.4]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.4.jar:5.3.4]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.4.jar:5.3.4]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.4.jar:5.3.4]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.4.jar:5.3.4]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:887) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
	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.43.jar:9.0.43]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

I find code in SchemaMapper.java, when execute mapFrom method, it will return null!
private Schema model(
      ModelSpecification source,
      @Context ModelNamesRegistry namesRegistry) {
    Optional<ModelFacets> facets = source.getFacets();
    Schema model = mapFrom(source, namesRegistry)
        .description(facets.map(ModelFacets::getDescription).orElse(null))
//        .discriminator(source.getCompound()
//                             .map(CompoundModelSpecification::getDiscriminator)
//                             .orElse(null)) //TODO: Some work here
        .example(facets.map(ModelFacets::getExamples).orElse(EMPTY_LIST).stream()
            .findFirst().orElse(null))
        .name(source.getName())
        .xml(facets.map(ModelFacets::getXml).map(this::mapXml).orElse(null));

I'm running into the same issue. any method that returns void but has produces set (either through class or method annotation) results in a NullPointerException. Setting the value of produces to an empty array does not solve the issue.

Related: https://github.com/springfox/springfox/issues/3557

repo: springfox/springfox


text:
🛑 Jitsi Meet SP Schweiz is down

In 95f764c, Jitsi Meet SP Schweiz ($URL_JITSI) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Jitsi Meet SP Schweiz is back up in 0da4f77.

repo: spschweiz/status

license: MIT


text:
Support for AWS Batch API

I don't currently have time to work on this, but it'd be nice if moto could support the AWS Batch API.

Recently, @JackDanger added support for all AWS managed policies (addressing https://github.com/spulec/moto/issues/1118), including BatchServiceRoles which I have been using in my tests.
What would be the engineering-cost to support the Batch API, at least basic functionality therein (such as creation of env/queue/jobdef/jobsubmission)?
An example of my current (at time of posting) test setup and failure can be found here, and in the issue linked above are instructions for how to install the code and run this (though, the commit id has changed to 4afd492fc849b6a0cb18fa4a16e04a5742726c50)

@gkiar Because all of us contributing to Moto have limited time the way it's worked best is if somebody implements just the slimmest, most barely-working version of some API endpoints that they need and then leaves TODOs for other folks to pick it up from there. It's seemed like everybody has time to push things just one step forward but none of us quite have the energy to spend a day (or more) tackling a full integration of many API endpoints.
So if you are interested in creating just the barest first pass at implementing AWS Batch (maybe using #1163?) then the other folks on this issue can step in and push it along when you get tired. Teamwork for the win :)

Sounds great - I'll chug along on this when I find the bandwidth and open a PR :)

Am working on this i #1197, if you have any code feel free to jump in on the PR. @rofinn Would be helpful if you had a couple of examples / test cases, mainly as I dont use batch at all.

So the primary workflow I'm using is:

describe jobs
submit jobs
fetch logs from cloud watch logs

I'm fine assuming that the resources have already been setup by a cloudformation template.

Ahh so your expecting the cloudwatch to create the batch environment, you mind giving me a cf template that would get you to stage 1 as i'll have to add cf support too

No, cloudwatch wouldn't create the batch environment, but when you submit a batch job the STDOUT and STDERR from the ECS task will be sent to cloud watch logs. The "logGroupName" is "/aws/batch/job" and the "logStreamName" can be extracted from the describe jobs response (of running jobs) at resp["jobs"][0]["container"]["logStreamName"].
It's a bit verbose, but this is more or less the kind of template we use for deploying AWS Batch clusters.  https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/Managed_EC2_Batch_Environment.template

Sorry I meant cloudformation would create the batch environment... which is whats in the template :smile:

As for when the cloudformation would work, it'll probably have to wait till ive implemented the majority of batch, then the cf integrations, but its slowly getting there.

#1197 - linking issue to PR for my reference

FWIW, thank you for working on this. I look forward to having better tested code as a result :)

@terrycain as another data point, the workflow I'm using boto3 for is the following:

ensure roles exist with correct privileges (IAM covers this now thanks to @JackDanger's PR)
create compute environment if no exact match exists already else get ID of the match
repeat 2 for queue
repeat 2 for job definition(s)
submit job(s)
fetch log(s) using job ID(s)

When im finished the batch bit, 1-5 should work. I need to look into how our ecs implementation works to see what it will do with 6

Also what sort of jobs are you submitting? What do the Ids actually look like, and how are they represented in cloudwatch

@terrycain I'm not sure I understand your question - sorry for my ignorance. What do you mean by "sort of jobs"?
In Cloudwatch, my logs are accessible under /aws/batch/jobs at: jobdefname/default/4ac45446-a511-4b6c-a9fb-02df93a4de83 (obviously, the id is an example id).

Thanks, sorry was being an idiot, the jobs are just tasks to run containers so technically what they do is irrelevant as long as their output goes to c/w

@JackDanger @thehesiod Thoughts, am just about to implement the SubmitJob part for AWS batch.
Was thinking of essentially running docker like the lambda does as batch jobs need to specify a docker image anyway. The only issue I see is, if people run their normal images they might try and contact aws directly... I could just pass in bogus access key and secret key to the container which would nerf that but then we have other issues to deal with.

ya I think you want to do it that way since it seems like it's all docker based anyways.
ya it's a rather daunting task because the image can be running an AWS SDK in any language.  I think if they're using moto the client using moto would have to figure out how they want to cause the AWS calls to go to moto, in my blog I talk about how I achieved that...It will be easier once proxy support is added to moto...or perhaps adding my patch utilities to moto.
speaking of which, I think moto should be switched to be based on asyncio (aiohttp + aiodocker) so that multiple requests can occur in parallel.  Right now once an lambda is triggered, the moto server is blocked until the lambda finishes.

That explains why the async invoke of a lambda isnt async, that or its doing some wizardry that I'm missing. Whilst we're in the sync land, I suppose we could just make use of threading as long as its done well enough it should be alright.
I'm up for asyncifying moto @JackDanger you alright with this?

ya threading is possible as well, but more dangerous :)

Yeah agree with that. Though I reckon it should be alright if we use daemon threads. Will test to see what docker does if thread is killed whilst a container is running.

@gkiar Mind giving me a simplified version of what your doing with boto3?

Hey @terrycain - I'd written a Jupyter Notebook a while back that does essentially what I need. It requires an admin-level credentials.csv, and shouldn't assume that configuration has or hasn't happened, but will check and either do pieces that were missing or return ARNs for things that aren't. Please let me know if I should simplify this more for you.

Thats great thanks ;-)

Progress :smile: I have a proper simple implementation... which works... but only runs an alpine container spamming echo messages :smiley:

Should have basic support in #1197, it has a hardcoded containert for now which writes hello world to cloudwatch.
Cloudformation should also work

If you get any issues then report them here

Amazing, @terrycain - thanks! I'll try to start playing with this soon and will report back. Really appreciate your work!

Closing this with the merging of https://github.com/spulec/moto/pull/1197

authors: JackDanger gkiar rofinn spulec terrycain thehesiod

repo: spulec/moto


text:
Stock update

When user try to update the Stock getting 500 Server Error, why it's happening ?

Here's a general template you can use for a stock update paragraph:
Stock Update: As of [Date], the stock market has shown a mixed performance with [Stock Index or Major Index] [rising/falling] by [percentage or points] due to [brief reason, e.g., "economic data releases," "geopolitical tensions," "corporate earnings reports," etc.]. [Company Name] [Fintechzoom-Pro] has [risen/fallen/stayed the same] by [percentage or points] following [specific event, e.g., "an earnings report," "a new product launch," "a significant acquisition," etc.]

repo: spurtcommerce/multivendor-marketplace


text:
Huge variable printing in a Python console freezes Spyder

From geg...@gmail.com on 2012-09-25T06:07:24Z
Printing huge in size variable (500 MB RAM) causes the IDE to freeze. There are two ways of printing, using 'print' and typing variable name and pressing enter. 'pprint' command solves this problem, but I couldn't find the way to set it to default. https://groups.google.com/d/topic/spyderlib/V-Q9ETsTyi0/discussion
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1154

From kinnison...@gmail.com on 2013-02-20T09:25:13Z
The console printing uses repr() I believe.  So you could try overloading that to use pprint instead as a workaround.
I think I have the same issue, though the IDE doesn't freeze right away for me.  It'll usually keep printing out the huge variable until I try to stop it with Ctrl+C.  And that's when it often freezes.  Is this consistent with what you have experienced?

From ccordoba12 on 2015-01-02T18:27:14Z
Summary: Huge variable printing in a Python console freezes Spyder  <span class="oldvalue"> (was: Huge variable printing freeze) </span>
Labels: Cat-Console MS-v2.4

From geg...@gmail.com on 2013-02-20T10:51:20Z
On my own the whole OS GUI was almost frozen. I had rather clean Ubuntu installation, and through very huge lags I was able to somewhat open terminal or Alt+Ctrl+f{2-6} - virtual console and stop the python process.

Closing as duplicate of #1431

repo: spyder-ide/spyder


text:
Crash while ordering variables

Description
What steps will reproduce the problem?

Hi!
This crash happened while ordering the variables in the "Variable explorer" by "Size".
The types of the variables included:

DataFrame (Pandas)
str
_logger.Logger (Loguru)
ensemble._gb.GradientBoostingClassifier
tuple
list
dict

Regards.
Sebastian Cepeda
Traceback
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback (most recent call last):
  File "/home/sebastian/anaconda3/envs/data_science/lib/python3.6/site-packages/spyder/plugins/variableexplorer/widgets/collectionseditor.py", line 1675, in lessThan
    return leftData < rightData
TypeError: '<' not supported between instances of 'int' and 'str'

Versions

Spyder version: 4.1.5
Python version: 3.6.12
Qt version: 5.9.6
PyQt5 version: 5.9.2
Operating System: Linux 5.8.0-43-generic

Dependencies

# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  4.0.0 (OK)
cloudpickle >=0.5.0            :  1.6.0 (OK)
diff_match_patch >=20181111    :  20200713 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.16.1 (OK)
jedi =0.17.1                   :  0.17.1 (OK)
keyring                        :  None (OK)
nbconvert >=4.0                :  6.0.7 (OK)
numpydoc >=0.6.0               :  1.1.0 (OK)
parso =0.7.0                   :  0.7.0 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.2 (OK)
pygments >=2.0                 :  2.7.4 (OK)
pylint >=1.0                   :  2.6.0 (OK)
pyls >=0.34.0;<1.0.0           :  0.35.1 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  1.0.1 (OK)
qtconsole >=4.6.0              :  4.7.7 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.4.3 (OK)
spyder_kernels >=1.9.4;<1.10.0 :  1.9.4 (OK)
watchdog                       :  None (OK)
xdg >=0.26                     :  0.27 (OK)
zmq >=17                       :  20.0.0 (OK)

# Optional:
cython >=0.21                  :  None (OK)
matplotlib >=2.0.0             :  3.3.2 (OK)
numpy >=1.7                    :  1.19.2 (OK)
pandas >=0.13.1                :  1.1.3 (OK)
scipy >=0.17.0                 :  1.5.4 (OK)
sympy >=0.7.3                  :  None (OK)

Hey @sebastiancepeda, thanks for reporting. This is a duplicate of issue #14527 and it'll be fixed in our next version (4.2.2) to be released this Monday (although it could take a couple of weeks until it's part of Anaconda).


text:
open the project,error reported

Description
What steps will reproduce the problem?

1、Select local project,
2、open the project,
3、error reported
Traceback
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\projects\plugin.py", line 129, in <lambda>
    triggered=lambda v: self.open_project())
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\projects\plugin.py", line 402, in open_project
    project_type_class = self._load_project_type_class(path)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\projects\plugin.py", line 813, in _load_project_type_class
    config.read(fpath)
  File "C:\ProgramData\Anaconda3\lib\configparser.py", line 697, in read
    self._read(fp, filename)
  File "C:\ProgramData\Anaconda3\lib\configparser.py", line 1017, in _read
    for lineno, line in enumerate(fp, start=1):
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 292: illegal multibyte sequence

Versions

Spyder version: 5.0.5
Python version: 3.8.8
Qt version: 5.9.7
PyQt5 version: 5.9.2
Operating System: Windows 10

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.26.0 (OK)
jedi =0.17.2                  :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.0.1 (OK)
nbconvert >=4.0               :  6.1.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
paramiko >=2.4.0              :  2.7.2 (OK)
parso =0.7.0                  :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.10.0 (OK)
pylint >=1.0                  :  2.9.6 (OK)
pyls >=0.36.2;<1.0.0          :  0.36.2 (OK)
pyls_black >=0.4.6            :  0.4.6 (OK)
pyls_spyder >=0.3.2;<0.4.0    :  0.3.2 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.2 (OK)
qtconsole >=5.1.0             :  5.1.0 (OK)
qtpy >=1.5.0                  :  1.10.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=39.0.0           :  52.0.0.post20210125 (OK)
sphinx >=0.6.6                :  4.0.2 (OK)
spyder_kernels >=2.0.4;<2.1.0 :  2.0.5 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  1.0.2 (OK)
zmq >=17                      :  22.2.1 (OK)

# Optional:
cython >=0.21                 :  0.29.24 (OK)
matplotlib >=2.0.0            :  3.4.2 (OK)
numpy >=1.7                   :  1.19.2 (OK)
pandas >=1.1.1                :  1.3.2 (OK)
scipy >=0.17.0                :  1.6.2 (OK)
sympy >=0.7.3                 :  1.8 (OK)

Sorry, this is actually a duplicate of issue #15340 and we don't know how to fix it yet.


text:
Kernels fail to start because they can't create stderr files in non-ascii accounts on Windows

Description
What steps will reproduce the problem?

What is the expected output? What do you see instead?
Please provide any additional information below
File "C:\Anaconda2\lib\site-packages\spyder\plugins_init_.py", line 511, in
toggled=lambda checked: self.toggle_view(checked),
File "C:\Anaconda2\lib\site-packages\spyder\plugins\ipythonconsole.py", line 695, in toggle_view
self.create_new_client(give_focus=False)
File "C:\Anaconda2\lib\site-packages\spyder\plugins\ipythonconsole.py", line 974, in create_new_client
self.connect_client_to_kernel(client)
File "C:\Anaconda2\lib\site-packages\spyder\plugins\ipythonconsole.py", line 995, in connect_client_to_kernel
stderr_file)
File "C:\Anaconda2\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1384, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr)
File "C:\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 243, in start_kernel
**kw)
File "C:\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 189, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "C:\Anaconda2\lib\site-packages\jupyter_client\launcher.py", line 123, in launch_kernel
proc = Popen(cmd, **kwargs)
File "C:\Anaconda2\lib\subprocess.py", line 390, in init
errread, errwrite)
File "C:\Anaconda2\lib\sub

It seems there's content missing in your error report. Please post the entire error.

This is probably a duplicate of issue #4816. So I'm closing this issue for now.

On a second thought, this maybe is caused because you have a user name with non-ascii characters.
We'll take a look at it in a future release.

@dalthviz, please work on this one.

I think the idea is (as a test) make the directory where stderr files are created a non-ascii one and see if IPython consoles can start or not using Python 2 (I think they will fail).
Then you need to fix this error.

@ccordoba12  after testing no error appear for the console. It starts normally.
A screenshot of the path for some of the stderr files of the consoles I created while testing:

Ok, then please add a test for this please. For the test, please a non-ascii dir with Chinese and Arabic characters.

authors: ccordoba12 dalthviz xiaodongxiexie


text:
Unable to run Python

Description
What steps will reproduce the problem?

What is the expected output? What do you see instead?
Please provide any additional information below
WARNING:traitlets:kernel died: 18.000200271606445
Version and main components

Spyder Version: 3.2.4
Python Version: 3.6.3
Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies
pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.23.1 (OK)
numpy >=1.7      :  1.14.5 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
rope >=0.9.4     :  0.10.5 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.28.3 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.1.0 (OK)
pylint >=0.25    :  1.7.4 (OK)

Closing because this is empty.


text:
Test next jupyter_client

Same as #15205

Closing because this was required for testing only.


text:
Fix tabbar issue in OSX

Fixes #2598
Description
I think now the user can switch the tab when clicking, however when moving tabs the displaced tab will retain a weird color until it has been selected again. I am not sure why, but I can tackle that in another PR.

@blink1073 can you test?

Nope, it doesn't actually switch tabs, it just highlights them.

Traceback (most recent call last):
  File "/Users/ssilvester/workspace/spyder-ide/spyderlib/plugins/__init__.py", line 121, in eventFilter
    self.tab_pressed(event)
  File "/Users/ssilvester/workspace/spyder-ide/spyderlib/plugins/__init__.py", line 135, in tab_pressed
    self.dock_tabbar.mousePressEvent(self, event)
TypeError: QTabBar.mousePressEvent(QMouseEvent): argument 1 has unexpected type 'TabFilter'

f*ck, I push the wrong change give me asec...

Ok can you try again @blink1073 ?

Flawless!

I see what you mean about the weird color when dragging them around.

Ok I have no idea what is the issue with that weird tab...
There is a thing called document mode that can be applied to OSx, @blink1073
Would you mind adding this line in spyderlib/plugins/__init__py
Line  65 or similar (the init method of the TabFilter)
    def __init__(self, dock_tabbar, main):
        QObject.__init__(self)
        self.dock_tabbar = dock_tabbar
        self.main = main
        self.moving = False
        self.from_index = None
        self.to_index = None

        self.dock_tabbar.setDocumentMode(True)   # New line

This will change the overall look and in this mode the problem is no longer there... but it looks different...
http://doc.qt.io/qt-4.8/qtabbar.html#documentMode-prop

Ha, that "fixes" the issue, at the expense of looking terrible all the time :smile:

Prob takes a different set of css.

Hahahahah yes... I have tried resetting css refreshing, updating... meh...
Well will be a minor hiccup for now,
@ccordoba12 this can be merged I believe

Thanks for the fix @goanpeca!
One thing about documentMode: activating it makes Spyder crash when you undock panes (at least in Qt 4). That's why we don't use it and instead have a huge qss file to compensate for it :-)


text:
COALESCE in INSERT results in missing arguments

Version
1.21.0
What happened?
When writing a query like
INSERT INTO authors (
    address,
    name,
    bio
) VALUES (
    ?,
    COALESCE(sqlc.narg("authName"), ""),
    COALESCE(sqlc.narg("authBio"), "")
);

Only the ? is recognised and add as a parameter to the insert query
Relevant log output
none - generate works

Database schema
CREATE TABLE authors (
  id   BIGINT AUTO_INCREMENT NOT NULL,
  address VARCHAR(200) NOT NULL,
  name VARCHAR(20) NOT NULL,
  bio  LONGTEXT NOT NULL
);

SQL queries
-- name: AddAuthor :execlastid
INSERT INTO authors (
    address,
    name,
    bio
) VALUES (
    ?,
    COALESCE(sqlc.narg("calName"), ""),
    COALESCE(sqlc.narg("calDescription"), "")
);

Configuration
{
  "version": "1",
  "packages": [
    {
      "path": "db",
      "engine": "mysql",
      "schema": "query.sql",
      "queries": "query.sql"
    }
  ]
}

Playground URL
https://play.sqlc.dev/p/8471d8c7965409b41c01510cf680b8026ae5268dc83ae2591e891c432aef0432
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go

I think the bug is sadly worse than your description, and I'll probably update the title. It appears that sqlc fails to generate input parameters for values passed to COALESCE in INSERT statements, even without sqlc.narg(). And I also see this behavior with PostgreSQL.
This playground link updates the one you provided to demonstrate that things work fine in the context of UPDATE: https://play.sqlc.dev/p/0d614a07b58fbacdea078b51d5e6d338414dc6558059249294c29f74212f9104

Interestingly this does indeed seem particular to COALESCE. I went back and tried a couple of other functions like substrings (both for postgresql and the mysql variant) but they seem ok.

Fix has been merged, will be included in v1.23.0

authors: andrei-dascalu andrewmbenton kyleconroy

repo: sqlc-dev/sqlc


text:
wrong type for params in tuple

Version
1.26.0
What happened?
The type for id is detected wrong.
type ListTasksParams struct {
	CreateTime   pgtype.Timestamptz
	CreateTime_2 pgtype.Timestamptz
	Limit        int32
	Offset       int32
}

func (q *Queries) ListTasks(ctx context.Context, arg ListTasksParams) ([]Task, error)

I expected it to be:
type ListTasksParams struct {
	CreateTime   pgtype.Timestamptz
	IDorSth int64
	Limit        int32
	Offset       int32
}

Relevant log output
No response
Database schema
create table tasks (
	id bigint generated by default as identity primary key,
	info text,
	create_time timestamp with time zone not null default current_timestamp
);

SQL queries
select * from tasks
where
	(create_time, id) > ($1, $2)
order by create_time, id
limit $3 offset $4;

Configuration
version: "2"
sql:
  - engine: "postgresql"
    queries: "query.sql"
    schema: "schema.sql"
    gen:
      go:
        package: "dbgw"
        out: "dbgw"
        sql_package: "pgx/v5"

Playground URL
No response
What operating system are you using?
Windows
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go

I have the same issue using Mac OS

I couldn't find any workaround. So, I wrote the code for that specific query (in another file under the same package) manually.

authors: ehsangifani hamza-abed


text:
V-79287 - Get-DbaAuditLogin

I thought I wrote this already or the Set 🤔

OH, I did but still need a set

repo: sqlcollaborative/dbadisa


text:
Get-DbaBackupHistory Incorrect values returned

Before submitting a bug report:

[X] Ensure you are able to reproduce it on the latest released version (we release often)  0.9.334
[X] Verified this bug is not already reported in an issue
[X] Verified errors are not related to permissions
[X] Can reproduce in a clean PowerShell session (clean = powershell -NoProfile)

This is similar to issue: #3504
Steps to Reproduce
Get-DbaBackupHistory -SqlInstance 'SQL-DB-QA10' -Database 'LADMS' -LastFull -Raw

Server                  : MyServer
Database                : MyDB
Username                : domain\msa-account$
Start                   : 1/14/2018 6:00:01 PM
End                     : 1/14/2018 6:00:03 PM
Duration                : 2
Path                    : D:\SQLBackups\Full\MyDB_backup_2018_01_14_180001_6463213.bak
Type                    : Full
TotalSize               : 85066752
CompressedBackupSize    : 21187483
MediaSetId              : 21298
BackupSetID             : 21298
Software                : Microsoft SQL Server
position                : 1
first_lsn               : 793000001084800037
database_backup_lsn     : 793000001078100037
checkpoint_lsn          : 793000001084800037
last_lsn                : 793000001086500001
FirstLSN                : 793000001084800037
DatabaseBackupLsn       : 793000001078100037
CheckpointLsn           : 793000001084800037
LastLsn                 : 793000001086500001
software_major_version  : 11
DeviceType              : Disk
is_copy_only            : False
last_recovery_fork_guid : 862a8e8c-8572-4fa6-a7b1-4e25bf97f4a7
FullName                : D:\SQLBackups\Full\MyDB_backup_2018_01_14_180001_6463213.bak

Expected Behavior
I expect it to return the Full Backup from this weekend, which was May 13th.
Actual Behavior
It is returning a date in January.
Please see spreadsheet attached for values in table.  Yellow is the result it returns in dbatools, and Green is what I expect to see.
BackupsDBATOOLS.xlsx
Environmental data
Get-Module -Name dbatools
ModuleType Version    Name                                ExportedCommands
Script     0.9.334    dbatools                            {Add-DbaComputerCertificate, Add-DbaPfDataCollectorCounter, Backup-DbaDatabase, Backup-DbaDatabaseMasterKey...}

PowerShell:
Value
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
SQL Server: Microsoft SQL Server 2012 (SP4-GDR) (KB4057116) - 11.0.7462.6 (X64)   Jan  5 2018 22:11:56   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1  (Build 7601: Service Pack 1) (Hypervisor)

@artyq : something is going on that a recent commit should have fixed.
between 21342 and 25438 lsn have been reset, and indication that the db changed (restore?!).
25438 is a full, and that's good. did the databaseguid change as well ? That is what we use to identify ultimately the database, and we use, for the same database name, the one with the guid which has the highest backup_finish_date.

@niphlod : Sorry for the delay in responding, I must of missed the notification of your reply to the ticket.
Below are the results of backupset for another database that has the same issue.  You will see that both records show the same GUID.
Line 510 in the code shows this: $sql = "$select $from $where ORDER BY backupset.last_lsn DESC"
I think this may be causing my issue.
If you look at the first result, you will see that even though it is an older backup the LSN is a higher number than the most recent backup.

backup_set_id
backup_set_uuid
media_set_id
first_family_number
first_media_number
last_family_number
last_media_number
catalog_family_number
catalog_media_number
position
expiration_date
software_vendor_id
name
description
user_name
software_major_version
software_minor_version
software_build_version
time_zone
mtf_minor_version
first_lsn
last_lsn
checkpoint_lsn
database_backup_lsn
database_creation_date
backup_start_date
backup_finish_date
type
sort_order
code_page
compatibility_level
database_version
backup_size
database_name
server_name
machine_name
flags
unicode_locale
unicode_compare_style
collation_name
is_password_protected
recovery_model
has_bulk_logged_data
is_snapshot
is_readonly
is_single_user
has_backup_checksums
is_damaged
begins_log_chain
has_incomplete_metadata
is_force_offline
is_copy_only
first_recovery_fork_guid
last_recovery_fork_guid
fork_point_lsn
database_guid
family_guid
differential_base_lsn
differential_base_guid
compressed_backup_size

21994
88EF77AA-3939-4F88-B258-DFFD718FD37A
21993
1
1
1
1
1
1
1
NULL
4608
DBName
NULL
\msa
11
0
6523
-16
0
2178000000824500038
2178000000826200001
2178000000824500038
2178000000800600038
2014-11-04 09:01:56.000
2016-07-24 20:00:04.000
2016-07-24 20:00:05.000
D
0
0
110
706
41084928
DBName
Server
Server
512
1033
196609
Latin1_General_CI_AS
0
FULL
0
0
0
0
0
0
0
0
0
0
7A042FE6-F694-4A12-86A3-F2CB9E08E629
7A042FE6-F694-4A12-86A3-F2CB9E08E629
NULL
8065F34A-DFC2-4104-85A6-4E7D392CE7AC
95060D88-C832-48D0-A8A6-D9AB2F9F86AC
NULL
NULL
4929311

backup_set_id
backup_set_uuid
media_set_id
first_family_number
first_media_number
last_family_number
last_media_number
catalog_family_number
catalog_media_number
position
expiration_date
software_vendor_id
name
description
user_name
software_major_version
software_minor_version
software_build_version
time_zone
mtf_minor_version
first_lsn
last_lsn
checkpoint_lsn
database_backup_lsn
database_creation_date
backup_start_date
backup_finish_date
type
sort_order
code_page
compatibility_level
database_version
backup_size
database_name
server_name
machine_name
flags
unicode_locale
unicode_compare_style
collation_name
is_password_protected
recovery_model
has_bulk_logged_data
is_snapshot
is_readonly
is_single_user
has_backup_checksums
is_damaged
begins_log_chain
has_incomplete_metadata
is_force_offline
is_copy_only
first_recovery_fork_guid
last_recovery_fork_guid
fork_point_lsn
database_guid
family_guid
differential_base_lsn
differential_base_guid
compressed_backup_size

47687
E688ECDD-A190-4C5F-995C-9E24B085BB90
47686
1
1
1
1
1
1
1
NULL
4608
DBName
NULL
\msa
11
0
7462
-16
0
2112000002352500052
2112000002354700001
2112000002352500052
2112000002325500052
2014-11-04 09:01:56.000
2018-05-27 20:00:03.000
2018-05-27 20:00:10.000
D
0
0
110
706
126986240
DBName
Server
Server
512
1033
196609
Latin1_General_CI_AS
0
FULL
0
0
0
0
0
0
0
0
0
0
E010983C-854C-4991-9EDC-F06E664DEA1F
E010983C-854C-4991-9EDC-F06E664DEA1F
NULL
8065F34A-DFC2-4104-85A6-4E7D392CE7AC
95060D88-C832-48D0-A8A6-D9AB2F9F86AC
NULL
NULL
24720173

Okay. Can you by any chance step into the slack channel so I can ask you to
run some queries to help narrow the issue please?  Doesn't have to be now
and in real time, just hopefully more speedier than back and forth here on
github
Il mar 29 mag 2018, 19:57 artyq notifications@github.com ha scritto:

@niphlod https://github.com/niphlod : Sorry for the delay in
responding, I must of missed the notification of your reply to the ticket.
Below are the results of backupset for another database that has the same
issue. You will see that both records show the same GUID.
Line 510 in the code shows this: $sql = "$select $from $where ORDER BY
backupset.last_lsn DESC"
I think this may be causing my issue.
If you look at the first result, you will see that even though it is an
older backup the LSN is a higher number than the most recent backup.
backup_set_id backup_set_uuid media_set_id first_family_number
first_media_number last_family_number last_media_number
catalog_family_number catalog_media_number position expiration_date
software_vendor_id name description user_name software_major_version
software_minor_version software_build_version time_zone mtf_minor_version
first_lsn last_lsn checkpoint_lsn database_backup_lsn
database_creation_date backup_start_date backup_finish_date type
sort_order code_page compatibility_level database_version backup_size
database_name server_name machine_name flags unicode_locale
unicode_compare_style collation_name is_password_protected recovery_model
has_bulk_logged_data is_snapshot is_readonly is_single_user
has_backup_checksums is_damaged begins_log_chain has_incomplete_metadata
is_force_offline is_copy_only first_recovery_fork_guid
last_recovery_fork_guid fork_point_lsn database_guid family_guid
differential_base_lsn differential_base_guid compressed_backup_size
21994 88EF77AA-3939-4F88-B258-DFFD718FD37A 21993 1 1 1 1 1 1 1 NULL 4608
DBName NULL \msa 11 0 6523 -16 0 2178000000824500038 2178000000826200001
2178000000824500038 2178000000800600038 2014-11-04 09:01:56.000 2016-07-24
20:00:04.000 2016-07-24 20:00:05.000 D 0 0 110 706 41084928 DBName Server
Server 512 1033 196609 Latin1_General_CI_AS 0 FULL 0 0 0 0 0 0 0 0 0 0
7A042FE6-F694-4A12-86A3-F2CB9E08E629 7A042FE6-F694-4A12-86A3-F2CB9E08E629
NULL 8065F34A-DFC2-4104-85A6-4E7D392CE7AC
95060D88-C832-48D0-A8A6-D9AB2F9F86AC NULL NULL 4929311
backup_set_id backup_set_uuid media_set_id first_family_number
first_media_number last_family_number last_media_number
catalog_family_number catalog_media_number position expiration_date
software_vendor_id name description user_name software_major_version
software_minor_version software_build_version time_zone mtf_minor_version
first_lsn last_lsn checkpoint_lsn database_backup_lsn
database_creation_date backup_start_date backup_finish_date type
sort_order code_page compatibility_level database_version backup_size
database_name server_name machine_name flags unicode_locale
unicode_compare_style collation_name is_password_protected recovery_model
has_bulk_logged_data is_snapshot is_readonly is_single_user
has_backup_checksums is_damaged begins_log_chain has_incomplete_metadata
is_force_offline is_copy_only first_recovery_fork_guid
last_recovery_fork_guid fork_point_lsn database_guid family_guid
differential_base_lsn differential_base_guid compressed_backup_size
47687 E688ECDD-A190-4C5F-995C-9E24B085BB90 47686 1 1 1 1 1 1 1 NULL 4608
DBName NULL \msa 11 0 7462 -16 0 2112000002352500052 2112000002354700001
2112000002352500052 2112000002325500052 2014-11-04 09:01:56.000 2018-05-27
20:00:03.000 2018-05-27 20:00:10.000 D 0 0 110 706 126986240 DBName Server
Server 512 1033 196609 Latin1_General_CI_AS 0 FULL 0 0 0 0 0 0 0 0 0 0
E010983C-854C-4991-9EDC-F06E664DEA1F E010983C-854C-4991-9EDC-F06E664DEA1F
NULL 8065F34A-DFC2-4104-85A6-4E7D392CE7AC
95060D88-C832-48D0-A8A6-D9AB2F9F86AC NULL NULL 24720173
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/sqlcollaborative/dbatools/issues/3610#issuecomment-392875528,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHdB1oIfuHYsbDaxKmO05oF1gAdrlUOks5t3Yv1gaJpZM4T_00V
.

@niphlod, I sent you a direct message in Slack, if you want to send some queries along I will run them for you.

okay, definitely artyq's history is .... kinky.
Aside from it's 2012 SP4 being bugged (which I'm not aware of), and the particular "issue" of having 5 years worth of history, these are the findings:

database_guid doesn't change. according to https://docs.microsoft.com/en-us/sql/relational-databases/system-tables/backupset-transact-sql, it should change in case of a restore and .... he actually has restorehistory records for that database. The guid, however, didn't change at all, and that's troublesome, but eliminates possible issues introduced by yours truly with the "new way" (committed via https://github.com/sqlcollaborative/dbatools/commit/045cd4ae2338f1d4d808d820b1576faacb17896b#diff-af8edf8664b7195e4a75aefffd16de63)
LSNs are reset. multiple times. with no apparent reason (no, they do not seem to match with restorehistory records, either)
for the same database, with the same GUID, LSNs are not "naturally ordered" compared with the backup_finish_date
for the same database, with the same GUID, LSNs are not "naturally ordered" compared with the backup_set_id

I'm unaware of methods to solve this problem (@artyq is available for further "inspections") other than resorting to give the user a chance to pass -Since together with -Last.
Till now, they're mutually exclusive because we/dbatools assumed the "Last" backup is the same no matter Since you inspect the history.
Granted, its history may be f***d up but he's in the situation of having to keep for compliance reason the entire set and dbatools here, while doing the proper thing ® falls short of providing the actual last backup. Thoughs @wsmelton , @Stuart-Moore , @potatoqualitee , @ClaudioESSilva , @SQLDBAWithABeard  and or ..... everybody ?

note for myself: maybe, but just maybe, begins_log_chain ?

pragmatism says allow both switches as the easiest way to fix this.
Without the exact restore history (as in the commands and means) we can't unpick this so we'd come up with a fragile solution that won't work with the next persons strange history stuff, but the 2 switch workaround would
The real world is always messier than the documentation ;)

@Stuart-Moore : found the culprit.... fork_point_lsn , which the function doesn't consider at all

In the example given it's 0 for both of the backups, so wouldn't work to distinguish
We might have to grab the latest backup and use the first and last_recovery_fork_guid values

authors: Stuart-Moore artyq niphlod

repo: sqlcollaborative/dbatools


text:
Fixed broken test

Should fix the broken test as well as removed the alias usage.
Give it some time to run the regular tests in AppVeyor. For some reason that doesn't always run the same as on my machine ...

So much for fixing broken tests ...
Once more into the breach

@FriedrichWeinmann the test were actually adjusted by @SQLDBAWithABeard (just have not done a PR yet): https://github.com/SQLDBAWithABeard/dbatools/commit/305f0bf350b966ca60c305d2c9b4c8257fee114f

Gonna return to the drawing board over this one

authors: FriedrichWeinmann wsmelton


text:
Fix Test-DBADatabaseOwner -Detailed

Type of Change

[x] Bug fix (non-breaking change, fixes #2217)
[ ] New feature (non-breaking change, adds functionality)
[ ] Breaking change (effects multiple commands or functionality)
[ ] Ran manual Pester test and has passed (`.\tests\manual.pester.ps1)
[ ] Adding code coverage to existing functionality
[x] Pester test is included
[ ] Nunit test is included
[x] Documentation
[ ] Build system

Purpose

Update Description and Help to reflect Depreciated cmdlet
Adjust selection of default TargetLogin to test
Include alias for -EnableException as seen on other cmdlets
Include Parameter check in the existing test
Approach

Removed unnecessary reference to -Detailed
Removed Default assignment in the parameter block for lines 90-93
Aliased -EnableException as Silent
Added Parameter Check in the existing describe block and tagged that block as UnitTests
Commands to test

No Functionality change, so executing any of the examples should have the same result.

Trailing spaces are going to be the death of me.

lol me too. i have to use notepad++ to clean up since my editor doesnt :(

@wsmelton  Made the requested changes. Let me know if that looks better.

authors: joshcorr potatoqualitee


text:
isCleartextTrafficPermitted() fails on OpenJDK 8 + Robolectric

How to reproduce:

Install OpenJDK 8
Use current 3.3.0-SNAPSHOT version
new OkHttpClient(): The code fails in the static initializer, when trying to figure out the platform.

The code that breaks was introduced here: https://github.com/square/okhttp/issues/2513
Either the detection of the runtime is broken, or the code is wrong there. I'll try to figure out an automatic test for this.

This is when running tests with Roboelectric, BTW. So maybe the code thinks, the Platform is android, when it's actually not.

I tried to write up a simple testcase that reproduces this, but apparently it truly is the combination of the following things that make the code fail:

OpenJDK 8
Current Snapshot
Roboelectric (needs to be an android project for this)

Okay, so because the setup is kinda contrived: Here is a sample that reproduces this...
https://github.com/kungfoo/okhttp-on-jdk-with-robolectric

Does it throw or return the wrong result?

It crashes/throws in the static initializer which results in a
ClassNotFoundException.
On May 4, 2016 14:54, "Jesse Wilson" notifications@github.com wrote:
Does it throw or return the wrong result?
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/square/okhttp/issues/2533#issuecomment-216853566

@kungfoo could you paste the stacktrace?

Will do later when I get my laptop back online...
On May 4, 2016 16:56, "Jesse Wilson" notifications@github.com wrote:

@kungfoo https://github.com/kungfoo could you paste the stacktrace?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/square/okhttp/issues/2533#issuecomment-216890889

If you want to debug the code under the described circumstances, you can simply use gradle to run the sample project I created for this.
Here's the stacktrace:
at okhttp3.internal.Platform$Android.isCleartextTrafficPermitted(Platform.java:324)
	at okhttp3.OkHttpClient.<clinit>(OkHttpClient.java:73)
	at ch.ergon.sample.CreateOkHttpClientTest.canCreateAClient(CreateOkHttpClientTest.java:17)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:251)
	at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:188)
	at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:152)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:112)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:56)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)

Wanna submit a fix?

Might be able to do that, when I'm back out of the woods... :)
On May 5, 2016 06:09, "Jesse Wilson" notifications@github.com wrote:

Wanna submit a fix?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/square/okhttp/issues/2533#issuecomment-217073027

Here's the message for the target Exception of the InvocationTargetException that gets thrown when calling the offending Method.invoke

Method getInstance in android.security.NetworkSecurityPolicy not mocked. See http://g.co/androidstudio/not-mocked for details.

Sounds like you're not using Robolectric since that message comes from the
mockable jar.
On Thu, May 26, 2016 at 12:56 AM Eliezer Graber notifications@github.com
wrote:

Here's the message for the target Exception of the
InvocationTargetException that gets thrown when calling the offending
Method.invoke
https://github.com/square/okhttp/commit/e3cd9b9f1c9787c36d5ea82190bf1e2365377e66#diff-5803d99d45dfa6a23e51dd60d44f2de9R314
Method getInstance in android.security.NetworkSecurityPolicy not mocked.
See http://g.co/androidstudio/not-mocked for details.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/square/okhttp/issues/2533#issuecomment-221777400

I'm definitely using Robolectric (verified on the call stack), which is why I was confused. Could it be a classloader issue where Class.forname is using the platform class?

Maybe, but that would be a robolectric bug in its ParallelUniverse then. If
Class.forName didn't work then things like LayoutInflater wouldn't work
either.
On Thu, May 26, 2016 at 1:09 AM Eliezer Graber notifications@github.com
wrote:

I'm definitely using Robolectric (verified on the call stack), which is
why I was confused. Could it be a classloader issue where Class.forname
is using the platform class?
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/square/okhttp/issues/2533#issuecomment-221778776

Could it be happening because I'm on Robolectric 2.4 (which I believe only supports up to API 18), and NetworkSecurityPolicy wasn't added until API 23?

Possibly. Try the latest.
On Thu, May 26, 2016 at 1:21 AM Eliezer Graber notifications@github.com
wrote:

Could it be happening because I'm on Robolectric 2.4 (which I believe only
supports up to API 18), and NetworkSecurityPolicy wasn't added until API
23?
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/square/okhttp/issues/2533#issuecomment-221780284

We're pretty stuck on 2.4, so I used the project referenced above and change the robolectric properties to use API 23. I was greeted by this when running the test:

java.lang.UnsupportedOperationException: Robolectric does not support API level 23.

Seems like a clear deficiency on their side then. Not sure what action
there would be for us to take.
On Thu, May 26, 2016 at 1:34 AM Eliezer Graber notifications@github.com
wrote:

We're pretty stuck on 2.4, so I used the project referenced above
https://github.com/square/okhttp/issues/2533#issuecomment-216811119 and
change the robolectric properties to use API 23. I was greeted by this when
running the test:
java.lang.UnsupportedOperationException: Robolectric does not support API
level 23.
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/square/okhttp/issues/2533#issuecomment-221781720

Would wrapping it in a version check help?

It's already behind one. You're compiling with API 23 (or newer) and thus
OkHttp attempts to use APIs from that version.
On Thu, May 26, 2016 at 2:11 AM Eliezer Graber notifications@github.com
wrote:

Would wrapping it in a version check help?
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/square/okhttp/issues/2533#issuecomment-221786178

Would that affect a runtime check? Something like:
Class c = Class.forName("android.os.Build$VERSION");
Field f = c.getDeclaredField("SDK_INT");
int apiLevel = f.getInt(null);

When I try that running in Robolectric it returns 21.

I'm getting
java.lang.AssertionError
	at okhttp3.internal.AndroidPlatform.isCleartextTrafficPermitted(AndroidPlatform.java:143)
	at okhttp3.OkHttpClient.<clinit>(OkHttpClient.java:73)
	at okhttp3.OkHttpClient$Builder.<init>(OkHttpClient.java:381)

with okhttp 3.3.1 and both robolectric 3.0 and 3.1-rc1
all good with okhttp 3.2.+

I was able to get the test green. Here's what I did:

Change to using OkHttp-3.3.1. The project was using a SNAPSHOT version, but 3.3 has since been released.
Upgrade to robolectric 3.1-rc1.
Added config annotation with SDK specified to the test class:

@RunWith(RobolectricGradleTestRunner.class)
@Config(sdk = 23)
public class CreateOkHttpClientTest {

As for why it works, I don't know. It appears the default SDK is 21. The bit I don't understand is why it isn't throwing a ClassNotFoundException given this class is only in SDK 23. The test project itself is depending on API 23, which may have something to do with it.

I have a vague idea of why this works now, and I opened up an issue on robolectric project. Let's see what they say, https://github.com/robolectric/robolectric/issues/2478

Robolectric 3.1-rc1 is pretty much unusable right now, as running tests take ~10x longer. Any other workarounds?

Ouch. This (hideous) workaround also appears functional with 3.0,
@RunWith(RobolectricGradleTestRunner.class)
@Config(shadows = CreateOkHttpClientTest.MyNetworkSecurityPolicy.class)
public class CreateOkHttpClientTest {

  @Test
  public void canCreateAClient() throws Exception {
    OkHttpClient client = new OkHttpClient();
    assertNotNull(client);
  }

  @Implements(NetworkSecurityPolicy.class)
  public static class MyNetworkSecurityPolicy {
    @Implementation public static NetworkSecurityPolicy getInstance() {
      try {
        Class<?> shadow = MyNetworkSecurityPolicy.class.forName("android.security.NetworkSecurityPolicy");
        return (NetworkSecurityPolicy) shadow.newInstance();
      } catch (Exception e) {
        throw new AssertionError();
      }
    }

    @Implementation public boolean isCleartextTrafficPermitted() {
      return true;
    }
  }
}

@dave-r12 the workaround works, thanks for sharing. One minor nit is that you should use Class.forName() instead ;)

A truly terrible hack for those who can't upgrade to Robolectric 3+ is to add the following class to your test module under the android.security package. Probably not a good idea if you're testing the actual NetworkSecurityPolicy.
public class NetworkSecurityPolicy {
  private static final NetworkSecurityPolicy INSTANCE = new NetworkSecurityPolicy();

  public static NetworkSecurityPolicy getInstance() {
    return INSTANCE;
  }

  public boolean isCleartextTrafficPermitted() {
    return true;
  }
}

Try with OkHttp 3.4.0-RC1 or later? I moved a few things around here.
https://github.com/square/okhttp/pull/2686

This still happens with OkHttp 3.4.1 and worse yet, @dave-r12 's no longer works

Oh, It works if you add a String argument to the isCleartetTrafficPermitted shadow method. Here's the updated (hideous) workaround:
@Implements(NetworkSecurityPolicy.class)
public class NetworkSecurityPolicyWorkaround {
    @Implementation
    public static NetworkSecurityPolicy getInstance() {
        //noinspection OverlyBroadCatchBlock
        try {
            Class<?> shadow = Class.forName("android.security.NetworkSecurityPolicy");
            return (NetworkSecurityPolicy) shadow.newInstance();
        } catch (Exception e) {
            throw new AssertionError();
        }
    }

    @Implementation
    public boolean isCleartextTrafficPermitted(String hostname) {
        return true;
    }
}

I'm not using Roboeletric, but i'm in pointing towards API 24, with okhttp version 3.4.1:
My problem is that I'm receiving a NullPointerException (when running UnitTests) in okhttp3.internal.platform.AndroidPlatform when trying to run method:
@Override public boolean isCleartextTrafficPermitted(String hostname) {
    try {
      Class<?> networkPolicyClass = Class.forName("android.security.NetworkSecurityPolicy");
      Method getInstanceMethod = networkPolicyClass.getMethod("getInstance");
      Object networkSecurityPolicy = getInstanceMethod.invoke(null);
      Method isCleartextTrafficPermittedMethod = networkPolicyClass
          .getMethod("isCleartextTrafficPermitted", String.class);
      return (boolean) isCleartextTrafficPermittedMethod.invoke(networkSecurityPolicy, hostname);
    } catch (ClassNotFoundException | NoSuchMethodException e) {
      return super.isCleartextTrafficPermitted(hostname);
    } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      throw new AssertionError();
    }
  }

which comes from RealConnection::connect.
Debugging it, it happens on the actual invoke isCleartextTrafficPermittedMethod.invoke(networkSecurityPolicy, hostname).
This problem didn't happen to me at version 3.2.0...
Can anyone help me?

@felipecsl solution (for those who can't upgrade to Robolectric 3+ works in this case too. But I really wouldn't like to use that :(

Happens with OkHttp 3.5.0 and robolectric 3.1.4

We're running into the same issue. Instead of using Robolectric directly we use unmock (which relies on Robolectric's android-all jar).

I'm so glad I found this ticket, was going crazy trying to understand why okhttp suddenly had an exception when running with robolectric

I am also still seeing this, but have resolved it with same fix as @eygraber.
note that I'm not on OpenJDK as OP was

OkHttp 3.6.0
Robolectric 3.3 only for @Config(sdk = _) < 23
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) on OSX

add to unit-tests source-set only, eg:  project-dir/app/src/test/java/android/security by default
package android.security;
// https://github.com/square/okhttp/issues/2533#issuecomment-223093100
public class NetworkSecurityPolicy {
    private static final NetworkSecurityPolicy INSTANCE = new NetworkSecurityPolicy();
    @SuppressLint("NewApi") public static NetworkSecurityPolicy getInstance() { return INSTANCE; }
    public boolean isCleartextTrafficPermitted() { return true; }
}

lastly note that this may break with OkHttp 3.7.x

Is there anything to do in OkHttp for this?

Reading this, seems like it is fixed in Robolectric 3.3

authors: JakeWharton PaulWoitaschek adelnizamutdinov bfrog dave-r12 eygraber felipecsl kungfoo swankjesse thalescm vRallev xstherrera1987 yschimke

repo: square/okhttp


text:
Response  problem

I tested and found that when request frequently response.body().bytes() can not get entire data some time 。 but when I use code below to detect response.body().bytes()， and now the problem not occured。 If not use if to detect， the problem occured again
code without exception
byte[] aa = response.body().bytes();
if (aa == null || aa.length == 0) {
logger.info("111111111");
}
return mapper.readTree(aa);
code with exception
mapper.readTree(response.body().bytes();)

Thanks for your question. This issue tracker is only for bug reports with test cases and feature requests. Please ask usage questions on Stack Overflow.
https://stackoverflow.com/questions/tagged/okhttp

authors: maotan swankjesse


text:
Mf shift cli

@SheepGoesBaa
still need to add some functionality, but this is a useable first iteration

lgtm

authors: SheepGoesBaa michaelfinch

repo: square/shift


text:
Put all module-local objects into a single manager

Closes #263

rebase

lgtm

authors: AlecStrong JakeWharton

repo: square/sqldelight


text:
Question for compile failure of example code

Hi,
I got an error, "Failed to compile" when I run the example code. I am new to React Native and the error location is not in the example code. So I wonder if this is module problem.
Failed to compile
C:/ReactNative/TestApp/node_modules/radio-buttons-react-native/RadioButtonRN.js 101:20
Module parse failed: Unexpected token (101:20)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     }
|

fadeInAnimation = () => {

|         // this.fadeAnim.setValue(0)
|         Animated.timing(this.state.fadeAnim, {
This error occurred during the build time and cannot be dismissed.

Same problem. Any solution to this problem yet?

Found a fix that works on my expo project. Just create a webpack.config.js file with the following content:
const createExpoWebpackConfigAsync = require("@expo/webpack-config");

module.exports = async function (env, argv) {
  const config = await createExpoWebpackConfigAsync(
    {
      ...env,
      babel: {
        dangerouslyAddModulePathsToTranspile: [
          // Ensure that all packages starting with @evanbacon are transpiled.
          "RadioButtonRN",
        ],
      },
    },
    argv
  );
  return config;
};

Answer from this links https://github.com/expo/expo-cli/tree/master/packages/webpack-config#include-modules

Any solution?

Any solution?

This worked for me, @ceessay,  Thanks!

authors: Vibinreji afamgit ceessay daraujo-etg tk-dev0927

repo: sramezani/radio-buttons-react-native


text:
Remove empty dirs when cleaning with Dir opt.

Signed-off-by: kuba-- kuba@sourced.tech
Fixes https://github.com/src-d/go-git/issues/895
When CleanOptions.Dir is set on true then an empty dir (with subdirs) could be removed (this is what git clean -f -d . does).

@onodera-punpun - Could you check if this fix works for you?

@kuba-- could you add a test reproducing the error on #895, please?

@ajnavarro - done. I've added a test to check if empty dirs are cleaned, as well.

Why randomly this test on windows fails?
----------------------------------------------------------------------
FAIL: <autogenerated>:1: UploadPackSuite.TearDownSuite

c:/gopath/src/gopkg.in/src-d/go-git-fixtures.v3/fixtures.go:368:
    c.Assert(Clean(), check.IsNil)
... value *os.PathError = &os.PathError{Op:"remove", Path:"C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp-tgz-799335987\\objects\\pack\\pack-a3fed42da1e8189a077c0e6846c040dcf73fc9dd.idx", Err:0x5} ("remove C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp-tgz-799335987\\objects\\pack\\pack-a3fed42da1e8189a077c0e6846c040dcf73fc9dd.idx: Access is denied.")

OOPS: 31 passed, 7 skipped, 1 FAILED
--- FAIL: Test (8.31s)

@mcuadros - PR refined.

authors: ajnavarro kuba--

repo: src-d/go-git


text:
item_by_path not  working as intended on v2.0.0-beta.0

Describe the bug
graph.drive(DRIVE_ID).item_by_path(PATH) is not formatting the URL appropriately.
To Reproduce
Steps to reproduce the behavior:
let graph = Graph::from(&confidential_client_application);
let res = graph
    .drive("<MY_DRIVE>")
    .item_by_path("/path/to/some/folder")
    .list_children()
    .send();

This generates the following URI:
/v1.0/drives/<MY_DRIVE>/root/path/to/some/folder/children

While it should generate the following URI:
/v1.0/drives/<MY_DRIVE>/root:/path/to/some/folder:/children

Error code is a 400 invalid request or 404 not found.
Expected behavior
A successful response when PATH points to an existing file or folder on the drive.
Desktop:

Windows 11
Rust nightly
VSCode

Additional context
Trying to make a backup service for a client using this crate.

Hi,
I'm using this crate for a similar project and if I remember correctly you have to add the colons yourself.
I believe the download file example specifies this in the instructions
download file example
Hope this helps!

Whoops, if it's in the examples, then this is not a bug! Thanks for the info, that is indeed how I do it right now.

Whoops, if it's in the examples, then this is not a bug! Thanks for the info, that is indeed how I do it right now.

Thanks @buhaytza2005 for clearing that up.
@samvv Sorry about that. It is actually something the sdk did do for you in a earlier version but it ended up just better for the caller to specify due to differences whether its for the root folder (top-most level folder) vs any other folder or file. For root you have to specify ":/" if you just want the metadata for only the root and for nested folders its ":/folder:". I think there were other issues but I can't remember off the top of my head right now.
There are ways to do it through different checks of couse. Id be interested to see what Microsoft's SDKs are currently doing for path based items to be honest. Possibly a feature to look at in the future.

authors: buhaytza2005 samvv sreeise

repo: sreeise/graph-rs-sdk


text:
Fix Avatar CSS

Fixed rendering of github autogenerated avatars

Why are we ditching less? The pure CSS file is already 1000LOC

authors: LunaticHacker nikiljos

repo: sreejithdikru/TinkerHub-Learning-Paths


text:
Use Angular to make calls to the API

I noticed that you used AngularJS in classifier.js file but did not use it consistently. I think that it would be beneficial to use angular to make your api calls as well. To do this you would simply create an Angular service that makes requests to the ghdata endpoints and then your Angular controller uses the service to pull in the data to bind to the front end. I think this would give the frontend a more consistent structure and would allow others to better understand what is going on.

We have both so that we could just add onto the ghdata front-end that already existed. Many of the things that we did were far more complicated in the JavaScript they had established, so that is why we added the Angular app on top.

license: mit


text:
AliasResolutionInstruct missing in active.de.toml

If default language is German the alias page is empty and shouts an error:
alias-resolve render errr: render: template(alias.tmpl) execution failed: template: alias.tmpl:5:32: executing "content" at <i18n "AliasResolutionInstruct">: error calling i18n: i18n/error: failed to localize label AliasResolutionInstruct: message "AliasResolutionInstruct" not found in language "de"

Sorry you ran into this and thanks for reporting.
I plan to spend a day on the localization feature next week and this will surely be on the list of things.

Cool, thank you!
If you need more or better German translation, I can also help.

Yes, feel free!
I know some of them are a bit goofy. See also: https://github.com/ssb-ngi-pointer/go-ssb-room/issues/83#issuecomment-854355457

Since https://github.com/ssb-ngi-pointer/go-ssb-room/pull/257#issuecomment-976465264 is merged, I think this can be closed?

authors: cryptix decentral1se pathab

repo: ssb-ngi-pointer/go-ssb-room


text:
Binary codec prep

rewrote some of the internals a wee bit so that it's easier to map to a binary codec.
We where keeping a counter of packets in a stream, but we never actually used that for anything,
so I dropped that and just left streams to be either true or not.
to be used with:
https://github.com/dominictarr/packet-stream-codec

by the way, this is a breaking change.

merged into 2.0.0

repo: ssbc/packet-stream


text:
Unload unnecessary systems

Hi,
I wonder if we have some sort of functionality that some of the systems can be turned off during runtime.
Take tower defense as an example. The players can first build their bases, then start the game to defeat the enemies. Apparently those building related systems are not needed during the fight.

you can separate systems into different steps.
_systemsAlwaysToExecute.execute();
if(GameStateService.condition== true)
_systemsExecuteWhenCondtionIstrue.execute();

I see 3 common ways to do this:

Systems know themselves when to execute

class MySystem {

   void Execute() {
        if (context.isInBattle) {
             // Battle logic
        }
    }
}

Systems are managed by the parent system

public sealed class UpdateSystems : Feature {

    readonly Contexts _contexts;

    public UpdateSystems(Contexts contexts) {
        _contexts = contexts;

        Add(new MySystem(contexts));
        // add other systems
    }

    public override void Execute() {
        if (_contexts.game.isInBattle) {
            base.Execute();
        }
    }
}

Instead of hardcoding the condition you can also create a GuardSystem which takes a function to check a condition, so the GuardSystem can be reused for multiple scenarios.

What @surferau suggested

I just place the System Initialize and Update calls in a separate GameObject / MonoBehaviour.
That can then be easily enabled or disabled.

I highly recommend the first solution that simon wrote, because it's not necessary to turn off and on a system if it's only executed if the required conditions are met. It's really helpful to see in what condition the system is executed by trigger/filter, instead of debugging down the road to know which system is which enabling or disabling or worse execution is dependent on some unity monobehaviour state. Especially if you have a big game.
It's not a big deal to have many thousand systems at the same time if they are reactive and not getting executed all at the same time.

authors: StormRene sschmid surferau thygrrr yanjingzhaisun

repo: sschmid/Entitas-CSharp