Pod terminated with OOMKilled

What happened?
The provider pod is often terminated with OOMKilled.
How can we reproduce it?
Run it with the memory limit set to 1Gi.
What environment did it happen in?

Crossplane Version: Helm chart 1.9.0
Provider Version: 0.37.0
Kubernetes Version: 1.26.6
Kubernetes Distribution: v1.26.6-eks-a5565ad

Remarks
By default the resources object is empty in the pod. What is the amount memory needed by the provider?

@wdonne I assume you used the monolithic provider-aws package rather than the family provider ones?
If so, then this will be helpful here: https://github.com/upbound/upjet/blob/main/docs/sizing-guide.md
I'll close this issue for now, but feel free to revert back if you still run into issues.

I have switched to the AWS family providers, but my provider-aws-iam gets OOMKilled, while I gave it 1.5GB. We can't give all members of the family that much memory. It would result in a huge cluster.

We have 10 cores 12GB for aws-ec2 alone and it's not enough:
observe failed: cannot run refresh: refresh failed: failed to read
        schema for aws_eip.test-nat-gateway in
        registry.terraform.io/hashicorp/aws: failed to instantiate provider
        "registry.terraform.io/hashicorp/aws" to obtain schema: timeout while
        waiting for plugin to start:
        ```
@wdonne, would you mind re-opening the issue?

@gmykhailiuta I don't have the permission to reopen the issue because I didn't close if myself.
@jeanduplessis Would you reopen it? I think there clearly is a memory problem.

@wdonne, @siddharthdeshmukh, @gmykhailiuta I cannot reproduce the issue in v0.40.0 with the information provided. Does this issue always occur, and which versions are you using? and provide us the full ControllerConfig please.

Thank you for taking care of it!
This issue seems to get worse the more resources we migrate to Upbound providers (ec2, iam, eks, route53). Ec2 is currently one of the most heavily used. It manages 238 resources. Could you try with 250+ resources please?
I've also noticed that most load comes in the first few minutes following provider pod's creation like if all resources are polled at once, then it gets more even. It would be nice to introduce a random delay per each resource.
ControllerConfig spec used by aws-ec2 provider:
apiVersion: pkg.crossplane.io/v1alpha1
kind: ControllerConfig
metadata:
  annotations:
    argocd.argoproj.io/sync-options: Validate=false
    argocd.argoproj.io/sync-wave: "-1"
    eks.amazonaws.com/role-arn: arn:aws:iam::627218074315:role/crossplane-provider-aws
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"pkg.crossplane.io/v1alpha1","kind":"ControllerConfig","metadata":{"annotations":{"argocd.argoproj.io/sync-wave":"-1","eks.amazonaws.com/role-arn":"arn:aws:iam::627218074315:role/crossplane-provider-aws"},"name":"crossplane-provider-aws-xl"},"spec":{"args":["--debug","--enable-external-secret-stores","--provider-ttl=250","--max-reconcile-rate=10","--terraform-native-provider-path",""],"podSecurityContext":{"fsGroup":2000},"resources":{"limits":{"cpu":"16000m","memory":"12000Mi"},"requests":{"cpu":"14000m","memory":"12000Mi"}}}}
  creationTimestamp: "2023-08-29T17:43:48Z"
  generation: 13
  labels:
    app.kubernetes.io/component: crossplane
    app.kubernetes.io/instance: provider-aws-xl
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/part-of: crossplane
    argocd.argoproj.io/instance: infra-crossplane
    helm.sh/chart: crossplane-1.12.2
  name: crossplane-provider-aws-xl
  resourceVersion: "997346283"
  uid: 41119bd7-f1ef-41f2-bb3e-31aff4a896cd
spec:
  args:
  - --debug
  - --enable-external-secret-stores
  - --provider-ttl=250
  - --max-reconcile-rate=10
  - --sync=48h
  - --poll=48h
  - --terraform-native-provider-path
  - ""
  podSecurityContext:
    fsGroup: 2000
  resources:
    limits:
      cpu: 10000m
      memory: 20000Mi
    requests:
      cpu: 8000m
      memory: 18000Mi

Versions in use:

crossplane v1.12.2
provider-family-aws v0.37.0
provider-aws-ec2 v0.39.0

Hello @turkenf ,
This is the ControllerConfig resource:
apiVersion: pkg.crossplane.io/v1alpha1
kind: ControllerConfig
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"pkg.crossplane.io/v1alpha1","kind":"ControllerConfig","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"crossplane-providers"},"name":"iam-config"},"spec":{"resources":{"limits":{"cpu":"100m","ephemeral-storage":"512Mi","memory":"1.5Gi"}}}}
  creationTimestamp: "2023-08-30T16:26:43Z"
  generation: 2
  labels:
    app.kubernetes.io/instance: crossplane-providers
  name: iam-config
  resourceVersion: "167225794"
  uid: 4ffe441f-9daa-493c-8f21-23c41eb17cb9
spec:
  resources:
    limits:
      cpu: 100m
      ephemeral-storage: 512Mi
      memory: 1.5Gi

and this is the live manifest of the IAM provider pod:
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2023-09-08T11:10:12Z"
  generateName: provider-aws-iam-e4667f1b5f01-6c49d6d4f5-
  labels:
    pkg.crossplane.io/provider: provider-aws-iam
    pkg.crossplane.io/revision: provider-aws-iam-e4667f1b5f01
    pod-template-hash: 6c49d6d4f5
  name: provider-aws-iam-e4667f1b5f01-6c49d6d4f5-4j6fr
  namespace: crossplane-system
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicaSet
    name: provider-aws-iam-e4667f1b5f01-6c49d6d4f5
    uid: 618d039d-1249-42c7-9952-2055386a1266
  resourceVersion: "182253284"
  uid: 58aa7444-ca94-4d3a-a689-89d50335ddc6
spec:
  containers:
  - env:
    - name: POD_NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace
    - name: WEBHOOK_TLS_CERT_DIR
      value: /webhook/tls
    image: xpkg.upbound.io/upbound/provider-aws-iam:v0.39.0
    imagePullPolicy: IfNotPresent
    name: provider-aws-iam
    ports:
    - containerPort: 8080
      name: metrics
      protocol: TCP
    - containerPort: 9443
      name: webhook
      protocol: TCP
    resources:
      limits:
        cpu: 100m
        ephemeral-storage: 512Mi
        memory: 1536Mi
      requests:
        cpu: 100m
        ephemeral-storage: 512Mi
        memory: 1536Mi
    securityContext:
      allowPrivilegeEscalation: false
      privileged: false
      runAsGroup: 2000
      runAsNonRoot: true
      runAsUser: 2000
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /webhook/tls
      name: webhook-tls-secret
      readOnly: true
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: kube-api-access-rn4l6
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  nodeName: ip-192-168-151-92.eu-central-1.compute.internal
  nodeSelector:
    kubernetes.io/arch: arm64
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext:
    runAsGroup: 2000
    runAsNonRoot: true
    runAsUser: 2000
  serviceAccount: provider-aws-iam-e4667f1b5f01
  serviceAccountName: provider-aws-iam-e4667f1b5f01
  terminationGracePeriodSeconds: 30
  tolerations:
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 300
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 300
  volumes:
  - name: webhook-tls-secret
    secret:
      defaultMode: 420
      items:
      - key: tls.crt
        path: tls.crt
      - key: tls.key
        path: tls.key
      secretName: webhook-tls-secret
  - name: kube-api-access-rn4l6
    projected:
      defaultMode: 420
      sources:
      - serviceAccountToken:
          expirationSeconds: 3607
          path: token
      - configMap:
          items:
          - key: ca.crt
            path: ca.crt
          name: kube-root-ca.crt
      - downwardAPI:
          items:
          - fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
            path: namespace
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2023-09-08T11:10:12Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2023-09-12T08:18:32Z"
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2023-09-12T08:18:32Z"
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2023-09-08T11:10:12Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: containerd://42e19daae04d12d7241d354c4976d516bdc50bf893b9ec686fbebc00ce290645
    image: xpkg.upbound.io/upbound/provider-aws-iam:v0.39.0
    imageID: xpkg.upbound.io/upbound/provider-aws-iam@sha256:e4667f1b5f015718d4e39d4005dbf002e91fa34b683439da7e2fe232ce688175
    lastState:
      terminated:
        containerID: containerd://725e32a4691d251af681ba5e1efbd5f78e3a7dfdbf42456281ec55b8f632189e
        exitCode: 137
        finishedAt: "2023-09-12T08:15:37Z"
        reason: OOMKilled
        startedAt: "2023-09-12T08:12:49Z"
    name: provider-aws-iam
    ready: true
    restartCount: 334
    started: true
    state:
      running:
        startedAt: "2023-09-12T08:18:31Z"
  hostIP: <IP_ADDRESS>
  phase: Running
  podIP: <IP_ADDRESS>
  podIPs:
  - ip: <IP_ADDRESS>
  qosClass: Guaranteed
  startTime: "2023-09-08T11:10:12Z"

Note also that the provider currently manages only 19 resources.

I now upgraded to version 0.40.0 and the problem still occurs.

@wdonne in your case, I think the error you are getting is due to your CPU limit. Since a low CPU value causes more memory consumption, your pod is terminated with OOMKilled.
My test pod, which manages more than 50 resources, is working properly with the following values:
  resources:
    limits:
      cpu: 2
      ephemeral-storage: 512Mi
      memory: 1.5Gi

> k get pods -n crossplane-system provider-aws-iam-d4638f0c5651-7bbfd5cd57-qwdgm -o yaml -w
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2023-09-12T12:50:58Z"
  generateName: provider-aws-iam-d4638f0c5651-7bbfd5cd57-
  labels:
    pkg.crossplane.io/provider: provider-aws-iam
    pkg.crossplane.io/revision: provider-aws-iam-d4638f0c5651
    pod-template-hash: 7bbfd5cd57
  name: provider-aws-iam-d4638f0c5651-7bbfd5cd57-qwdgm
  namespace: crossplane-system
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicaSet
    name: provider-aws-iam-d4638f0c5651-7bbfd5cd57
    uid: 913342c9-5771-4639-a016-4d1ffa6e3de1
  resourceVersion: "20745"
  uid: 2f2195dd-4617-4918-9770-b4d10ebbd129
spec:
  containers:
  - env:
    - name: POD_NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace
    - name: WEBHOOK_TLS_CERT_DIR
      value: /webhook/tls
    image: xpkg.upbound.io/upbound/provider-aws-iam:v0.40.0
    imagePullPolicy: IfNotPresent
    name: provider-aws-iam
    ports:
    - containerPort: 8080
      name: metrics
      protocol: TCP
    - containerPort: 9443
      name: webhook
      protocol: TCP
    resources:
      limits:
        cpu: "2"
        ephemeral-storage: 512Mi
        memory: 1536Mi
      requests:
        cpu: "2"
        ephemeral-storage: 512Mi
        memory: 1536Mi
...
..
.
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2023-09-12T12:50:58Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2023-09-12T12:50:59Z"
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2023-09-12T12:50:59Z"
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2023-09-12T12:50:58Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: containerd://b2c900a2c33ba21c578d71e25fe51100e9250683588a4061ff00807579a4f09f
    image: xpkg.upbound.io/upbound/provider-aws-iam:v0.40.0
    imageID: xpkg.upbound.io/upbound/provider-aws-iam@sha256:d4638f0c56511b0d3bbcf565da6e8e14b6304168eb252573413182de85f7f2a8
    lastState: {}
    name: provider-aws-iam
    ready: true
    restartCount: 0
    started: true
    state:
      running:
        startedAt: "2023-09-12T12:50:58Z"
  hostIP: <IP_ADDRESS>
  phase: Running
  podIP: <IP_ADDRESS>
  podIPs:
  - ip: <IP_ADDRESS>
  qosClass: Guaranteed
  startTime: "2023-09-12T12:50:58Z"

Can you try again by increasing the CPU and let us know?

@gmykhailiuta I couldn't test your situation, but I think it can be solved by trying different variations with limits. I also recommend you to check here for more detailed information about the tests performed.
Please test it in the latest provider version and If you still think there is a problem, share the results with us in detail.

@turkenf I first gave it 1 CPU and then 2. In both cases it was OOMKilled after a few seconds, so much faster.

@wdonne could you please share us provider's log(with debug logs enabled) and output of kubectl get managed?

@turkenf How can I set the loglevel to debug?
This is the log I have so far:
[controller-runtime] log.SetLogger(...) was never called, logs will not be displayed:
goroutine 1 [running]:
runtime/debug.Stack()
    runtime/debug/stack.go:24 +0x64
sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
    sigs.k8s.io/controller-runtime@v0.15.0/pkg/log/log.go:59 +0x104
sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithValues(0x40000ce780, {0x4001bb1000, 0x2, 0x2})
    sigs.k8s.io/controller-runtime@v0.15.0/pkg/log/deleg.go:168 +0x3c
github.com/go-logr/logr.Logger.WithValues(...)
    github.com/go-logr/logr@v1.2.4/logr.go:323
sigs.k8s.io/controller-runtime/pkg/builder.(*Builder).doController(0x4001b45b00, {0x4102ae0, 0x40079bff40})
    sigs.k8s.io/controller-runtime@v0.15.0/pkg/builder/controller.go:384 +0x314
sigs.k8s.io/controller-runtime/pkg/builder.(*Builder).Build(0x4001b45b00, {0x4102ae0?, 0x40079bff40?})
    sigs.k8s.io/controller-runtime@v0.15.0/pkg/builder/controller.go:239 +0x40
sigs.k8s.io/controller-runtime/pkg/builder.(*Builder).Complete(...)
    sigs.k8s.io/controller-runtime@v0.15.0/pkg/builder/controller.go:222
github.com/upbound/provider-aws/internal/controller/iam/accesskey.Setup({0x4148a30, 0x40002a6820}, {{{0x4131680, 0x400000c108}, {0x4130ff0, 0x40005ffe10}, 0x8bb2c97000, 0xa, 0x4001bb0aa0, 0x0}, ...})
    github.com/upbound/provider-aws/internal/controller/iam/accesskey/zz_controller.go:58 +0x10b4
github.com/upbound/provider-aws/internal/controller.Setup_iam({0x4148a30, 0x40002a6820}, {{{0x4131680, 0x400000c108}, {0x4130ff0, 0x40005ffe10}, 0x8bb2c97000, 0xa, 0x4001bb0aa0, 0x0}, ...})
    github.com/upbound/provider-aws/internal/controller/zz_iam_setup.go:65 +0x1f8
main.main()
    github.com/upbound/provider-aws/cmd/provider/iam/zz_main.go:147 +0x2a9c
{"level":"info","ts":"2023-09-14T11:58:27Z","logger":"provider-aws","msg":"Native Terraform provider process error","handle":"d8a857988e269bd8df1d6153cb94773d7b22a652b6cca647536414f804da4141","ttl":100,"ttlMargin":0.1,"nativeProviderPath":"/terraform/provider-mirror/registry.terraform.io/hashicorp/aws/4.67.0/linux_arm64/terraform-provider-aws_v4.67.0_x5","nativeProviderArgs":[],"error":"signal: killed"}
Stream closed EOF for crossplane-system/provider-aws-iam-d4638f0c5651-86b94bf94b-9ths5 (provider-aws-iam)

And this is the output of kubectl get managed:
NAME                                                                  READY   SYNCED   EXTERNAL-NAME                               AGE
policy.iam.aws.upbound.io/cert-manager-policy                         True    False    cert-manager-policy                         15d
policy.iam.aws.upbound.io/clb-tst-secrets-manager-policy              True    False    clb-tst-secrets-manager-policy              15d
policy.iam.aws.upbound.io/kaleido-tst-secrets-manager-policy          True    False    kaleido-tst-secrets-manager-policy          15d
policy.iam.aws.upbound.io/lemonade-traefik-oidc-delegate-ecr-policy   True    False    lemonade-traefik-oidc-delegate-ecr-policy   15d
policy.iam.aws.upbound.io/tooling-secrets-manager-policy              True    False    tooling-secrets-manager-policy              15d
policy.iam.aws.upbound.io/value-injector-ecr-policy                   True    False    value-injector-ecr-policy                   15d
policy.iam.aws.upbound.io/zorglink-tst-secrets-manager-policy         True    False    zorglink-tst-secrets-manager-policy         15d

NAME                                                                                READY   SYNCED   EXTERNAL-NAME                                                        AGE
rolepolicyattachment.iam.aws.upbound.io/cert-manager-attachment                         True    False    cert-manager-role-20230830100923301400000004                         15d
rolepolicyattachment.iam.aws.upbound.io/clb-tst-secrets-manager-attachment              False   False                                                                         15d
rolepolicyattachment.iam.aws.upbound.io/crossplane-ec2-attachment                       True    False    crossplane-ec2-role-20230830100842783600000002                       15d
rolepolicyattachment.iam.aws.upbound.io/crossplane-rds-attachment                       True    False    crossplane-rds-role-20230830100837055200000001                       15d
rolepolicyattachment.iam.aws.upbound.io/kaleido-tst-secrets-manager-attachment          False   False                                                                         15d
rolepolicyattachment.iam.aws.upbound.io/lemonade-traefik-oidc-delegate-ecr-attachment   True    False    lemonade-traefik-oidc-delegate-ecr-role-20230830100909852300000003   15d
rolepolicyattachment.iam.aws.upbound.io/tooling-secrets-manager-attachment              True    False                                                                         15d
rolepolicyattachment.iam.aws.upbound.io/value-injector-ecr-attachment                   True    False    value-injector-ecr-role-20230830101000179800000005                   15d
rolepolicyattachment.iam.aws.upbound.io/zorglink-tst-secrets-manager-attachment         True    False    zorglink-tst-secrets-manager-role-20230913195710729200000001         15d

NAME                                                              READY   SYNCED   EXTERNAL-NAME                             AGE
role.iam.aws.upbound.io/cert-manager-role                         True    False    cert-manager-role                         15d
role.iam.aws.upbound.io/clb-tst-secrets-manager-role              True    False    clb-tst-secrets-manager-role              15d
role.iam.aws.upbound.io/crossplane-ec2-role                       True    False    crossplane-ec2-role                       15d
role.iam.aws.upbound.io/crossplane-rds-role                       True    False    crossplane-rds-role                       15d
role.iam.aws.upbound.io/kaleido-tst-secrets-manager-role          True    False    kaleido-tst-secrets-manager-role          15d
role.iam.aws.upbound.io/lemonade-traefik-oidc-delegate-ecr-role   True    False    lemonade-traefik-oidc-delegate-ecr-role   15d
role.iam.aws.upbound.io/tooling-secrets-manager-role              True    False    tooling-secrets-manager-role              15d
role.iam.aws.upbound.io/value-injector-ecr-role                   True    False    value-injector-ecr-role                   15d
role.iam.aws.upbound.io/zorglink-tst-secrets-manager-role         True    False    zorglink-tst-secrets-manager-role         15d

Hi,
In my case the issue was fixed by increasing the memory limits.
Here is the controller config for the same
apiVersion: pkg.crossplane.io/v1alpha1
kind: ControllerConfig
metadata:
  name: upbound-provider-aws-ec2-controller-config
spec:
  replicas: 1
  resources:
    limits:
      memory: 8Gi
    requests:
      cpu: 2000m
      memory: 4Gi
  securityContext:
    allowPrivilegeEscalation: false
    capabilities:
      drop:
        - ALL
    readOnlyRootFilesystem: false
    runAsNonRoot: true
  serviceAccountName: upbound-provider-aws-ec2-sa

But now I am facing another issue  where aws-ec2-provider ends up using all the Available CPU on nodes. Not sure if having limits on CPU will have any negative impact on the provider.
We also ended up using more resources on the node when we migrated to provider family instead of monolith provider.
In our case currently we are using following providers

ec2 (Around 300+ resources including vpc endpoints, security groups, vpc endpoint associations & security group rules etc)
eks ( Around 20+ resources)
iam (Around 150+ resources)
kms
efs
autoscaling
cloudwatch logs

Seeing the same with the IAM aws family provider v0.41.0


feat: services to recieve data for account

Is RetrieveChangeOwner used somewhere else, expect synthetix-accounts-listener?
I am not sure if we should change internal implementation details of  RetrieveChangeOwner in that case, because it can break something


Fix switch default without semicolon

Closes #185 and partially #187
The default case has an optional semicolon now.
What does not work out is a single-line switch statement.

@Lotes any chance we can get this merged soon? It's one of the most prevalent bug flags we see.

@dhuebner do you have time for this? I became sick today. Not sure if I become healthy next week.

@Lotes
I will look into it tomorrow

@Lotes
Example from #187 seems to be a plain CompoundStatement:
SWITCH i; CASE 1; PRINT "1"; BREAK; CASE DEFAULT; PRINT "default"; SWEND
I think the best would be to handle switch swend same as while wend, additionally allow case to be a separated statement. Doing so the code above would just work.
Right now it seems to be more important to be flexible in syntax and allow more than allowed.  We should later add a simple validation that checks that case is inside a switch "block" .
Overall I have an impression that ; is just a replacement for a line break that allows to write everything in one line.

@StephanWald
The parser is now more lax and will not report errors where it shouldn't, but might accept switch statements constellation that is not valid. A follow-up is created #206


feat: HashType.from_composite_str for Blake2b, SHA3, Blake3

The code mistreated hashes for Blake2b and SHA3.
Code for explicitly handling SHA1 & BLAKE3 was added, as those have no variants defined in the CycloneDX specification.
fixes #652

released via https://github.com/CycloneDX/cyclonedx-python-lib/releases/tag/v7.6.0


[HHDS] First blog post and user profile created

I have added my user details and the first blog post with the link to my proposal here.

Looks good. Please try to include an image on later blogs if possible.

Looks good. Please try to include an image on later blogs if possible.
Thank you! I will surely include images from the next time.


sokol_app.h: Scroll event amounts are inconsistent between browsers

The scroll event doesn't take the wheel event units into account resulting in Firefox scrolling a lot slower than Chrome (on Windows).
I have fudged the values to be consistent with what the Win32 backend returns on Windows, I didn't test DOM_DELTA_PAGE as I didn't happen to have a browser that emits it handy:
https://github.com/bqqbarbhg/spear/blob/ab4b57edd4cc622bd9b933cb17bb89e188fe9e43/src/ext/sokol/sokol_app_impl.h#L2110-L2124
// ... _sapp_emsc_wheel_cb()
float scale = -0.1f;
switch (emsc_event->deltaMode) {
case DOM_DELTA_PIXEL:
	scale = -0.04f;
	break;
case DOM_DELTA_LINE:
	scale = -1.3333f;
	break;
case DOM_DELTA_PAGE:
	scale = -10.0f;
	break;
}
_sapp.event.scroll_x = scale * (float)emsc_event->deltaX;
_sapp.event.scroll_y = scale * (float)emsc_event->deltaY;

This might break existing user code depending on the scroll unit behavior (especially if changing the Chrome's DOM_DELTA_PIXEL unit from -0.1f). Feel free to swipe the snippet and/or tweak the values to your liking if you're interested :D I can also do a PR for this if it's easier.

Yeah I noticed this too, but haven't investigated, so many thanks for doing that :)
It seems like mouse movement and resolution is generally quite a mess to get consistent across platforms (also when using the native APIs), but if there are hints like this (e.g. the deltaMode), then we should make use of it.
I'm currently working on a pointer-lock feature (in the branch pointer-lock-2), and since I'm dealing with mouse stuff there anyway I'll integrate your fix there (I'll also need to read up on this deltaMode thing first).

Ok, I've added your fix to sokol_app.h, it's currently in the branch pointer-lock-2 though. I'll update the sokol-samples webpage so you can check if it feels correct now.

You can test the fix here: https://floooh.github.io/sokol-html5/cgltf-sapp.html
(I should add some smoothing to the camera zoom though).
I guess this feature will close automatically when the pointer-lock-2 branch is merged (should happen in the next few days).

Cool thanks! Seems consistent to me now!

...and this has just been merged.


[MRG] DOC: use morlet instead of multitaper

closes #223
I was messing around with the gamma examples and realized that HNN-GUI uses a morlet wavelet for TFR. This is an attempt to make them more similar and add a colorbar.
While I was at it, I also updated the tonic input example and made a couple of fixes there.

Codecov Report

Merging #226 (bbc0dfd) into master (8171482) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #226   +/-   ##
=======================================
  Coverage   67.16%   67.16%
=======================================
  Files          21       21
  Lines        2266     2266
=======================================
  Hits         1522     1522
  Misses        744      744

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 8171482...bbc0dfd. Read the comment docs.

@ntolley incorporated the raster plot in this example now. Take a look at the example in the CircleCI artifact tab once it is built.
It's trying to reproduce this: https://jonescompneurolab.github.io/hnn-tutorials/gamma/gamma.
The merge button is yours when you're happy with the changes/plots.

new plots: https://755-168215891-gh.circle-artifacts.com/0/html/auto_examples/plot_simulate_gamma.html#sphx-glr-auto-examples-plot-simulate-gamma-py

ping ping, any blockers with the reviews here?

ping ping, any blockers with the reviews here?

Gonna commit a small crime and self-merge to keep things moving with #221
Thanks for the reviews @ntolley and @cjayb

Gonna commit a small crime and self-merge to keep things moving with #221
Thanks for the reviews @ntolley and @cjayb

if you disagree with something, feel free to follow up with PRs :)

if you disagree with something, feel free to follow up with PRs :)


Wrong comparison in jtw/jwt.go

I am testing my JWT Factory (GenerateJWT) that receives parameters from a HTTP request.
When comparing parsed claims with the expected claims, the validation will fail because the expected claims is a slice and the parsed one is a string: (I placed a breakpoint at jwt/jwt.go)
(godebug) l

    	if jti, ok := v.Expected.JWTID(); ok &&
    		j.Claims().Get("jti") != jti {
    		return ErrInvalidJTIClaim
    	}
--> 	_ = "breakpoint"
    	if aud, ok := v.Expected.Audience(); ok &&
    		!eq(j.Claims().Get("aud"), aud) {
    		return ErrInvalidAUDClaim
    	}

(godebug) p v.Expected.Audience()
[]string{"report"}, true
(godebug) p j.Claims().Get("aud")
"report"

JWT package have no tests. I can send some PR to fix these bugs and have tests, if they are welcome.

Update: when comparing, you should use the same method to retrieve Audience, Subject and etc:
If you use Audience() instead of Get("aud") you should get the right types:
(godebug) p j.Claims().Get("aud")
"report"
(godebug) p j.Claims().Audience()
[]string{"report"}, true

I think it'd be a better API if setting the audience only ever took ...string (since the RFC allows one or more string values). It'd also internal comparisons easier since it'd just require comparing two slices.
I'll get back to this + your PR in a bit after a meeting.

Just noticed I forgot to close this.
Thanks again for the PR!.


cmd/go2go: cannot infer generic types when functions have no parameter

my code: https://go2goplay.golang.org/p/RmdhTCJTy1Q
What did you expect to see?
nothing
What did you see instead?
type checking failed for main
prog.go2:11:14: cannot infer T (prog.go2:3:11) ([<nil>])
prog.go2:17:14: cannot infer T (prog.go2:3:11) ([<nil>])

but this is works https://go2goplay.golang.org/p/T46pnt3s8kH

The go2go playground is out of date, we are in the process of decommissioning it, see https://github.com/golang/go/issues/48517. At the moment we don't have a "preview of 1.18" playground set up (hopefully that will happen soon). In the mean time, you might consider using https://pkg.go.dev/golang.org/dl/gotip (with appropriate caveats). Thanks.


how  to  enabled   master   slave syn ?

sir . how  to  enabled powerdns   master   slave syn ?

share  remote-connection-string=http:url=http://<IP_ADDRESS>:3000/dnsapi  is ok ？

sir . how to enabled powerdns master slave syn ?

Master-Slave replication https://dev.mysql.com/doc/refman/5.5/en/replication.html
Multi-Master replication http://galeracluster.com/

share remote-connection-string=http:url=http://<IP_ADDRESS>:3000/dnsapi is ok ？

https://github.com/AlekseyChudov/powergslb/blob/master/pdns/pdns.conf

is support  DNS Failover & Monitoring checks ?

is support DNS Failover & Monitoring checks ?

https://github.com/AlekseyChudov/powergslb/blob/master/README.md#health-checks

i have  2 web server .
how to setup    Normal situation points to primary IP, if primary IP fails, auto switch to standby iP  ？

Setup health check for both A record and increase weight of one record.

Don't understand, can you give me a demonstration?  so  thanks .

Primary (fallback 0)

Standby (fallback 1)

okay . so thanks .
if   one Primary   two Standby  fallback is   0  1  2 ?

It depends on your needs. If both standby servers have the same weight, both will be returned by DNS in case of a failure of the primary server. If the standby servers have different weights, they will be returned by DNS in order of their weight.

Primary  set  fallback  is 0   . standby servers set  fallback is 1 . but  dns responds to 2 records at the same time. I just want the master server to return to the master server iP in the normal state. The main machine is down. Returning the backup IP automatically

I'm sorry for incorrect answer. Please try "weight" instead of "fallback".

okay. i  setup   weight .  if  two server  is down . how to setup  default   records .

And what do you want to return if both servers are down?

if  both  server  are down .i want  to return  default   records .

You can configure the records as shown in the table

Name
Type
Content
Weight
Monitor

test.example.com
A
<IP_ADDRESS>
100
HTTP request /status

test.example.com
A
<IP_ADDRESS>
10
HTTP request /status

test.example.com
A
<IP_ADDRESS>
1
No check

i  two  powerdns server   setup Multi-Master replication  .  so   health check  from  two server  ?

The health checks are independent for PowerGSLB instances. So yes, health checks are performed from two servers in the case of two nodes.


ignores # fmt: off for E501

A minimal code snippet that reproduces the bug.
# zeus/urls.py
def path(path: str, handler):
    return

def calculate_project_request_proposed_mentors():
    return

urlpatterns = [
    # fmt: off
    path("project-request/<int:project_request_id>/calculate-proposed-mentors/", calculate_project_request_proposed_mentors),  # noqa: E501
    # fmt: on
]

The command you invoked (e.g., ruff /path/to/file.py --fix), ideally including the --isolated flag.
> poetry run ruff format zeus/urls.py --isolated
1 file reformatted

🙂
def path(path: str, handler):
    return

def calculate_project_request_proposed_mentors():
    return

urlpatterns = [
    # fmt: off
    path(
        "project-request/<int:project_request_id>/calculate-proposed-mentors/",
        calculate_project_request_proposed_mentors,
    ),  # noqa: E501
    # fmt: on
]

The current Ruff settings (any relevant sections from your pyproject.toml).
> pyproject.toml | grep line-length
line-length = 120

The current Ruff version (ruff --version).
> poetry run ruff --version
ruff 0.7.3

# fmt: off
def path(path: str, handler):
    return

def calculate_project_request_proposed_mentors():
    return

urlpatterns = [
    path("project-request/<int:project_request_id>/calculate-proposed-mentors/", calculate_project_request_proposed_mentors),  # noqa: E501
]

> poetry run ruff format zeus/urls.py
1 file left unchanged

I'm stupid. But your documentation doesn't emphasize that you are writing examples that are not working. Probably you should improve on that.


Release Dotty 0.13.0-RC1 for mill

Update the versions and rebase to get the changes of the new files.
Now it raises the good old CompilerInterface, this is related to the broken bridge issue, right?
Related to https://github.com/lampepfl/dotty/pull/5596
root.compile java.lang.ClassNotFoundException: xsbt.CompilerInterface
    java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    java.lang.Class.forName0(Native Method)
    java.lang.Class.forName(Class.java:348)
    sbt.internal.inc.AnalyzingCompiler.getInterfaceClass(AnalyzingCompiler.scala:267)
    sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:234)
    sbt.internal.inc.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:134)
    sbt.internal.inc.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala

Now it raises the good old CompilerInterface, this is related to the broken bridge issue, right?

Someone needs to add support for the new bridge setup based on a binary jar instead of sources, until then, we can't upgrade the mill project.

Looks like someone fixed mill to get the compile-the-bridge-from-sources working, so you should be able to merge this PR once a new mill release is out: https://github.com/lihaoyi/mill/pull/569

Oh! Perfect. Will stay on top of this. Thx!

mill 0.4.0 has been released so this should work now.

@anatoliykmetyuk this PR rebased the changes for mill on top of master. Maybe we should re-rebase and check if mill works. If yes then we can re-include it on our release cycle.


Fuzz all plugins

Need to run all plugins through AFL.

I've moved this to a separate project: CompFuzz


python310Packages.shapely: 1.8.4 -> 2.0.0

Description of changes
https://shapely.readthedocs.io/en/latest/release/2.x.html#version-2-0-0

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
23.05 Release Notes (or backporting 22.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

Can you run nixpkgs-review?.

Result of nixpkgs-review pr 207410 run on aarch64-darwin 1

16 packages marked as broken and skipped:

easyocr
flatcam
python310Packages.bsuite
python310Packages.descartes
python310Packages.easyocr
python310Packages.mask-rcnn
python310Packages.opensfm
python310Packages.rlax
python310Packages.wrf-python
python39Packages.bsuite
python39Packages.descartes
python39Packages.easyocr
python39Packages.mask-rcnn
python39Packages.opensfm
python39Packages.rlax
python39Packages.wrf-python

2 packages failed to build:

python310Packages.osmnx
python39Packages.osmnx

41 packages built:

mapproxy
pgcli (python310Packages.pgcli)
python310Packages.aplpy
python310Packages.asf-search
python310Packages.basemap
python310Packages.cartopy
python310Packages.flask-admin
python310Packages.geoalchemy2
python310Packages.geopandas
python310Packages.labelbox
python310Packages.owslib
python310Packages.pgspecial
python310Packages.plotnine
python310Packages.preprocess-cancellation
python310Packages.psycopg
python310Packages.pyosmium
python310Packages.pyproj
python310Packages.rasterio
python310Packages.shapely
python310Packages.spectral-cube
python310Packages.wktutils
python39Packages.aplpy
python39Packages.asf-search
python39Packages.basemap
python39Packages.cartopy
python39Packages.flask-admin
python39Packages.geoalchemy2
python39Packages.geopandas
python39Packages.labelbox
python39Packages.owslib
python39Packages.pgcli
python39Packages.pgspecial
python39Packages.plotnine
python39Packages.preprocess-cancellation
python39Packages.psycopg
python39Packages.pyosmium
python39Packages.pyproj
python39Packages.rasterio
python39Packages.shapely
python39Packages.spectral-cube
python39Packages.wktutils

osmnx is getting ready for a new release which will support shapely 2.0.

osmnx is getting ready for a new release which will support shapely 2.0.

The osmnx bump will have to wait for a pandas bump. See #207463.

@ofborg build python310Packages.pgcli
Trouble building on macos 10.15

Must be a quirk on my machine.
Other than osmnx, nixpkgs-review reveals no new failures on macos 10.15 & nixos x86_64.


Possibility to add exceptions/whitelist

Hi there!
First of all: thank you for creating Caddy and this plugin, I love both! Great work!!
Here's my questions:
Is it possible to add an exception for specific IP addresses or subnets to bypass the rate-limit?
Maybe this is already possible with how Caddy works, but I haven't been able to figure it out yet.
For example, I'd love to whitelist my internal network, so my own servers don't run into the ratelimit.
My rate limit configuration currently looks like this:
rate_limit {
        zone my_zone {
                key    {remote_host}
                events 10
                window 20s
        }
}

Thank you very much!
I appreciate any help!

Yes - use a not + remote_ip matcher with rate_limit to make it not apply for the IP addresses or ranges you want to permit.

Was just about to say that!
In other words:
@not_excepted not remote_ip <IP_ADDRESS>
rate_limit @not_excepted ...

Oh, that's way easier than I expected. Will try it later today!
Thank you so much to both of you!!

Hi all
It would also be great if I could white-list a specific IP address where the rate limit should not work for this IP address
below is the syntax
 rate_limit {
 distributed
 rate_limit @not_excepted <IP_ADDRESS>
 zone dynamic_example {
            key    {remote_host}
            events 500
            window 1m
    }

}
correct me the syntax is wrong

See Matt's comment; declare a named matcher which matches requests by remote IP, then apply it to the rate_limit directive. See how matchers work: https://caddyserver.com/docs/caddyfile/matchers#syntax


[Issue 7959] Added support to force deleting namespace

Motivation
Fixes #7959
Modifications
Add a optional field to force the deletion of all stuffs related to namespace.

/pulsarbot run-failure-checks

/pulsarbot run-failure-checks

@BewareMyPower  to also take a look

/pulsarbot run-failure-checks


Add native Tasker integation

:loudspeaker: Type of change

[ ] Bugfix
[x] New feature
[x] Enhancement
[ ] Refactoring

:scroll: Description

This adds native Tasker integration, allowing users to enable / disable tunnels via an actual Tasker action, instead of having to use intents.
I've tried not to change too much of the existing code, and you will probably want to clean up somethings, but please let me know if there's anything you would like me to improve!
I followed these pages to enable Tasker integration:
https://tasker.joaoapps.com/plugins-intro.html
https://github.com/twofortyfouram/android-toast-setting-plugin-for-locale
As well as referencing the implementation in:
https://github.com/nosybore/Tasker-MQTT-Publish-Plugin
https://github.com/termux/termux-tasker
:bulb: Motivation and Context

The motivation for this change was to make it easier for users to enable or disable the VPN tunnels using Tasker.
:green_heart: How did you test it?
Tested on a Google Pixel 3a on Android 10 with the latest version of Tasker, v5.8.5.
:pencil: Checklist

[x] I ran ./gradlew spotlessApply before submitting the PR
[x] I reviewed submitted code

:crystal_ball: Next steps
:camera_flash: Screenshots / GIFs

Are you still working on this?

Hi, sorry yes I am, just getting the ObservableBoolean part done, any pointers?

https://developer.android.com/topic/libraries/data-binding/observability should help.

Can you add a wiki page explaining how to use this? Viscerion's very lacking in documentation and I'd love for things like these that I don't use personally to be well documented for users. Sorry for all the extra work :(

Sure can do, I'll edit the existing one?

Sure can do, I'll edit the existing one, or how does forking a Wiki work?

Wikis are open for everybody to contribute to, just edit and add the information directly on here, no forking required.

Wikis are open for everybody to contribute to, just edit and add the information directly on here, no forking required.

I think you may need to change the permissions on the Wiki, I can't see an edit button right now. Or I think I can once the pull is merged and I'm on the collaborators list?

Wikis are open for everybody to contribute to, just edit and add the information directly on here, no forking required.

I think you may need to change the permissions on the Wiki, I can't see an edit button right now. Or I think I can once the pull is merged and I'm on the collaborators list?

Fixed the permissions.

Added some changes to the Wiki page :)

Cool, thanks!


Metrics Not Displayed on Dashboards Due to Missing k8s-infra Chart Values in Latest Helm Chart

Summary:
In the latest version of the signoz Helm chart, the k8s-infra chart values are not included, leading to metrics not being displayed in the dashboards. This is impacting the observability of Kubernetes infrastructure metrics.
Expected Behavior:
Kubernetes infrastructure metrics (e.g., node metrics, pod metrics) should be displayed in the dashboards by default.
Actual Behavior:
Metrics related to Kubernetes infrastructure are missing from the dashboards.
Root Cause:
The latest version of the signoz Helm chart does not include default values for the k8s-infra chart, which is necessary for collecting Kubernetes infrastructure metrics.
Suggested Fix:
Include the default values for the k8s-infra chart in the signoz Helm chart's values.yaml file.
Alternatively, provide clear documentation for users to manually enable and configure k8s-infra in their custom values.

Hi @ishu-harsh,
With the merge of https://github.com/SigNoz/charts/pull/477 and from SigNoz chart version 0.48.0 onwards (https://github.com/SigNoz/charts/pull/479/files), k8s-infra is no longer a subchart of SigNoz.
It needs to be installed separately.

A note for anyone else running into this: I had to define otelCollectorEndpoint for the k8s-infra Helm chart, since it's no longer being pulled in via dependency.
To match the example Helm deployment in the docs, this looks like adding --set otelCollectorEndpoint='my-release-otel-collector:4317'.

@grandwizard28 Thanks you.
@mgilham Wanted to know is there any specific reason you guys remove the k8-infra agent from chart?

@ishu-harsh,
This change is part of our effort to improve the helm-chart architecture by following the separation of concerns principle. Both charts solve separate concerns. One is for installing SigNoz and the other is for collecting and sending telemetry to SigNoz.

Just a heads up that it looks like the website documentation for the SigNoz Kubernetes (self-hosted) install still indicates that k8s-infra is bundled:

The SigNoz Helm chart will install the following components into your Kubernetes cluster:

Query Service (backend service)
Web UI (frontend)
OpenTelemetry Collectors
Alertmanager
ClickHouse chart (datastore)
K8s-Infra chart (k8s infra metrics/logs collectors)

That documentation probably needs to be updated to reflect that you need to manually install signoz/k8s-infra rather than indicating that it's automatically installed.


bug: cannot format typescript files due to "Error detected while processing BufWritePre Autocommands for "*" "

Neovim version (nvim -v)
nvim 0.10.1
Operating system/version
MacOS 14.6.1
Read debugging tips

[X] I have read through the debugging tips.

Add the debug logs

[X] I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file
Error detected while processing BufWritePre Autocommands for "*":
Error executing lua callback: ...Cellar/neovim/0.10.1/share/nvim/runtime/lua/vim/glob.lua:79: subcapture nesting too deep
stack traceback:
        [C]: in function 'match'
        ...Cellar/neovim/0.10.1/share/nvim/runtime/lua/vim/glob.lua:79: in function 'to_lpeg'
        ...eovim/0.10.1/share/nvim/runtime/lua/vim/lsp/_dynamic.lua:105: in function 'match'
        ...eovim/0.10.1/share/nvim/runtime/lua/vim/lsp/_dynamic.lua:73: in function 'get'
        ...eovim/0.10.1/share/nvim/runtime/lua/vim/lsp/_dynamic.lua:83: in function 'supports_method'
        .../Cellar/neovim/0.10.1/share/nvim/runtime/lua/vim/lsp.lua:779: in function 'get_clients'
        .../share/nvim/lazy/conform.nvim/lua/conform/lsp_format.lua:49: in function 'get_format_clients'
        ....local/share/nvim/lazy/conform.nvim/lua/conform/init.lua:400: in function 'has_lsp_formatter'
        ....local/share/nvim/lazy/conform.nvim/lua/conform/init.lua:458: in function 'format'

Describe the bug
Exception thrown, when saving angular/typescript files.
Exception still throws even though I have commented out formatters
    formatters_by_ft = {
      lua = { 'stylua' },
      css = { 'prettierd', 'prettier', stop_after_first = true },
      less = { 'prettierd', 'prettier', stop_after_first = true },
      html = { 'prettierd', 'prettier', stop_after_first = true },
      -- javascript = { 'prettierd', 'prettier', stop_after_first = true },
      -- javascriptreact = { 'prettierd', 'prettier', stop_after_first = true },
      json = { 'prettierd', 'prettier', stop_after_first = true },
      markdown = { 'prettierd', 'prettier', stop_after_first = true },
      -- typescript = { 'prettierd', 'prettier', stop_after_first = true },
      -- typescriptreact = { 'prettierd', 'prettier', stop_after_first = true },
      yaml = { 'prettierd', 'prettier', stop_after_first = true },
    },

What is the severity of this bug?
blocking (cannot use plugin)
Steps To Reproduce

with Mason install prettierd, and prettier
create angular project
save any typescript file
see error

Expected Behavior
On save, it should auto format
Minimal example file
No response
Minimal init.lua
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/conform.nvim",
    config = function()
      require("conform").setup({
        log_level = vim.log.levels.DEBUG,
        -- add your config here
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context
Maybe similar to https://github.com/stevearc/conform.nvim/issues/393
I already tried to re-install the plugin, I also tried to re-install prettier, and prettierd none seems to help.

hmm, seems like removing the entire mason folder, and then reinstall the formatters (prettier) helped in my case.

Didn't work for me – I still have the error coming up...

I am also still getting this error, even after purging Mason. Does not appear constrained to prettier/typescript either.

@thomashilzendegen  @HeadCase
I assume you removed the mason folder located in ~/.local/share/nvim/mason
The error came back again to me somehow, but I did the same procedure with removing mason folder, and it resolved my issue again.

I did, yes. I tried the same again to be doubly sure, and got the same error. I also completely blew away my nvim config (~/.config/nvim & ~/.cache/nvim & ~/.local/state/nvim & ~/.local/share/nvim) all to no avail. It is worth noting that not only does the format-on-save autocommand not work, I cannot even get :ConformInfo to succeed. Running a standard :checkhealth reports:
conform: require("conform.health").check()

conform.nvim report
- Log file: /home/ubuntu/.local/state/nvim/conform.log
- ERROR Failed to run healthcheck for "conform" plugin. Exception:
  ....local/share/nvim/lazy/conform.nvim/lua/conform/util.lua:53: attempt to call field 'root' (a nil value)

Sadly, it would appear this means Conform dies before logging anything, as the log file does not exist:
❯ ls ~/.local/state/nvim
 lazy   log   mason-registry-update   mason.log   sessions   shada   swap   undo

And for good measure, my format.lua configuration:
return {
  "stevearc/conform.nvim",
  log_level = vim.log.levels.DEBUG,
  opts = {
    formatters_by_ft = {
    json = { "prettier" },
    markdown = { "mdformat" },
    python = { "isort", "blue" },
    },
  },
}

@HeadCase sorry to hear that removing the mason folder didn't help.
Maybe doesn't matter, but when I had the error I also had the same issue wherein :ConformInfo died before it showed me any debugging log.
Your plugin setup is smaller than mine. Did you try to comment out some of the languages to verify whether it is one of the formatter used which causes Conform to crash?

The original error in the original bug report is a crash in the LSP logic, not in conform. It looks like it would happen if you call
vim.lsp.get_clients({bufnr = 0, method = "textDocument/formatting"})

If that is the case, your best bet is reporting this upstream. It looks like there's something weird with the filter pattern in the register options for the formatting method. This line might show you more data:
vim.lsp.get_clients({bufnr = 0})[1].capabilities["textDocument/formatting"]

So just adding onto this. I suddenly was getting the same issue. It seems like as @stevearc said it has to do with LSPs and not conform itself per say. What I did was disable the LSPs on my typescript files and reenable them once at a time to see what triggered the issue.
What I found is that my eslint lsp is what seemed to trigger the problem So on it's on_attach I disabled the formatting:
require("lspconfig")["eslint"]{
  on_attach = function(client, bufnr)
    client.server_capabilities.documentFormattingProvider = false -- 0.8 and later
    client.server_capabilities.documentRangeFormattingProvider = false -- 0.8 and later
  end,
}

I have just noticed a new debugging approach and I tested it right away. The file that fails to be formatted by conform is formatted successfully when running prettier & prettierd via the suggested approach here.
Based on this, what could the next steps be @stevearc ?

@hchris21 what that means is that the formatters are working properly but the crash in the LSP code is preventing us from running it. Try running :=vim.lsp.get_clients({bufnr = 0, method = 'textDocument/formatting'}) I would expect that command to produce the same crash. If you run :=vim.lsp.get_clients({bufnr = 0}), you should be able to see which LSP clients are attached to the buffer, and thus might be causing the problem. The crash is happening on this line, so presumably there is something wrong with the documentSelector. Try looking for the value of that to see if it's something reasonable (and thus there is a bug in how Neovim handles it) or if it's invalid (and thus there is a problem with the LSP server).

Thank you @stevearc
You are right, running that command resulted in the same error, and after I checked the LSP clients, I have noticed that the only LSP with the 'textDocument/formatting' capability was eslint. Disabling it solved the formatting issue.

Hi, maybe this will help. For me works this setup in LSP:
https://www.lazyvim.org/configuration/recipes#add-eslint-and-use-it-for-formatting
If I understand this correctly, there is some fight, who will format the TS files. This specifies only one formatter.


[Crash Report] When loading auto-saved documents, an image in a non-active tab can't find its layer

Describe the Crash
When reloading the page, the auto-save system reloads all the saved documents consecutively. If the first tab's document has a layer, it sends a FrontendMessage which will then asynchronously generate a blob URL and eventually call back to the backend with that URL to assign to its layer in that document. But by then, the document loading has moved onto the next document and it has made that one be active. It is then unable to find the Image layer in the first document for some reason.
Steps To Reproduce
Describe precisely how the crash occurred, step by step, starting with a new editor window.

Open the Graphite Editor at https://editor.graphite.rs
Paste an image into the document
Make a new document
Draw a shape or something
Reload the page

Browser and OS
Chrome 105, Windows 10 or 11
Stack Trace
Copied from the crash dialog in the Graphite Editor:
panicked at 'Blob url for invalid layer: LayerNotFound([])', graphene/src/document.rs:757:51

Error
    at https://dev.graphite.rs/js/app.9f6d9d9c.js:9:995
    at Object.n [as handleJsMessage] (https://dev.graphite.rs/js/app.9f6d9d9c.js:1:8158)
    at https://dev.graphite.rs/js/app.9f6d9d9c.js:1:8656
    at https://dev.graphite.rs/js/123.33d206ae.js:1:13830
    at N (https://dev.graphite.rs/js/123.33d206ae.js:1:5550)
    at Cn (https://dev.graphite.rs/js/123.33d206ae.js:1:13796)
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[2323]:0x1c801a
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[912]:0x1741bf
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[699]:0x158434
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[1887]:0x1bb875
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[1764]:0x1b6229
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[1974]:0x1bed08
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[2530]:0x1cbea4
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[2538]:0x1cc07b
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[2057]:0x1c1618
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[53]:0x11a64
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[54]:0x1819c
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[58]:0x2810a
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[131]:0x9d3ac
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[905]:0x173599
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[872]:0x16f5bb
    at https://dev.graphite.rs/cd8ddf81a0c422b7.module.wasm:wasm-function[1979]:0x1bef68
    at Proxy.setImageBlobUrl (https://dev.graphite.rs/js/123.33d206ae.js:1:11040)
    at Proxy.<anonymous> (https://dev.graphite.rs/js/app.9f6d9d9c.js:1:532)
    at https://dev.graphite.rs/js/app.9f6d9d9c.js:1:9069

It is then unable to find the Image layer in the first document for some reason.

This is because messages can only ever be sent to the current active document @Keavon

@0HyperCube it's a little weirder than that, because I have an unpushed branch that depends on the AI Artist branch which fixes that. The result is that the actual document, if you print out the root, is missing the image layer. I'll ping you to take a look when I merge that branch.


'RCTVLCPlayer' is not Fabric compatible yet.

An error occurred when running Android. How can I solve it?

this is it . 'RCTVLCPlayer' is notFabric compatible yet.
---Original---
From: "Vishal @.>
Date: Thu, Jan 4, 2024 19:37 PM
To: @.>;
Cc<EMAIL_ADDRESS>Subject: Re: [razorRun/react-native-vlc-media-player] 'RCTVLCPlayer' is notFabric compatible yet. (Issue #194)
what error?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>


Asyncio use leads to "runtime error"

Describe the issue
Hi Rikroe,
I decided to open the error here instead of continuing on the discussion #422.
I am using the version <IP_ADDRESS>b6 integrated in Domoticz.
All works fine, however systematically after 1-2 hours, I got the following errors. I retrieve the car status in loop by using the following (cleaned) code in a loop:
if self.myBMW:
    self.myVehicle = None
    try:
        asyncio.run(self.myBMW.get_vehicles())
    except:
        import traceback
        Domoticz.Debug('StatusUpdate TRACEBACK: {}'.format(traceback.format_exc()))
    else:
        self.myVehicle = self.myBMW.get_vehicle(Parameters['Mode4'])
        if self.myVehicle:
            Domoticz.Debug('Car {} found after update!'.format(self.myVehicle.name))

The get_vehicles() generates at a certain moment the error below (traceback). And the same error appears at every call from then on. When restarting completely the plugin all works fine again.
2022-04-25 20:53:33.064  TestBmw: Handling task: StatusUpdate.
2022-04-25 20:53:33.145  TestBmw: StatusUpdate TRACEBACK: Traceback (most recent call last):
  File "/home/filip/domoticz/plugins/Bmw/plugin.py", line 280, in handleTasks
    asyncio.run(self.myBMW.get_vehicles())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/account.py", line 78, in get_vehicles
    vehicles_responses: List[httpx.Response] = await asyncio.gather(*vehicles_tasks)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1729, in get
    return await self.request(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1506, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1593, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1621, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1656, in _send_handling_redirects
    await hook(request)
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/client.py", line 39, in update_request_header
    request.headers["authorization"] = await self.config.authentication.get_authentication()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/authentication.py", line 46, in get_authentication
    await self.login()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/authentication.py", line 72, in login
    async with self._lock:
  File "/usr/lib/python3.9/asyncio/locks.py", line 14, in __aenter__
    await self.acquire()
  File "/usr/lib/python3.9/asyncio/locks.py", line 120, in acquire
    await fut
RuntimeError: Task <Task pending name='Task-237' coro=<AsyncClient.get() running at /usr/local/lib/python3.9/dist-packages/httpx/_client.py:1729> cb=[gather.<locals>._done_callback() at /usr/lib/python3.9/asyncio/tasks.py:766]> got Future <Future pending> attached to a different loop
2022-04-25 20:53:33.146  TestBmw: Finished handling task: StatusUpdate.

I will now try to simulate the same problem by a dedicated script outside Domoticz.
test_asyncio.py.txt
Any idea so far?
Expected behavior

Which Home Assistant version are you using?
(used outside HA)
What was the last working version of Home Assistant Core?
No response
What is your region?
Rest of world
ConnectedDrive website

[X] I can still successfully login to the BMW ConnectedDrive website and the car status is available there.
[X] I have ConnectedDrive enabled for my vehicle.

Number of cars

[ ] I have 2 or more cars linked to the ConnectedDrive account.
[ ] I have a Mini vehicle linked to my account.

Output of bimmer_connected fingerprint
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response

I also did the test outside Domoticz and got the same problem after a while...
See python script: test_asyncio.py.txt
Hereunder you can find the output, including the error.
You can use the script (with your credentials) to test/debug. I am wondering whether it has something to do with authentication codes that need to be renewed after a while...
filip@Ararat:~/domoticz/plugins/Bmw$ python3 test_asyncio.py
Login done! MyBMW object<EMAIL_ADDRESS>region=<Regions.REST_OF_WORLD: 2><EMAIL_ADDRESS>password='xxxx', region=<Regions.REST_OF_WORLD: 2>, token=None, expires_at=None, _lock=None), log_response_path=None), observer_position=None, vehicles=[])
Login successful! Car 518d (VIN:WBAJF11030CD97578) found!
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7f2c576a1bb0>
StatusUpdate TRACEBACK: Traceback (most recent call last):
  File "/home/filip/domoticz/plugins/Bmw/test_asyncio.py", line 31, in <module>
    asyncio.run(myBMW.get_vehicles())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/account.py", line 78, in get_vehicles
    vehicles_responses: List[httpx.Response] = await asyncio.gather(*vehicles_tasks)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1729, in get
    return await self.request(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1506, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1593, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1621, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1656, in _send_handling_redirects
    await hook(request)
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/client.py", line 39, in update_request_header
    request.headers["authorization"] = await self.config.authentication.get_authentication()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/authentication.py", line 46, in get_authentication
    await self.login()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/authentication.py", line 72, in login
    async with self._lock:
  File "/usr/lib/python3.9/asyncio/locks.py", line 14, in __aenter__
    await self.acquire()
  File "/usr/lib/python3.9/asyncio/locks.py", line 120, in acquire
    await fut
RuntimeError: Task <Task pending name='Task-222' coro=<AsyncClient.get() running at /usr/local/lib/python3.9/dist-packages/httpx/_client.py:1729> cb=[gather.<locals>._done_callback() at /usr/lib/python3.9/asyncio/tasks.py:766]> got Future <Future pending> attached to a different loop

If I just put an new<EMAIL_ADDRESS>'xxx', get_region_from_name('rest_of_world')) statement in the loop when the error occurs to see if afterwards the loop goes on and it is... So I think really that it is linked with a new login that has to be done...
So I have a workaround, but there is still a bug... Always happy to learn when it would be solved so I can remove the workaround.
Update part of the test code (supplied above)
while myBMW:
    t = time.localtime()
    print ('{} UPDATE ---------------------------------------------------'.format(time.strftime("%H:%M:%S", t)))
    myVehicle = None
    try:
        asyncio.run(myBMW.get_vehicles())
    except:
        import traceback
        print('StatusUpdate TRACEBACK: {}'.format(traceback.format_exc()))
        myBMW =<EMAIL_ADDRESS>'xxx', get_region_from_name('rest_of_world'))
        print('Login done! MyBMW object: {}'.format(myBMW))
    else:
        myVehicle = myBMW.get_vehicle('WBAJF11030CD97578')
        if myVehicle:
            print('Car {} found after update!'.format(myVehicle.name))
            print('Mileage: {} {}'.format(myVehicle.mileage[0], myVehicle.mileage[1]))
            print('Car {} status: {}'.format(myVehicle.name, myVehicle))
        else:
            print('Error VIN {} not found for user.'.format('WBAJF11030CD97578'))

    time.sleep(240)

And the output to show the loop is back...
12:02:25 UPDATE ---------------------------------------------------
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7fb36b478220>
12:06:27 UPDATE ---------------------------------------------------
StatusUpdate TRACEBACK: Traceback (most recent call last):
  File "/home/filip/domoticz/plugins/Bmw/test_asyncio.py", line 35, in <module>
    asyncio.run(myBMW.get_vehicles())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/account.py", line 78, in get_vehicles
    vehicles_responses: List[httpx.Response] = await asyncio.gather(*vehicles_tasks)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1729, in get
    return await self.request(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1506, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1593, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1621, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.9/dist-packages/httpx/_client.py", line 1656, in _send_handling_redirects
    await hook(request)
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/client.py", line 39, in update_request_header
    request.headers["authorization"] = await self.config.authentication.get_authentication()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/authentication.py", line 46, in get_authentication
    await self.login()
  File "/usr/local/lib/python3.9/dist-packages/bimmer_connected/api/authentication.py", line 72, in login
    async with self._lock:
  File "/usr/lib/python3.9/asyncio/locks.py", line 14, in __aenter__
    await self.acquire()
  File "/usr/lib/python3.9/asyncio/locks.py", line 120, in acquire
    await fut
RuntimeError: Task <Task pending name='Task-134' coro=<AsyncClient.get() running at /usr/local/lib/python3.9/dist-packages/httpx/_client.py:1729> cb=[gather.<locals>._done_callback() at /usr/lib/python3.9/asyncio/tasks.py:766]> got Future <Future pending> attached to a different loop

Login done! MyBMW object<EMAIL_ADDRESS>region=<Regions.REST_OF_WORLD: 2><EMAIL_ADDRESS>password='xxx', region=<Regions.REST_OF_WORLD: 2>, token=None, expires_at=None, _lock=None), log_response_path=None), observer_position=None, vehicles=[])
12:10:27 UPDATE ---------------------------------------------------
Car 518d found after update!
Mileage: 30265 km
Car 518d status: <bimmer_connected.vehicle.vehicle.MyBMWVehicle object at 0x7fb369a7ee50>

Can you please try to edit api/authentication.py#L66 to:
        if not self._lock or self._lock._loop != asyncio.get_running_loop():

What happens here (apparently, not a full expert either):
async functions are supposed to be run in one single event loop, i.e. started by asyncio.run(). If you're using almost only async functions, this is fine.
However you have to do multiple calls to asyncio.run() due to the domoticz architecture.
When asyncio.run() finishes, the event loop is closed and next time a new one is created. As this event loop is also stored in every asyncio object, the loops are not the same, giving this error.

Hi,
I let my test scrip run 2 times this weekend during several hours. So far all is still OK.
If you have the occasion to generates once a new beta, I will install it also on my Domoticz server (to test it during several days). Let me know when the new beta would be available.
Kr,
F

Hi Filip, please try https://github.com/bimmerconnected/bimmer_connected/releases/tag/v0.9.0b9

Mmmm... When installing v0.9.0.b9 or b10, I got new errors (up to b8 it works fine)... But it is more nuanced than this...
I have 2 installations: on my Ubuntu 22.04 (test environment) with Python 3.10.4, all seems to go well (!! not yet tested on long duration). However on my RaspberryPi (Buster), there is Python 3.7 and there I have a strange runtime error...
I tried to investigate a bit but cannot find out exactly based on the stack trace (see below).
I saw that since v0.9.0b9 there were initial changes done for getting the event loop (get_event_loop instead of get_running_loop and also changes in MyBMWAuthentication(Authentication)). I cannot simulate the problem outside Domoticz (works with my test script both on Ubuntu and RPi).
Any idea?
2022-05-15 13:27:15.090 BMW518: (BMW518) Handling task: Login.
2022-05-15 13:27:15.091 BMW518: (BMW518) Login error: There is no current event loop in thread 'QueueThread'.
2022-05-15 13:27:15.094 BMW518: (BMW518) Login error TRACEBACK: Traceback (most recent call last):
2022-05-15 13:27:15.094 File "/home/pi/domoticz/plugins/Bmw/plugin.py", line 263, in handleTasks
2022-05-15 13:27:15.094 self.myBMW = MyBMWAccount(Parameters['Mode2'], Parameters['Mode3'], get_region_from_name(self.region))
2022-05-15 13:27:15.094 File "<string>", line 7, in __init__
2022-05-15 13:27:15.094 File "/usr/local/lib/python3.7/dist-packages/bimmer_connected/account.py", line 53, in __post_init__
2022-05-15 13:27:15.094 MyBMWAuthentication(self.username, password, self.region),
2022-05-15 13:27:15.094 File "<string>", line 8, in __init__
2022-05-15 13:27:15.094 File "/usr/lib/python3.7/asyncio/locks.py", line 161, in __init__
2022-05-15 13:27:15.094 self._loop = events.get_event_loop()
2022-05-15 13:27:15.094 File "/usr/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
2022-05-15 13:27:15.094 % threading.current_thread().name)
2022-05-15 13:27:15.094 RuntimeError: There is no current event loop in thread 'QueueThread'.
2022-05-15 13:27:15.094

I just looked through some of the Domoticz examples and the documentation.
Is there any specific reason why you are using the multi-threaded approach? I don't think it is needed to be honest.
What I think is needed generally with >0.9.0:

in onStart, just assign self.myBMW = MyBMWAccount(...)
in onHeartbeat, you don't need to check if self.myBMW is empty, as it will always be there through the init from onStart
in handleTasks

you don't need a Login action anymore. This is automatically done by get_vehicles(), included refresh tokens etc.
just use the existing asyncio.run(self.myBMW.get_vehicles())

If all of this in running in your plugin's main thread, then asyncio.run() should always be able to find/create the correct loop.

Problem is that Domoticz works also with events and callbacks. In the documentation it is clearly stated that "Waiting or sleeping in Domoticz callbacks. Plugin callbacks are single threaded so the whole plugin system will wait." And a callback (eg onHeartbeat) should not take more than 10s to avoid Domoticz generates error messages. Therefor they recommend to use a separate thread as shown in the example "Mutli-Threaded".
On the other hand, there should not be any reason why it should not work in a separate thread (as it works with 0.9.0b6).

I changed the authentication yesterday (where the async. Lock() that caused the trouble was used) and removed it.
Can you please try b13?

Hi,
First of all a big thanks for your help!
Again there seems to be a problem with the loop... Yesterday I made a version where I removed the threading. It runs as such if all goes well, however I fear problems in case of the communication takes more time, especially for the remote services that take much more time... And this will block the plugin. It is pity because even with the threading in worked very well a while ago.
However if I got errors in the plugin (embedded python), in my opinion it hides a real problem as there is no reason why it shouldn't work.
Traceback (most recent call last):
  File "/home/pi/domoticz/plugins/Bmw/plugin.py", line 263, in handleTasks
    self.myBMW = MyBMWAccount(Parameters['Mode2'], Parameters['Mode3'], get_region_from_name(self.region))
  File "<string>", line 7, in __init__
  File "/usr/local/lib/python3.7/dist-packages/bimmer_connected/account.py", line 53, in __post_init__
    MyBMWAuthentication(self.username, password, self.region),
  File "<string>", line 8, in __init__
  File "/usr/lib/python3.7/asyncio/locks.py", line 161, in __init__
    self._loop = events.get_event_loop()
  File "/usr/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
    % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'QueueThread'.

While it would be very interesting to actually solve the issue I think you can ignore it.
I removed it as it created some concurrency in the login process that may or may not also have caused login issues for China (#428, end of thread).
So it removed completely now and it should be working in your plug in with threading.

Hi Filip, please try b15. This includes again the "old" implementation of the async.Lock that worked in b8.

It crashes on response: httpx.Response = yield request on RPi with Python 3.7...
2022-05-21 16:46:29.601 Error: BMW518: (Bmw) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Bmw/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2022-05-21 16:46:29.601 Error: BMW518: (BMW518) Module Import failed, exception: 'SyntaxError'
2022-05-21 16:46:29.601 Error: BMW518: (BMW518) Import detail: File: /usr/local/lib/python3.7/dist-packages/bimmer_connected/api/authentication.py, Line: 79, offset: 40
2022-05-21 16:46:29.601 Error: BMW518: (BMW518) Error Line ' response: httpx.Response = yield request
2022-05-21 16:46:29.601 '

Sorry, stumbled across this too late. Apparently in Python<=3.7, we need a yield request to be put in brackets.
response: httpx.Response = (yield request)

It's included in b17.

Top! This did the trick... I installed it and started already up! So a good step in the good direction! I will now let it run during some days to see if all behaves correctly.
Thanks again!

Just for your information and to say thank you again!
Everything is still working like a charm since yesterday evening...

Great to hear! Just for clarification: Would an issue have shown otherwise?
Thinking it's getting close to 0.9.0 stable and I'd like to release that soon-ish.

I cannot be 100% sure yet, but I suppose I would have seen already if there would be an issue... It could still happen in case something goes wrong, ie falling in error cases like communication timeouts, logins that expire, ...

Closing this as I hope its fixed. If not, please reopen this!


Transition and Trail, staggered unmounting.

Great library. Was wondering if there was a way to do staggered mounting and unmounting as well?
I know with Trail I can have a delay between the different children, but is there a way to have the same delay, when unmounting an item as well?

I believe keyframes could switch the primitive, go from a transition to a trail using the same data.

I believe keyframes could switch the primitive, go from a transition to a trail using the same data.

@mdurbar took a while, but transition has a delay prop now that can trail adds/removes. See: http://react-spring.surge.sh/transition#props


HTML Editor

To Do:
add button on float toolbar for the component in order to edit the HTML
add button on float toolbar for copy and past the component

Done


Possible to run this on iPadOS/visionOS?

I tried adding visionOS as a deployment target, but there are a few issues. Are these fixable?

This is possibe. I did some very quick adjustments guided by ChatGPT, but the preview window was not updating


There could be part.to_a, but it is not an Enumerable, thus not responding to #map.

Small improvement.
There could be part.to_a, but it is not an Enumerable, thus not responding to #map.
I used TTY::Table for output in tests. But I have defined String.to_a in my prog.
And it crashes with NoMethodError: undefined method map' for "│a1   │b1    │c1  │":String`
[X] Tests written & passing locally?
[X] Code style checked?

Coverage decreased (-0.008%) to 97.631% when pulling 98e6253e878fc5b772f0630357f0242234ff19ec on deemytch:master into 9adc6967a4cf41c1801626f9ba3c3034e0599be3 on piotrmurach:master.

That's great! Thanks for using tty-table!
Would you be able to add an entry in the changelog as well to explain this change?

Excuse me, I'm not sure it's need to be added to changelog, except "small improvements between others" :)