Cluster explorer and websocket connection broken after upgrading to rancher 2.5.8 (fine with 2.5.7)

SURE-3499
SURE-3469

What kind of request is this (question/bug/enhancement/feature request):
Bug/Regression
Steps to reproduce (least amount of steps as possible):

Upgrade from 2.5.7 to 2.5.8
Go to cluster explorer of Rancher local cluster. It's all fine
Go to cluster explorer of downstream cluster: There's a second when in a flash I can see the dashboard, and then I get logged out and redirected to the login page

It seems that the websocket connection is not established and that's when the redirect happens.
RANCHER 2.5.8
Right after upgrading, the rancher pod in the rancher upstream cluster logs each time I try to access the cluster explorer:
[ERROR] Error during subscribe websocket: close sent

In the downstream cluster, cattle node agents report:
time="2021-05-28T09:10:12Z" level=info msg="Starting plan monitor, checking every 120 seconds"
time="2021-05-28T09:45:25Z" level=error msg="Remotedialer proxy error" error="websocket: close 1006 (abnormal closure): unexpected EOF"
time="2021-05-28T09:45:35Z" level=info msg="Connecting to wss://my.rancher.host/v3/connect with token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
time="2021-05-28T09:45:35Z" level=info msg="Connecting to proxy" url="wss://my.rancher.host/v3/connect"

and the cattle cluster agent:
time="2021-05-28T09:40:14Z" level=error msg="Error during subscribe websocket: close sent"
time="2021-05-28T09:42:10Z" level=error msg="Error during subscribe websocket: close sent"
W0528 09:42:48.617883 39 warnings.go:80] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
time="2021-05-28T09:43:58Z" level=error msg="Error during subscribe websocket: close sent"
time="2021-05-28T09:45:25Z" level=error msg="Remotedialer proxy error" error="websocket: close 1006 (abnormal closure): unexpected EOF"
time="2021-05-28T09:45:35Z" level=info msg="Connecting to wss://my.rancher.host/v3/connect with token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
time="2021-05-28T09:45:35Z" level=info msg="Connecting to proxy" url="wss://my.rancher.host/v3/connect"
W0528 09:47:25.012488 39 warnings.go:80] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
time="2021-05-28T09:50:30Z" level=error msg="Error during subscribe websocket: close sent"

RANCHER 2.5.7
Upstream and downstream are working fine. Rancher UI working fine too
When the cattle cluster agent starts it logs no errors
time="2021-05-28T09:53:52Z" level=info msg="Connecting to wss://my.rancher.host/v3/connect/register with token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
time="2021-05-28T09:53:52Z" level=info msg="Connecting to proxy" url="wss://my.rancher.host/v3/connect/register"
time="2021-05-28T09:53:52Z" level=info msg="Starting user controllers"`

When each cattle node agent pod is started they log something like:
time="2021-05-28T09:53:52Z" level=info msg="Connecting to wss://my.rancher.host/v3/connect/register with token xxxxxxxxxxxxxxxxxxxxxxxxxxx"
time="2021-05-28T09:53:52Z" level=info msg="Connecting to proxy" url="wss://my.rancher.host/v3/connect/register"
time="2021-05-28T09:53:52Z" level=info msg="Starting user controllers"

Neither of them logs any errors
Result:
I have to rollback to 2.5.7 if I want to carry on using rancher
Other details that may be helpful:
Environment information

Rancher version (rancher/rancher/rancher/server image tag or shown bottom left in the UI): 2.5.8
Installation option (single install/HA): single install with helm

Cluster information

Cluster type (Hosted/Infrastructure Provider/Custom/Imported): Hosted

Machine type (cloud/VM/metal) and specifications (CPU/memory): Cloud

Kubernetes version (use kubectl version): v1.20.7+rke2r2

Docker version (use docker version):

20.10.3

+1
same issue

I had a same issue, and I resolved.
In my case, I set wrong hostname.
To accese https://my-k3s.local, install command should be helm install rancher rancher-stable/rancher --namespace cattle-system --set hostname=my-k3s.local (not hostname=my-wrong-k3s.local)
I hope it helps...

+1
same issue. I upgraded through the cluster explorer on the upstream Rancher cluster. I verified the hostname value is correct, same value as it had been for 2.5.7 fwiw

+1 Same issue

Please share what kind of clusters you experience the issue with (created using Rancher yes/no, what type, what version or anything else that is specific to where you are seeing the issue) so we can more easily track down where it is happening, thanks in advance.

Yes we have  2.5.8 version running in our environment. We have created the cluster usign the terraform rancher provider in OKE. The cluster explorerr access to local cluster works fine but other cluster it logs out and re-directed to the login page.

In my case:

My Rancher cluster has been going since 2.5.4. It was deployed with helm on a rke2 cluster (now at v1.20.7+rke2r2). This setup hasn't changed. Upgrades to 2.5.5-2.5.7 went ok. I reported this issue when upgrading to 2.5.8 as that's when it broke. This failed upgrade was also done with helm
Downstream cluster was created with the above Rancher cluster using custom provider (Hetzner) with a mix of dedicated servers and VM

For us:

cluster that runs Rancher was provisioned with RKE running 1.18.16 on CentOS 7

previously running 2.5.7, installed via helm
upgraded to 2.5.8 through the Apps & Marketplace section of the cluster explorer with helm
upgrade appeared to be successful

downstream cluster with broken cluster explorer was also provisioned with RKE running 1.18.16 on CentOS 7

FYI - just hit this issue (or a very similar one), too

but in my case after the upgrade from 2.5.8 to 2.5.9..
https://github.com/rancher/rancher/issues/33667

I upgraded our 2.5.8 instance to 2.5.9 which didn't resolve the issue. I'm going to test an upgrade of our upstream rancher cluster from 1.18.16 to the latest 1.20 that we are already planning. We'll see if that has any effect. If not, we'll be doing the same upgrade to the downstream clusters.
if nothing resolves it, I'll revert back to 2.5.7 until this gets fixed. Not having the cluster explorer UI is starting to become a problem

I upgraded our 2.5.8 instance to 2.5.9 which didn't resolve the issue. I'm going to test an upgrade of our upstream rancher cluster from 1.18.16 to the latest 1.20 that we are already planning. We'll see if that has any effect. If not, we'll be doing the same upgrade to the downstream clusters.
if nothing resolves it, I'll revert back to 2.5.7 until this gets fixed. Not having the cluster explorer UI is starting to become a problem

@decimalator JFYI - in my case deleting and re-importing the downstream cluster solved the problem - not sure if that is possible in your case..

@Martin-Weiss ooh, yeah we can definitely give that a shot if my k8s upgrades don't solve it. thanks!

@Martin-Weiss so glad to know there's a solution. But wouldn't I lose all the benefits of provisioned clusters?

@Martin-Weiss so glad to know there's a solution. But wouldn't I lose all the benefits of provisioned clusters?

Yeah - I agree this is not a good solution - but until we have a real fix....

For all of you that are using v1.20.7+rke2r2 as your local cluster, Did you install rancher through rancherd or other installation method?

I installed with the bash command curl -sfL https://get.rke2.io | sh -. However, I upgraded it using the Rancher cluster edit tool

Also for anyone who is experiencing this issue, can you share cattle-cluster-agent pod logs in cattle-system on downstream clusters before and after upgrade? If the cattle-cluster-agent is not working then dashboard is not likely to work.

Interestingly, a complete reboot of all of the nodes of the downstream cluster ended up solving the issue, unintentionally, temporarily. I didn't delete the cluster from Rancher. I didn't close the Chrome tab I had had open to the Cluster Manager interface for cordoning nodes during the reboots. After all of the reboots I was browsing the System project of the downstream cluster to watch logs. I don't remember how, but I somehow ended up in the Cluster Explorer interface for the downstream cluster and it was working.
After awhile, with no changes to either the upstream Rancher cluster or the downstream cluster, it stopped working again. Same log entries for the cattle-cluster-agent as have been shared before.
The ONLY change to the cluster was rolling reboots of the worker nodes. We had done rolling reboots of the control plane nodes on a Friday with no effect to the Cluster Explorer UI.

we are seeing this on 1.19.x downstream clusters
all 1.20.x are fine here
As soon as i switch to a 1.19.x cluster in explorer it kicks me to the login prompt

i think i found it
did you guys perhaps disable anonymous auth in grafana?
  grafana.ini:
    auth:
      disable_login_form: false
    auth.anonymous:
      enabled: false
      org_role: Viewer

obviously rancher explorer gets the metrics from rancher-monitoring grafana, so it will get a 401 from grafana when loading the dashboard and that ripps the websocket

@flostru thank you for posting that but it's not related to this issue. This is about the rancher cluster agent and the cluster explorer dashboard. Grafana would be an entirely different thing

@flostru thank you for posting that but it's not related to this issue. This is about the rancher cluster agent and the cluster explorer dashboard. Grafana would be an entirely different thing

maybe more than one issue but since rancher 2.5.8 the explorer dashboard integrates grafana metrics via iframe, if grafana needs authentication it will return an 401 (unauthorised) and your websocket in cluster explorer will break, leading to
level=error msg="Error during subscribe websocket: close sent"

in cluster agent
so leading to the symptoms described, and it will send you back to log-in.
Still its possible that its a different issue, do you have grafana "anonymous.auth" disabled? It is enabled by default and rancher explorer needs it enabled.
Can you reach a submenu of the explorer without getting loged out?
like: https://rancher.yourdomain.com/dashboard/c/c-xxxxx/explorer/namespace

@flostru that helped me! Thanks!!
In my case, I had renamed the name of the only Org. I created a blank Org called "Main Org." to match the default in grafana.ini and :tada: I can get to the Cluster Explorer again.

It was working for me for about 3 weeks and today it all broke again. I downgraded to 2.5.7 and then upgraded again to 2.5.9 and I can access the explorer again.
@flostru I didn't think grafana was related because I can't access any area in the explorer, not even the dashboard, let alone trying any link to the monitoring app
My grafana config is exactly like your except I didn't have a org_name. I've added it just in case. Fingers crossed

arrrgg spoke too soon. It's broke again, even with the grafana config

We had this start suddenly with no changes to our cluster, today. Grafana configuration hasn't changed, anonymous auth is still enabled. We didn't do any org renaming. We have other downstream clusters that are virtually identical where this doesn't happen.
Production Cluster (Broken): K8s v1.19.10, docker 20.10.8.
DevTest Cluster (Working): K8s v1.19.12, docker 20.10.8.
We have another cluster identical to devtest which is also working. Symptoms in our prod cluster are identical to what's described here, including being able to use the explorer if we follow a deep link. The momen we click on "Cluster Overview" we get logged out. Our grafana.ini sections looks like this:
grafana.ini:
    auth:
        disable_login_form: false
    auth.anonymous:
        enabled: true
        org_role: Viewer
    auth.basic:
        enabled: false
    dashboards:
        default_home_dashboard_bath: /tmp/dashboards/rancher-default-home.json
    security:
        allow_embedding: true
    users:
        auto_assign_org_role: Viewer

This same configuration has been deployed for 199 days.

It appears that websockets break when V1 monitoring isn't currently working as well. I worked on a setup just now where prometheus was crashlooping due to the memory limit being too low. I don't recall if Grafana was having issues, but it likely was as well. Navigating to Cluster Explorer on this cluster eventually broke the websocket, therefore broke Cluster Explorer AND Cluster Manager as well until a new connection was made.

https://github.com/rancher/dashboard/issues/3214

same issue +1 in harvester.

/forwardport v2.6.4

How is this issue resolved? Any way to fix?

this issue has the same repro steps as this ticket, linking the two for tracking. There was a reopen for the last fix so we are waiting for this to come back to test.

/forwardport v2.6.3-patch1

Based on offline discussion with @davidnuzik @ibuildthecloud @deniseschannon closing this issue for 2.5.12 release.
Note: We have not be able to full repro/validate this issue. We will have user test it using 2.5.12 and 2.6.3-patch1 and if there are any further fixes needed, they will be addressed separately.

基于与@davidnuzik @ibuildthecloud @deniseschannon的离线讨论，为 2.5.12 版本关闭此问题。 注意：我们无法完全重现/验证此问题。我们将让用户使用 2.5.12 和 2.6.3-patch1 对其进行测试，如果需要任何进一步的修复，它们将单独解决。

the version of 2.6.3 is in the same situatiuon
it's a problem

the issue still on v2.6.4

@maradwan Same with me

same here on v2.6.5

I also have wss connection issue notifications popping up on 2.6.7.
The message is:
The connection to wss://my.rancher.host/v1/subscribe closed unexpectedly Thu, Aug 25 2022 11:17:06 am. Retrying...
Websocket Disconnected
The connection to wss://my.rancher.host/v1/subscribe closed unexpectedly

And in the logs it tels me:
Error during subscribe websocket: close sent
Error during subscribe write tcp <IP_ADDRESS>:443->xxx.xxx.xxx.xxx:52499: write: broken pipe

Is there a solution?

can anyone open this issue, or any other issue track this problem?

I also have wss connection issue notifications popping up on 2.6.7.
The message is:
The connection to wss://my.rancher.host/v1/subscribe closed unexpectedly Thu, Aug 25 2022 11:17:06 am. Retrying...
Websocket Disconnected
The connection to wss://my.rancher.host/v1/subscribe closed unexpectedly

And in the logs it tels me:
Error during subscribe websocket: close sent
Error during subscribe write tcp <IP_ADDRESS>:443->xxx.xxx.xxx.xxx:52499: write: broken pipe

Is there a solution?

I am also having this issue in 2.6.7

We are also facing this issue on 2.6.8

Please reopen this issue, so it can be tracked and fixed.

Having problems on stable version: 2.6.8

Not sure what do you expect from me-too comments on a closed Rancher 2.5 issue. Indeed, there was a similar problem in Rancher 2.6 which was solved in 2.6.6 with this PR
Root cause was in our case a high traffic use case on downstream cluster API which burned the cluster agent connection from time to time originated by this back pressure thing.
If you have still problems with broken websocket connections my recommendation would be to open a new issue with description of your exact use case, e.g. bandwith on your cluster agents, load on the Rancher server, count of downstream clusters/nodes. It seems Rancher needs more and more resources from version to version. So it's a good opportunity "to solve" some issues with increase cpu/mem resources on the Rancher server.  Also ordinary network issues can cause broken websocket connections, so check your network and look for similar network issues at the same time.  My last advice would be to set
        - name: CATTLE_DEBUG
          value: "true"

in cluster agent deployment and node agent daemonset, to get more informatiion whats going on. Also helpful, but a little bit of dangerous due the high flood of data:  Increase loglevel of Rancher instance on the fly:
kubectl -n cattle-system exec -it rancher-yyyy loglevel --set debug
or
kubectl -n cattle-system exec -it rancher-yyyy loglevel --set trace

We are also facing this issue on 2.6.8.
We are using 4 installations of rancher + downstream cluster. We got this problem in all of our clusters. That is, there were different conditions everywhere: resources, network, etc.

I have made a new issue to raise awareness for this, since this issue is closed en we still deal with the problem. https://github.com/rancher/rancher/issues/38931
Please feel free to add comments to the new issue if you have the same or similar problems with the websockets, so it hopefully gets more priority. Thnx!

I also encountered an error similar to this websocket, but the reason for the problem is that I used nginx-Ingress-controller in K8S. After I changed it to Kubernetes /ingress-nginx, everything was fine

I also encountered an error similar to this websocket, but the reason for the problem is that I used nginx-Ingress-controller in K8S. After I changed it to Kubernetes /ingress-nginx, everything was fine

what do you mean by that?

For us the situation was caused because of unusually high load on rancher which was resolved through #38804. This is probably only relevant if you're using ActiveDirectory as authentication provider.

@franznemeth nice catch, thx for sharing!
We had some few Keycloak users with ExtraByProvider: nil and after manually fixing userattributes no websocket error occurred anymore. But Rancher nodes have still high load.

Same issue on Rancher 2.5.11
Dashboard works fine for local (rancher) cluster.
On the downstream cluster, "there's a second when in a flash I can see the dashboard, and then I get logged out and redirected to the login page". (as exactly said by the issue owner)
In my case, there was no Rancher upgrade, neither downstream cluster upgrade. The dashboard just stopped working for no apparent reason.

I have the same issue when upgrading from Rancher 2.5 to 2.7.5. I delete all cattle namespaces on EKS and apply the yaml again., still encountered this problem.

Rancher 2.8.0 Error during subscribe websocket provisioning v1.27.8+rke2r1.

So no help here?

@tariksimsek What do you expect from a closed issue? As I already mentioned I'm not fine with this "me-too" comments. Best way is to open a new issue and provide the most information as you can with environment description, logs, Rancher and Cluster Agent in debug mode, any observations what can help to find the root cause.
From my experiences it's still a load problem. Rancher needs more and more resources because they don't cleanup old stuff. Because of that you need bigger machines for a relative small workload. Not sure how long this will work out.


feat: add support for native esm import

Hello,
this PR is related to https://github.com/svsool/axios-better-stacktrace/issues/3
Add support for native ESM imports, in an esm env:
import axiosBetterStacktrace from 'axios-better-stacktrace';

Hi, thanks for the contribution! 💙
I guess the suggestion is to use .mjs and .js extensions via exports map to make ESM and CJS work with Node, but it seems that .mjs might fail some of the build tools, especially in client envs where this plugin can be used, so I think it would be reasonable to use an approach described in this post.
I implemented described approach here https://github.com/svsool/axios-better-stacktrace/commit/47fe36733516b08e89efe56ed4f3b6bda9a33293. I'll publish it with the next version.

@svsool see https://github.com/svsool/axios-better-stacktrace/issues/3#issuecomment-796159540
It's actually a better and less intrusive way to support both module type


Import error cannot import name "frombuffer_empty"

I installed the latest version of sparkit-learn and I got the error

from splearn.feature_extraction.text import SparkCountVectorizer
Traceback (most recent call last):
File "", line 1, in
File "/home/gaurishk/anaconda3/lib/python3.6/site-packages/splearn/feature_extraction/init.py", line 3, in
from .text import SparkCountVectorizer
File "/home/gaurishk/anaconda3/lib/python3.6/site-packages/splearn/feature_extraction/text.py", line 16, in
from sklearn.utils.fixes import frombuffer_empty
ImportError: cannot import name 'frombuffer_empty

What is the version of scikit-learn?

I just installed sparkit-learn and I got the same error. I'm using scikit-learn version: 0.19.0.


[BUGFIX] Velocity variables with dash are not well highlighted #5287

It is introduced dash in regexp for variables
#5287

The test failures seem to be unrelated to your patch—I'm not sure what's up with them. I've merged this, will look into the test issue separately. Thanks!


Error hierarchy, sample code and docstring

#5113 docstring
#5632 Update EPH to be compatible with EventHub track 2
#5112 Revise sample code
#5100 Changed the error hierarchy again and updated eventhubs code accordingly
More alignment from cross-lang reference.
This PR contains changes from both Adam and Yijun.

Can one of the admins verify this patch?


[@opentelemetry/instrumentation-aws-sdk] Allow to ignore specific exception errors

Is your feature request related to a problem? Please describe
The AWS SDK v3 is raising a "NoSuchKey" exception when a a object is not found. This is expected and how the API works.
Unfortunately it also creates a error span in the trace, as exceptions seem to be catched in the AWS instrumentation library. This creates unnecessarily false positive as i see errors what i do not consider a error.
Technically this is correct, but usually it is expected to retrieve this exception and will be catched by the application to handle this case.
So depending on the use case it is either a error or a way to indicate a object exists.
Describe the solution you'd like to see
I see two solutions:

Either a simple config flag to suppress specific exceptions
a ignore hook function to filter such things.

Describe alternatives you've considered
I would be glad if someone could give me a hint how to solve it.
Additional context
aws sdk v3

:disappointed: I also tried to override the status with responseHook, but apparently it is never called as the exception handler kicks in before.

I have a very similar issue to what @project0 describes above... we detect this type of error in application code and having the error surfaced in the span status creates troublesome noise that makes actual errors harder to uncover. While it is possible to suppress tracing entirely from a wrapping span by using the same technique that the AWS SDK instrumentation uses here: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/78953064f8bd957649b8052b03debb200784b351/plugins/node/opentelemetry-instrumentation-aws-sdk/src/aws-sdk.ts#L696, I didn't want to lose the span which produces the error entirely, just change whether or not the span status was set.
The solution I have been using (which required downstream patching of @opentelemetry/instrumentation-aws-sdk is as follows:

In the instrumentation for the library that uses the AWS SDK, we set a context value to an array of command names:

api.context.active().setValue(COMMANDS_TO_SUPPRESS_ERRORS_KEY, ['HeadObject'])

In the patched AWS instrumentation, when an error occurs, if the context value exists, the span status is not set and the error is stored as a span attribute:

const commandsToSuppressErrors = api.context.active().getValue(COMMANDS_TO_SUPPRESS_ERRORS_KEY);
const suppressError = commandsToSuppressErrors && commandsToSuppressErrors.includes(normalizedRequest.commandName);

if (suppressError) {
    span.setAttribute('error.suppressed', err.message || 'true');
} else {
    // this is the original code
    span.setStatus({
        code: api.SpanStatusCode.ERROR,
        message: err.message,
    });
};

I would be happy to submit a pull request for the same. The only doubt I have is whether the context key (in the snippets above the constant COMMANDS_TO_SUPPRESS_ERRORS_KEY) should be defined by the AWS SDK instrumentation or provided in config. Either way would work for me. @project0 do you have a perspective on this?

I am not sure if commands is enough, personally i would prefer something like the responseHook, so i can  fine grand my needs based on the request/response.

Same issue here. Using azure-cosmos and having azure-core instrumented will still create exception events with this error CosmosResourceNotFoundError. To silence it, I currently modify the BatchSpanProcessor in Python:
from opentelemetry.sdk.trace import ReadableSpan
from opentelemetry.sdk.trace.export import BatchSpanProcessor

class CustomSpanProcessor(BatchSpanProcessor):
    def on_end(self, span: ReadableSpan) -> None:
        if isinstance(span.status.description, str) and "CosmosResourceNotFoundError" in span.status.description:
            return

        super().on_end(span=span)

I'd love to have the option to silence certain exceptions/errors with open telemetry.

honestly, there needs to be a way to list exception classes to not-log-as-errors.   throwing exceptions for status is normal behavior for certain functions (think raise NotCachedError)   especially in js/python where exception tossing is considered good behavior


Bar chart rotate labels

Hey. I'm wondering if there is a way to rotate the x axis labels? I can see when creating the ChartAxisValueDouble objects, the default label settings are applied (0 for rotation) and that these objects are then used to build the ChartBarModel objects. However I cannot find a way to edit the label settings for those objects, as the init only access tuples with String and Double.

Yes, you can find rotated labels here

That example appears to be for a line chart, however I'm after a bar chart. The bar chart init seems to be constructed differently.

The axis values work exactly the same for all chart types. You just need to set the rotation in the label settings and pass this to the axis values.


[BugFix] Make sync configurable when writing a new tablet

What type of PR is this：

[x] BugFix
[ ] Feature
[ ] Enhancement
[ ] Refactor
[ ] UT
[ ] Doc
[ ] Tool

Which issues of this PR fixes ：

Make sync configurable when writing a new tablet.
Fixes #
Problem Summary(Required) ：

Checklist:

[ ] I have added test cases for my bug fix or my new feature
[ ] I have added user document for my new feature or new function

run starrocks_be_unittest

starrocks_be_unittest succeeded.

starrocks_be_unittest succeeded.

starrocks_be_unittest succeeded.

BE Build Success

run starrocks_admit_test


db-migrate: command not found

Added db-migrate to package.json and ran npm install. On terminal bash, I get db-migrate: command not found after running. ./node_modules/db-migrate/bin/db-migrate works though.

How do you plan to solve this? By requiring it to be installed globally?

Similarly like I did it in umigrate, there won't be a need to modify NODE_PATH or set it though. I feels always like NODE_PATH is to much unknown by everyone, just because it's not really documented in node.js. There was also a big discussion about global modules and that npm wont support them at all, with Isaac schlueter.
But at first I will just change the documentation to:
npm install -g db-migrate
and add the notice to that if it is intended to be used local to use:
node_modules/db-migrate/bin/db-migrate
instead.

To add some Informations to this:
Even if db-migrate is installed globally, the migrations local will throw the error it can't find db-migrate, because NODE_PATH is unset.
I solved this by requiring the components in db-migrate itself globally and share them down to the migrations.

Oh interesting. I'll look at the commit once it's complete.

have found it, this issue I meant:
https://github.com/npm/npm/issues/823

Thus I will solve the problem in db-migrate making it usable as a global and local module and so spare the nerves of many people who don't know about NODE_PATH has to be set if they want to use global modules and want to require them from the local module.

facing the same issue with db-migrate using it globally or locally give me the same message db-migrate: command not found using windows, "npm":"^8.1.2", "node":"16.13.1", "pg": "^8.7.3", db-migrate": "^0.11.13", "db-migrate-pg": "^1.2.2"

npm install -g db-migrate

How did you add it to your environmental variable


Add sample output to echo example

The goal of the commit is to have a better explained definition of success. When going through the tutorial I was not sure if a single "Hello STUNner" (echoed) printout is expected or doubled (sent and echoed)? Please leave a comment if this is not the expected output.

This was fixed in #42f59, closing now, thx.


Tutorial: throwing a Response

In the Not found data section, when the parameter doesn't match a contact, you suggest throwing a Response object:
throw new Response("", {
  status: 404,
  statusText: "Not Found",
});

Is there any specific reason not to throw a simple Error object:
throw new Error('No contact found')

which is generally preferable?

The same throwing of a Response can also be seen in the useLoader documentation.

throwing a response will render your nearest ErrorBoundary and all you to check the status code and render a 404 (or other status code specific) page instead of rendering a more generic error screen


Initialise hook in execute not in ctor in Cloud SQL operators

Done via https://github.com/apache/airflow/pull/6236


Branch protection

@hoegertn I'm unsure if that is the case, but we should enable branch protection for the main branch.
As soon as the tests in #16  and #17 are implemented we also should consider adding them into the pipeline 🤔

main and production branch are protected


We recently encountered stability issues, so we are experimenting with the parameters (in particular the number of threads). However, each time we restart the pods to try a new param set:

A lot of (duplicate) messages are sent. In our case, the collector tries to send ~1 million messages at once, causing high CPU usage, and hitting Sumologic rate limiting.
After the spike, Sumologic limits us, so delivery is blocked for some time.

The resulting collection usage is the following:

A burst of 1 million messages is sent
Sumologic limits us to zero for some time
We resume normal collection (small bars)

Small bars are our real log production rate (around 1k messages per minute).
This behaviour is highly unstable.

@mfornasa: now that Kubernetes 1.8 has been around for a bit, I have switched to using hostPath persistence for the pos files, which will ensure on restart, fluentD picks up from where it left off.  See #70.


Add procfile lexer

This PR adds Procfile lexer with very basic unit tests.

Thanks for the contribution. Can you please add an example file with golden test output (see https://github.com/pygments/pygments/blob/master/Contributing.md for details)? This also seems to add a spurious Procfile which I think was for testing, can you please remove it?

@Anteru Thank you for the quick review!
./Procfile is removed.
./tests/examplefiles/procfile/Procfile and its .output file are updated.
The .output file is now added to the repository.

Merged, thanks!


Document Windows plugin

[x] Installation:
A Windows plugin installation script has been added via PRs #1642, #1650 and #1654. We should also elaborate plugin installation instructions in the README.md, along with a few examples.
[x] Known differences with vDVS on Linux:
a. Names
[x] FAQs

/cc @shaominchen

This needs to be pulled back into master.


[upstream] html5lib-tests head has failing tests

Updates to upstream https://github.com/html5lib/html5lib-tests are failing in Nokogiri's "upstream" CI:

https://github.com/sparklemotion/nokogiri/actions/runs/4594272018/jobs/8113098993

These failures are from one of these two commits:

https://github.com/html5lib/html5lib-tests/commit/4f45c0211cf1d1f1af319470f77851f60f29914c
https://github.com/html5lib/html5lib-tests/commit/1314b094ed2c4e418404576c24b88aae2ea4e0c1

Here's the output for the seven failing tests:
Failure:
TestHtml5TreeConstructionWebkit02#test_11 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for <dcell><postfield><postfield><postfield><postfield><missing_glyph><missing_glyph><missing_glyph><missing_glyph><hkern>.
Expected: 0
  Actual: 3

Failure:
TestHtml5TreeConstructionWebkit02#test_11__with_node [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for <dcell><postfield><postfield><postfield><postfield><missing_glyph><missing_glyph><missing_glyph><missing_glyph><hkern>.
Expected: 0
  Actual: 3

Failure:
TestHtml5TreeConstructionWebkit01#test_26 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for
   .
Expected: 0
  Actual: 1

Failure:
TestHtml5TreeConstructionWebkit01#test_27 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for
   .
Expected: 0
  Actual: 1

Failure:
TestHtml5TreeConstructionTemplate#test_107 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for <template>.
Expected: 0
  Actual: 3

Failure:
TestHtml5TreeConstructionTemplate#test_106 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for <template></template>.
Expected: 0
  Actual: 3

Failure:
TestHtml5TreeConstructionTemplate#test_110 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:24]
Minitest::Assertion: Expected: "template"
  Actual: "html"

Updates to upstream https://github.com/html5lib/html5lib-tests are failing in Nokogiri's "upstream" CI:

https://github.com/sparklemotion/nokogiri/actions/runs/4594272018/jobs/8113098993

These failures are from one of these two commits:

https://github.com/html5lib/html5lib-tests/commit/4f45c0211cf1d1f1af319470f77851f60f29914c
https://github.com/html5lib/html5lib-tests/commit/1314b094ed2c4e418404576c24b88aae2ea4e0c1

Here's the output for the seven failing tests:
Failure:
TestHtml5TreeConstructionWebkit02#test_11 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for <dcell><postfield><postfield><postfield><postfield><missing_glyph><missing_glyph><missing_glyph><missing_glyph><hkern>.
Expected: 0
  Actual: 3

Failure:
TestHtml5TreeConstructionWebkit02#test_11__with_node [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for <dcell><postfield><postfield><postfield><postfield><missing_glyph><missing_glyph><missing_glyph><missing_glyph><hkern>.
Expected: 0
  Actual: 3

Failure:
TestHtml5TreeConstructionWebkit01#test_26 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for
   .
Expected: 0
  Actual: 1

Failure:
TestHtml5TreeConstructionWebkit01#test_27 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for
   .
Expected: 0
  Actual: 1

Failure:
TestHtml5TreeConstructionTemplate#test_107 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for <template>.
Expected: 0
  Actual: 3

Failure:
TestHtml5TreeConstructionTemplate#test_106 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:120]
Minitest::Assertion: Wrong number of errors for <template></template>.
Expected: 0
  Actual: 3

Failure:
TestHtml5TreeConstructionTemplate#test_110 [/__w/nokogiri/nokogiri/test/html5/test_tree_construction.rb:24]
Minitest::Assertion: Expected: "template"
  Actual: "html"

Upstream PR: https://github.com/html5lib/html5lib-tests/pull/165
Nokogiri PR: https://github.com/sparklemotion/nokogiri/pull/2842
Presumptively closing this issue.


chore: release main

:robot: I have created a release beep boop
pull-through-cache: 0.2.0
0.2.0 (2024-06-10)
Features

Add event callback support (a537bc1)
Support .clearAll() to empty the cache (55a7f2c)

This PR was generated with Release Please. See documentation.

/lint

:robot: Release is at https://github.com/lightbasenl/platforms/releases/tag/pull-through-cache-v0.2.0 :sunflower:


User's episodes ratings retrieval timeout when rating filter is empty

Hello,
In user's ratings retrieval endpoint, [GET] https://api.trakt.tv/users/<id>/ratings/<type>/<rating>, the "rating" filter is optional, but in fact, without it the request goes to timeout when the type is "episodes".

On movies, seasons and shows ratings retrieval, there is no issues when this filter is empty.
Maybe it's because my account has a lot of watched episodes (~18K), I don't know.

Yeah, 18k ratings is the issue. If you provide the username I can troubleshoot further and maybe see why it's timing out even with the pagination params.

Username : eleon
I made some requests on this API just right now, between 04/05/2022 21:20 and 21:40 (GMT). Some of them went to timeout.
Especially when I don't put "page" and/or "limit" parameters. Those are optional, it seems they don't have default values on server side.

Here is another user who informed me of similar timeout issues when retrieving ratings: phox00


non-default spaces fails under 20.1.0 singularity container (but not 20.0.7)

/home/fmriprep/.cache/templateflow is missing from the Singularity image for 20.1.0.
Therefore, under the 20.0.7 singularity container, if I specify a nondefault space like:
--output-spaces MNI152NLin6Asym:res-2 anat fsaverage

it works fine, and does not attempt to download anything (which won't work in the container, and won't work on a cluster where nodes can't reach the internet).
The exact same dataset, submitted with the exact same arguments but using the 20.1.0 container, fails:
Downloading https://templateflow.s3.amazonaws.com/tpl-OASIS30ANTs/tpl-OASIS30ANTs_res-01_T1w.nii.gz
Process Process-2:
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/miniconda/lib/python3.7/site-packages/urllib3/util/connection.py", line 79, in create_connection
    raise err
  File "/usr/local/miniconda/lib/python3.7/site-packages/urllib3/util/connection.py", line 69, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

I just checked the 20.1.0 image:
$ singularity shell fmriprep_20.1.0.simg
Singularity> ls /home/fmriprep/.cache/templateflow/
tpl-MNI152Lin		 tpl-MNI152NLin2009cSym  tpl-MNI152NLin6Sym  tpl-MNIPediatricAsym  tpl-OASIS30ANTs  tpl-WHS   tpl-fsaverage
tpl-MNI152NLin2009cAsym  tpl-MNI152NLin6Asym	 tpl-MNIInfant	     tpl-NKI		   tpl-PNC	    tpl-fsLR
Singularity> ls -lh /home/fmriprep/.cache/templateflow/tpl-OASIS30ANTs/tpl-OASIS30ANTs_res-01_T1w.nii.gz
-rw-rw-r-- 1 root root 31M May 28 10:04 /home/fmriprep/.cache/templateflow/tpl-OASIS30ANTs/tpl-OASIS30ANTs_res-01_T1w.nii.gz

What does your command look like?

Huh. It looks like that. I could have sworn when I checked a few minutes ago it wasn't there.
Anyway, so that's not the reason, so what is the reason for this failure?

Do you have SINGULARITYENV_TEMPLATEFLOW_HOME=/home/fmriprep/.cache/templateflow defined?

No, but I didn't on 20.0.7 either.

Adding that environment variable fixed it. Not sure why it wasn't needed under 20.0.7, though.

That's weird, the Dockerfile of both tags seems the same.

I'm not sure why the 20.0.7 image worked, but the behavior of the 20.1.0 image is expected - singularity users have to explictily set the TEMPLATEFLOW_HOME envvar to /home/fmriprep/.cache/templateflow to take advantage of the pre-cached templates

Was there a reason we didn't put TEMPLATEFLOW_HOME=/home/fmriprep/.cache/templateflow in the Dockerfile? I can't quite remember.

Yes, the reason is Singularity users won't have write permission to that directory. So by default, users requesting non-cached templates would experience failures


mingw doesn't have gmtime_s()

Description

Type: Bug
Priority: Blocker

Bug
OS
linux|windows
mbed TLS build:
Version: 0592ea772aee48ca1e6d9eb84eca8e143033d973
Building with mingw32, with the default configuration fails because mingw doesn't have gmtime_s().

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The build should work out of the box (or tarball).

ARM Internal Ref: IOTSSL-2587

The issue is about using the correct toolchain! The mingw compiling guide describes how to use the older mingw32, which is what I was testing with on my personal development environment. However, the library now requires for the development branch mingw64 which can be downloaded from here.
Use the correct mingw, and it both builds cleanly and passes all tests.
The bug is in obsolete documentation. We need to state the correct version of mingw to use in the different places it uses it.

This is an issue with mingw32, as mentioned in https://sourceforge.net/p/mingw-w64/bugs/452/
Note: This could probably be fixed, if building mingw32 with --enable-secure-api

I have downloaded mingw64 version 8.1.0 for architecture x86_64, and with the make CC=x86_64-w64-mingw32-gcc and it seems that the gmtime_s issue is resolved, but got the following link errors:
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x7a): undefined reference to `__imp_getaddrinfo'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x98): undefined reference to `__imp_socket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0xa5): undefined reference to `__imp_connect'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0xac): undefined reference to `__imp_closesocket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x103): undefined reference to `__imp_freeaddrinfo'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x137): undefined reference to `__imp_WSAStartup'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x1e6): undefined reference to `__imp_getaddrinfo'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x203): undefined reference to `__imp_socket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x20a): undefined reference to `__imp_setsockopt'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x211): undefined reference to `__imp_bind'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x218): undefined reference to `__imp_listen'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x297): undefined reference to `__imp_freeaddrinfo'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x2ca): undefined reference to `__imp_closesocket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x2e4): undefined reference to `__imp_WSAStartup'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x315): undefined reference to `__imp_closesocket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x325): undefined reference to `__imp_closesocket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x39e): undefined reference to `__imp_getsockopt'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x3fa): undefined reference to `__imp_recvfrom'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x465): undefined reference to `__imp_connect'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x4a2): undefined reference to `__imp_accept'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x4b4): undefined reference to `__imp_WSAGetLastError'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x4f7): undefined reference to `__imp_getsockname'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x518): undefined reference to `__imp_socket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x53f): undefined reference to `__imp_setsockopt'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x554): undefined reference to `__imp_bind'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x5a3): undefined reference to `__imp_WSAGetLastError'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x5eb): undefined reference to `__imp_ioctlsocket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x61b): undefined reference to `__imp_ioctlsocket'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x692): undefined reference to `__imp_select'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x707): undefined reference to `__WSAFDIsSet'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x717): undefined reference to `__WSAFDIsSet'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x7b1): undefined reference to `__imp_recv'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x7c3): undefined reference to `__imp_WSAGetLastError'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x879): undefined reference to `__imp_select'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x8a2): undefined reference to `__imp_WSAGetLastError'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x8f1): undefined reference to `__imp_send'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x903): undefined reference to `__imp_WSAGetLastError'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x957): undefined reference to `__imp_shutdown'
../library/libmbedtls.a(net_sockets.o):net_sockets.c:(.text+0x960): undefined reference to `__imp_closesocket'

Need further investigation, might be missing winsock library

I forgot to set WINDOWS=1
No issue, except updating mingw64

I can now see that the guide  mentions mingw64. Can this issue be closed?


How to use the TLS example and how to connect to WSS url

Hey @matth-x I have worked on this Libarary till now using normal unsecure connection i.e with port number 8180 and 8080, Just last week i started working on the WSS urls and my device is not getting connected
I'm getting error as "Certificate verification failed, e.g. CRL, CA or signature check failed'
What changes should i consider while working with Secure websocket urls

#127 will solve your issue, you can look into the commits I've made or just wait for it to be merged into master (this should happen soon)

@matth-x great call about using TLS instead of SSL! I'm happy that the PR will help @piyush9999

Hey @pedro-fuoco yes, not so urgent for me even, I am also trying that. Thank you

#127 has been merged and solves this issue.


Prompt caching design defect?

The current approach will waste massive amounts of bandwidth?  Those in bandwidth constrained environments (ie starlink) will be at a disadvantage due to the wasted bandwidth?  Why not follow the redis evalsha pattern to eliminate redundant payloads and wasted bandwidth?
https://github.com/anthropics/anthropic-sdk-typescript/issues/516
https://redis.io/docs/latest/commands/evalsha/

I realize appeal of current approach is lower complexity, perhaps this means we should have two api's?  The current approach, and then another secondary api/approach which uses sha hashes?

@alexalbertt what does completed mean?  Will we have a bandwidth efficient mechanism like evalsha?


Issues when trying to customize shop with values.yml

Hi there,
I'm trying to build a custom shop look for an internal CTF using juice shop, i've been able to modify the shop title and logo modifying it in values.yml but when I try to add the "products" section on it, the juice shop instance will not load.
I'm using multi-juicer with kubernetes with the following setup:
minikube start
helm install multi-juicer multi-juicer/multi-juicer -f multi-juicer/helm/multi-juicer/test.yml
I've also tried using one of the custom yaml provided in the juice shop guide (https://pwning.owasp-juice.shop/part1/customization.html), (tried the Mozilla one) but it will just load the default juice shop looks.
Any help would be appreciated.

Hi @m4riio21!
Sorry didn't see the question before.
You cannot pass the JuiceShop config directly as the values, you need to put it under juiceShop.config, see the default values: https://github.com/iteratec/multi-juicer/blob/main/helm/multi-juicer/values.yaml#L90
The values are used to configure everything in MultiJuicer not just the JuiceShop config so its just a subsection in the MultiJuicer config.
Feel free to reopen if there is still something unclear 🙌


Install nodejs/npm from nodesource

Close #316

nice!
I'm gonna restart the failing travis build because it was a timeout error...let's see how that looks.

travis is happy so I'm gonna merge this in 12 hours unless anybody disagrees!

woot, thanks @GladysNalvarte !!


Updated for installation on Arch systems

makefile uses -lsqlite3 flag if libsqlite3.a is not found
created install_deps_arch.sh for installing dependencies on Arch

thanks!


Update StackedBar to support CharJS 2.0 releases

I need to use ChartJS 2.0 multiple Y axes on a few charts, but I still need to use StackedBar for every other chart on my page.
ChartJS 2.0 is still in beta however, so I don't know if StackedBar is just waiting for that to come out so it can then upgrade.

I will wait for the first final release on 2.0 and then have a check on the upgrades.


[Draft] Index Service Provider Interface (SPI

Why
The objective of this proposal is to add the ability to include new index types at runtime in Apache Pinot. This opens the ability of adding third party indexes, including proprietary indexes. When we talk about index types in this proposal, we are focused on single field index. Constructions like StarTree indexes or future indexes that index more than one column are deliberately ignored.
The plan
All ideas presented here have been already drafted in this branch, where we have been exploring the problem in order to find the solution we propose here. Given the large number of changed in that branch, we think that it is better to use that branch as a reference, but split the changes in different PRs. Right now the idea is to create partial PRs in the following order:

[x] Add the IndexType without modifying already existing code. Include few example implementations
- PR to master: https://github.com/apache/pinot/pull/10191
[x] Add the IndexService without modifying already existing code.
- PR to master with previous changes included: https://github.com/apache/pinot/pull/10192
- Changes from previous PR: https://github.com/gortiz/pinot/pull/1
[x] Partially implement IndexType for each existent index type without modifying already existing code. Methods that define how to create IndexCreators, IndexReaders, IndexHandlers, etc are not going to be implemented here.
- PR to master with previous changes included: https://github.com/apache/pinot/pull/10193
- Changes from previous PR: https://github.com/gortiz/pinot/pull/2
[x] Refactor existing code to use IndexType whenever ColumnIdexType is being used right now.
- PR to master with previous changes included: https://github.com/apache/pinot/pull/10194
- Changes from previous PR: https://github.com/gortiz/pinot/pull/3
[x] The rest of the code
- PR to master with previous changes included https://github.com/apache/pinot/pull/10184
- Changes from previous PR: https://github.com/gortiz/pinot/pull/4
- This includes:
- Create config objects for each index type
- Transform old configs (including usage of IndexLoadingConfig and SegmentGeneratorConfig)
- Refactor each IndexCreator to have a common interface.
- Remove IndexCreatorProvider and IndexReaderProvider interfaces and implementations, moving the code to each IndexType. Here classes which delegate on these providers (like PhysicalColumnIndexContainer) will be modified to call the equivalent methods on IndexType.
- Refactor classes like PhysicalColumnIndexContainer or SegmentColumnarIndexCreator to call just iterate over the IndexTypes returned by IndexService instead of explicitly ask for each one

Blockers in Apache Pinot 0.12

Index types are treated as enums, which are, by definition, decided at compile time. For example, ColumnIndexType.
Index configuration is specified in TableConfig, specially in FieldConfig and IndexingConfig. These classes are POJOs with one or more attributes per index type. Therefore to add a new index it is needed to add attributes and recompile the class.
There is at least one IndexCreator per index type, but each IndexCreator is different to the other. They do not fulfill a common contract. The same happen with IndexReader. Ideally IndexCreators and IndexReaders should be closer to IndexHandlers, which do follow the same contract for each index type.
IndexCreators are created using different XIndexCreatorProvider, where X is the index type (like ForwardIndexCreatorProvider) but:

Each provider has its own methods with its own arguments that derive from IndexCreationContext.
These XIndexCreatorProviders do not have a common interface.
There is a IndexCreatorProvider interface, but it extends all other XIndexCreatorProvider. That pattern goes against the extensibility. For example, in case a new index type called Test was added, we would need to modify IndexCreatorProvider to also extend TextIndexCreatorProvider and implement its method in all implementations, which obviously requires to recompile the project.
Same happens with IndexReaderProvider
Same happens with MutableIndexProvider

Indexes are being used when PlanNodes are translated into physical operators. Right now this transformation is totally static. In case we want to add a new index we need to modify methods like FilterPlanNode.constructPhysicalOperator or FilterOperatorUtils.getLeafFilterOperator in order to add new transformation rules, which are eagerly executed.

The IndexService and the IndexType class
This proposal is evolves around the idea that indexes should be obtained from an IndexService. There should be a single instance on every Pinot component that uses indexes (like Pinot Servers). Optionally this singleton can be substituted by a bunch of static methods in the IndexService class.
This IndexService will contain a map from a String id to values of IndexType, which has to be a new interface that completely identifies an index. The IndexType interface will have methods that define the index id, how to configure the index given a TableConfig and how to obtain its IndexCreator, IndexReader, IndexHandler and optionally its MutableIndex. These last methods will require information from the environment. Specially they will require some contextual information (like statistics for the column) and some configuration. There should be a single IndexType instance for each index type in Pinot (ie one for forward indexes, one for range indexes, etc).
Pinot will have a new configuration to specify which indexes should be available and at startup Pinot will look for the corresponding IndexType in the classpath and add it to the IndexService singleton. After that, whenever Pinot requires to use an index Pinot will use the IndexService to get the IndexType instance. To look for all indexes in the classpath, the draft implementation uses an intermediate IndexPlugin interface that is discovered using Java Service Providers.
The index configuration
As said above, current way to configure is very static, requiring to add new attributes at compile time to the POJOs we have. At the same time, indexes are configured in different ways depending on their requirements and when it was created.
Right now, index configuration is spread across different fields in the TableConfig, which has two key resposibilities:

Being the class that is being used to define how the JSON is written by the users
Being the class that devs use to create the readers and creators.

Although it is not impossible to correctly implement both things in the same class, we think that it would be better to clearly differentiate between the concrete syntax used by the user to write JSONs and the classes with the final configuration (with default values resolved, for example). Having both responsibilities in the same classes makes more difficult to modify the way indexes are configured by the users without impacting on the code and the other way around. For example, bloom filters were originally designed to be configured as a list of columns that have to be indexed but at some point we wanted to let users to customize the bloom filter properties, so TableConfig contains both bloomFilterColumns and bloomFilterConfigs. Instead of being constraint at TableConfig level, this duality permeated to all other parts of the code, so a very common pattern was to first read bloomFilterColumns and then bloomFilterConfigs in several places of the code.
Previous TableConfig has other problems:

Documentation is spread between tableIndexConfig and fieldConfigList. Text search support doc page says that fieldConfigList is the newest way to configure indexes, but when using that advanced configuration has to be done in a generic properties field, which was mapped to a Map<String, String>. This is bad for various reasons:

It creates a single namespace where properties of different index may collide.
It restricts the value of the configuration to strings, so in order to support advanced configurations devs must parse the string their self and users must know which syntax is expected for each value. This is even worse when the parsing has to be done in several different places in the code (for example, when creating an index and when reading an index).

In order to add a new index, TableConfig source file has to be changed to add a new attribute in order to be known by Jackson. That is strong blocker in order to have index types defined at runtime.
It is impossible to create instances or modify of TableConfig in a programmatic type safe way. Therefore we introduced some abstractions like IndexLoadingConfig or ColumnIndexCreationInfo so we can programmatically modify the config (mainly, but not only, in tests).
In order to create or read some indexes, we need not only the configuration provided by the user but also some contextual information that has to be pre-processed (like for example the max or min values). Therefore we created classes like IndexCreationContext, where we merged the contextual information with index specific configurations. This is again incompatible with having index types defined in runtime. For example, we would need to create a method like IndexCreationContext.Common.forBloomFilter() for each new index type, which would require to modify the source code each time a new index is added.

TableConfig is not in fact very bad designed. The actual problem is that we are using TableConfig for everything. What this proposal does is to keep TableConfig as the concrete syntax specific object that is usually instantiated by Jackson when a table is deserialized from JSON. In parallel, each IndexType has a generic C (which stands for config) and defines how to transform a TableConfig into an instance of C
Therefore all the dirty code we have to introduce in order to support historical ways to configure the index is written only once and in the same method for each IndexType instead of being spread across the code. This should produce code that is easier to read and to maintain. Methods that are used to instantiate IndexCreators, IndexHandlers or IndexReaders will be explained bellow, but they do not receive the TableConfig (or a wrapper like IndexLoadingConfig) as an argument. Instead, they receive the already prepared generic C object they expect.
With the change explained above we have the ability to specify all IndexType methods without depending on the specially crafted interfaces like IndexLoadingConfig, SegmentGeneratorConfig or IndexCreationContext. But it doesn't explain how to open the TableConfig to be able to store indexes that are unknown at compile time. The proposal here is to modify a little bit the idea of configuring all indexes in FieldConfig. Instead of list active indexes in the field indexTypes, here we propose to create a new field called indexes. That field is going to be either null or a JSON object whose keys are the id of the configured indexes and the values are defined by each IndexType. To implement that, we propose the following:

FieldConfig.indexes will be of type JsonNode, which is the most abstract Jackson type. Anything that can be deserialized with Jackson can be deserialized into a JsonNode.
The class IndexType will have a method that returns the unique id of the index (for example, ForwardIndexType.getId() can return "forward").
The class IndexType will also have a method that given a JsonNode, returns an instance of C.

When Pinot requires to transform FieldConfig.indexes from JsonNode into proper configuration objects, it will do something like the following:
  if (fieldConfig.indexes.isNull) {
    return null;
  }
  if (fieldConfig.indexes.isObject) {
    Iterator<Map.Entry<String, JsonNode>> it = node.fields();

    Map<IndexType, Object> builder = new HashMap<>();
    while (it.hasNext()) {
      Map.Entry<String, JsonNode> entry = it.next();
      String indexId = entry.getKey();

      IndexType indexType = IndexService.getInstance().getIndexType(indexId);
      if (indexType == null) {
         // decide what to do: continue or fail
      }
      JsonNode indexNode = entry.getValue();
      Object deserialized = indexType.deserialize(indexNode);
      builder.put(indexType, deserialized);
    }
  }

By doing that, we could be sure that if we do something like map.get(BloomIndexType.INSTACE) we will receive a BloomFilterConfig. The draft includes a intermediate class called FieldIndexConfigs which is a typesafe wrapper on top of a map like the one shown here.
So, for example, this configuration configuration that is currently supported by Pinot:
{
  "tableIndexConfig": {
    "rangeIndexColumns": [
       "col1"
    ],
    "bloomFilterConfigs": {
      "col1": {
        "fpp": 0.01,
        "maxSizeInBytes": 1000000,
        "loadOnHeap": true
      }
    },
    "invertedIndexColumns": [
      "col1"
    ]
  },
  "fieldConfigList": [
    {
       "name": “col1”,
       "indexTypes": [
          “text”
       ],
       "properties": {
          "fstType": “lucene”,
          "stopWordsInclude": "a,b,c",
          "enableQueryCacheForTextIndex": “false”,
          "isSegmentPartitioned": “true” // this property is not related to an specific index
       }
    }
  ]
}

Could be implemented as:
{
  "fieldConfigList": [
    {
       "name": “col1”,
       "indexes": {
         "inverted": true, // or {enabled: true}
         "range": true, // or {enabled: true}
         "text": {
           "type": “lucene”,
           "enableQueryCacheForTextIndex": false,
           "stopWordsInclude": ["a", "b", "c"]
         },
        "bloom": {
          "fpp": 0.01,
          "maxSizeInBytes": 1000000,
          "loadOnHeap": true
         },
       },
       "properties": {
          "isSegmentPartitioned": “true” // this property is not related to an specific index
       }
    }
  ]
}

In cases like BloomFilter, when BloomFilterConfig is already serializable/deserializable with Jackson, the method that transform from JSON to object could be:
  BloomFilterConfig deserialize(JsonNode node)
      throws IOException {
    return JsonUtils.jsonNodeToObject(node, getIndexConfigClass());
  }

Assuming that Java null means that the index is not configured, in case we need to customize that, for example on inverted indexes when there is no argument, we can do the same:
  public Boolean deserialize(JsonNode node)
      throws IOException {
    if (node.isBoolean()) {
      if (node.booleanValue()) {
        return Boolean.TRUE;
      } else {
        return null;
      }
    }
    throw ...
  }

In case we want to support different ways to configure the index, for example RangeIndexType when we would like to either use true to use the default or an object to be able to indicate the version of the range index, we can do something like:
  public RangeIndexConfig deserialize(JsonNode node)
      throws IOException {
    if (node.isBoolean()) {
      if (node.booleanValue()) {
        return getDefaultConfig();
      } else {
        return null;
      }
    }
    return JsonUtils.jsonNodeToObject(node, getIndexConfigClass());
  }

Most of these methods can also be delegated to Jackson by using customized deserializers, but we think that having this method here is more explicit and requires less knowledge of Jackson, which could make it easier to read.
This proposal makes this new way to configure indexes optional to indexes in Apache Pinot repository but mandatory for indexes outside this repo. Therefore the proposal must support the  older way to configure indexes. This can partially be done by the already mentioned method that transform from TableConfig to C, but we may also need other methods to transform from IndexLoadingConfig and SegmentGeneratorConfig to C, as they are usually modified by tests.

The partial PRs are subsets of the changes included in https://github.com/apache/pinot/pull/10184. These partial PRs are here to help with the review. It is not clear whether we are going to merge the whole PR or the partial PRs, but it is important to understand that the partial PRs include some design decisions that may look strange in the partial PR because they were designed like that to solve some problem we are going to find in future PRs.
We need to analyze the whole picture to understand some design decisions that are shown in the partial PRs.

cc @zhtaoxiang @walterddr @npawar @klsince

fyi @siddharthteotia @yupeng9 @vvivekiyer

Yes I will be going over the SPI PRs to be aware of the changes. @Jackie-Jiang  suggested to start with IndexType.

Thanks for starting this effort. It's a huge one and it will be a significant improvement to the Pinot architecture. A couple of questions:

From the descriptions, this seems to have quite a few breaking changes. Will this be merged after 1.0 release?
Can you put the description into a google doc (PEP?), so the ease of commenting?

From the descriptions, this seems to have quite a few breaking changes. Will this be merged after 1.0 release?

The idea is to reduce the number of breaking change to the bare minimum. By design there shouldn't be any breaking change. I even try to replicate some strange behaviors that look problematic (or even bugs) to keep the backward compatibility. Obviously a large change like this one may include bugs or it may be some corner case that I wasn't able to detect, but in that case we should be able to fix them and recover the current behavior.

Can you put the description into a google doc (PEP?), so the ease of commenting?

I think that would be a good idea.

I've created #10352 in order to clean up IndexLoadingConfig and SegmentGeneratorConfig. During this month I've have to deal with several complex merges when retrieving code from master and I hope #10352 is merged soon in order to reduce the conflicts in future.

index-spi-index-type-only has been merged
index-spi-index-service, index-spi-all-types and index-spi-remove-columnindextype have been marked as ready to review

The feature has been merged


.NET Interactive from vscode extension vs .NET C# from dotnet interactive jupyter install

The package and version I'm asking about:

$ dotnet interactive --version
1.0.317502+9c2a225c543085a04516cc4fc490919d5925ba87

#!about magic command output:
.NET Interactive

© 2020 Microsoft Corporation

Version: 1.0.317502+9c2a225c543085a04516cc4fc490919d5925ba87

Build date: 2022-03-25T20:43:44.0000000Z

https://github.com/dotnet/interactive

Question

I have installed both the vscode extension based kernel (called .NET Interactive in vscode) and the dotnet-interactive tool based kernel  (called .NET C# in vscode) seen by running
$ jupyter kernelspec list
Available kernels:
  .net-csharp        /home/maxfire/.local/share/jupyter/kernels/.net-csharp
  .net-fsharp        /home/maxfire/.local/share/jupyter/kernels/.net-fsharp
  .net-powershell    /home/maxfire/.local/share/jupyter/kernels/.net-powershell
  julia-1.7          /home/maxfire/.local/share/jupyter/kernels/julia-1.7
  python3            /home/maxfire/anaconda3/share/jupyter/kernels/python3

If I run the following C# script in a cell
#r "nuget: System.CommandLine, 2.0.0-beta3.22222.1"

var root = new System.CommandLine.RootCommand("desc");
var command = new System.CommandLine.Command("name", "desc");

return (root.GetType().ToString(), command.ToString());

it fails in the .NET Interactive kernel
Error: System.CommandLine version 2.0.0-beta3.22222.1 cannot be added because version <IP_ADDRESS> was added previously.

but it succeeds in the .NET C# kernel.

Item1
Item2

System.CommandLine.RootCommand
Command: name

Question: What are the main differences between the two kernels?

If you run #!about in VS Code and in Jupyter you'll most likely see different versions. They're both using the same dotnet-interactive tool but the VS Code extension manages its own installation of it, which at any given moment might be at a different version from the one you've installed globally that's used by Jupyter.
There are some small configuration differences but the goal is to make sure that notebooks that work in one frontend also work in the others.
What you're seeing with System.CommandLine is that since dotnet-interactive references it directly, you can't load a different version of it.

There are some small configuration differences but the goal is to make sure that notebooks that work in one frontend also work in the others.

I am actually not using any of the traditional Jupyter clients/frontends (notebook and/or lab) -- although I could for the global tool installed kernels (I have jupyter and all the core packages installed; cf the $ jupyter kernelspec list command above). I am instead using the vscode client (that is in preview, I believe) in both examples above. I am not sure if this matter? But I guess that the .NET Interactive kernel is not using the jupyter/python based web server. And that the .NET C# kernel (on the other hand) is using the python (web-)based server.
Does this also explain why System.CommandLine is only loaded into the CLR when using the vscode managed (non jupyter/python based) installation?

These are my findings using AssemblyLoadContext:
System.CommandLine is only loaded in the first example...
.NET Interactive

index
value

0
System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e

1
System.CommandLine, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=31bf3856ad364e35

2
Microsoft.DotNet.Interactive, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=31bf3856ad364e35

3
Microsoft.DotNet.Interactive.VSCode, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=31bf3856ad364e35

4
System.Linq, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

.NET (C#)

index
value

0
System.Private.CoreLib, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=7cec85d7bea7798e

1
Microsoft.DotNet.Interactive, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=31bf3856ad364e35

2
Microsoft.DotNet.Interactive.Jupyter, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=31bf3856ad364e35

3
System.Linq, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

This is probably unimportant to most people.
I am just seeing a lot of options, after trying out .NET based notebooks:

kernel (this question)
file formats (dib vs ipynb...confusing(!) for beginner)

Feel free to close


"s" symbol wrongly removed from animation-delay

Currently, animation-delay: 0s is being converted into animation-delay:0 by nanocss.
However, animation-delay: 0 is invalid as it is a time data type, not length.
(See: https://developer.mozilla.org/en-US/docs/Web/CSS/time)
While this is normally not a problem as 0s is the default value, it can cause issues when the delay is generated programatically through scss in the animation shorthand, thereby breaking the whole statement.
Example
@mixin loading-ball($n, $radius, $ceiling) {
  $position: ($n - 1)*($radius*3);
  $top: -$ceiling;
  $delay: ($n - 1)*-0.08s;
  animation: ball-#{$position}-#{$ceiling} 1.4s ease infinite $delay;
  @at-root {
    @keyframes ball-#{$position}-#{$ceiling} {
      from {
        left: $position;
        top: 0;
      }
      ...
  }
}

The above produces a valid animation directive for $n: 1, but becomes invalid after minification.

Are you sure? I just tried it with the CLI;
h1{animation-delay: 0s}

Output:
h1{animation-delay:0s}

Is it not the preprocessor rounding this value and dropping the s?

Apologies. I actually only happens for the animation shorthand and I assumed it affects both. I'll edit the issue to reflect that.

Could you attach a CSS example that reproduces this error please?

Apologies, I used the CLI and confirmed it is some other pre-processor that is dropping the s.

Alright, cool. :+1:


Examples of handling a WebRTC stream?

I've been able to create an SDP file (with pointers from #115) and successfully get a response from my device (nest wired doorbell) via:
$ poetry run google_nest --project_id="${PROJECT_ID}" generate_web_rtc_stream DEVICE_ID /path/to/offer.sdp

but I get errors when I try to play:
$ sudo ffplay -protocol_whitelist file,udp,rtp -loglevel debug -i /tmp/answer.sdp
ffplay version 7.0 Copyright (c) 2003-2024 the FFmpeg developers
...
[udp @ 0x600002a74280] bind failed: Address already in use
[AVIOContext @ 0x1342056e0] Statistics: 2335 bytes read, 0 seeks
/tmp/answer-py.sdp: Invalid data found when processing input

are there examples of working with the answer SDP data using python / ffmpeg or something else? Ultimately I'd like to extract a frame from the stream.

I have only experience using it through a browser based webrtc implementation. Here is the context and a writeup of all that I learned about how webrtc works https://github.com/home-assistant/architecture/discussions/640 with a browser player https://github.com/home-assistant/frontend/blob/dev/src/components/ha-web-rtc-player.ts
I am not aware that it works out of the box with ffmpeg or anything like that. You maybe could try looking at the go samples in https://github.com/pion/example-webrtc-applications
I won't really be able to help you make a non-browser based webrtc player. Happy to share what i know on the browser side though.

Thank you for the great resources, I'll start there!


Fix crashes due to rpc connection being lost

I fixed these previously in the Listener but I was able to consistently repro the same issues in the PythonLanguageClient, so these need to be caught there too.

I know there's a better way to generically handle this exception for all these different rpc calls, but I that code ended up really messy so I opted to just duplicate the try catch since there's only a few of them. If anyone has any ideas on how to wrap each of the calls without it being super ugly, I'm all ears 😄

Refactored the code a bit so all the exception handling takes place in the new JsonRpcWrapper class. This prevents the race condition where _rpc is set to null while we're using it, and eliminates the duplicated silence exception code.


Cryptic error message when assigning to a variable in a tf.function

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
Yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
MacOSX 10.13.6
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
N/A
TensorFlow installed from (source or binary):
binary
TensorFlow version (use command below):
VERSION=2.0.0-dev20190716
GIT_VERSION=v1.12.1-6367-gb51a1b258b
Python version:
3.6.8
Bazel version (if compiling from source):
N/A
GCC/Compiler version (if compiling from source):
N/A
CUDA/cuDNN version:
N/A
GPU model and memory:
N/A

Describe the current behavior
When assigning to a TF variable with the = operator in a TF Function, I get a really cryptic error message.
This issue is about the error message, not the error itself (I should have called the variable's assign() method).
Describe the expected behavior
I was hoping for a more explicit error message.
Code to reproduce the issue
import tensorflow as tf

v = tf.Variable(0.)

@tf.function
def f(x):
    global v
    v = v + x  # no problem if use v.assign(v + x)
    return v

f(42.0)

Other info / logs
2019-07-16 21:02:26.141110: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-07-16 21:02:26.154309: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fe6734a6e50 executing computations on platform Host. Devices:
2019-07-16 21:02:26.154329: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
2019-07-16 21:02:26.222272: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1558] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
2019-07-16 21:02:26.223137: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Failed precondition: Error while reading resource variable _AnonymousVar0 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/_AnonymousVar0/N10tensorflow3VarE does not exist.
	 [[{{node ReadVariableOp}}]]
---------------------------------------------------------------------------
FailedPreconditionError                   Traceback (most recent call last)
<ipython-input-1-a1cd73b43975> in <module>
      9     return v
     10
---> 11 f(42.0)

~/miniconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/def_function.py in __call__(self, *args, **kwds)
    433               *args, **kwds)
    434       # If we did not create any variables the trace we have is good enough.
--> 435       return self._concrete_stateful_fn._filtered_call(canon_args, canon_kwds)  # pylint: disable=protected-access
    436
    437     def fn_with_cond(*inner_args, **inner_kwds):

~/miniconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py in _filtered_call(self, args, kwargs)
    633          if isinstance(t, (ops.Tensor,
    634                            resource_variable_ops.BaseResourceVariable))),
--> 635         self.captured_inputs)
    636
    637   def _call_flat(self, args, captured_inputs):

~/miniconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py in _call_flat(self, args, captured_inputs)
    743     # Only need to override the gradient in graph mode and when we have outputs.
    744     if context.executing_eagerly() or not self.outputs:
--> 745       outputs = self._inference_function.call(ctx, args)
    746     else:
    747       self._register_gradient()

~/miniconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py in call(self, ctx, args)
    457             attrs=("executor_type", executor_type,
    458                    "config_proto", config),
--> 459             ctx=ctx)
    460       # Replace empty list with None
    461       outputs = outputs or None

~/miniconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     65     else:
     66       message = e.message
---> 67     six.raise_from(core._status_to_exception(e.code, message), None)
     68   except TypeError as e:
     69     keras_symbolic_tensors = [

~/miniconda3/envs/tf2/lib/python3.6/site-packages/six.py in raise_from(value, from_value)

FailedPreconditionError:  Error while reading resource variable _AnonymousVar0 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/_AnonymousVar0/N10tensorflow3VarE does not exist.
	 [[node ReadVariableOp (defined at /Users/ageron/miniconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1657) ]] [Op:__inference_f_15]

Function call stack:
f

I was able to replicate the issue with TF VERSION=2.0.0-dev20190716. Take a look at the Gist of Colab link .Thanks!

The code snippet works with TF 1.14

@ageron Unfortunately, tf.Variable does not override arithmetic operators and in effect v = v + x will replace the Variable v with a Tensor - is this what you expected?
@alextp @jaingaurav  I suspect the root cause here is that tf.function captures a weak reference to the variable, which is then deallocated. If that's indeed the case, then this example shows that the weakref should in fact be a strong reference and be tied to the graph that relies on it.
Note: this error is unrelated to autograph; the snippet below throws the same error:
v = tf.Variable(0.)

@tf.function(autograph=False)
def f(x):
    global v
    v = v + x  # no problem if use v.assign(v + x)
    return v

f(42.0)

The issue is that v = v + x doesn't assign to the variable, it throws the variable away (deleting it) and then assigns a tensor internal to the function (v+x) to the name v.
Because you threw the variable away and you're trying to execute a graph which reads the value of the variable (so it can compute v+x, which translates internally as add(read_variable(v), x)) we fail.
The error message could be better, but the behavior is WAI.

Thanks @alextp, I know it is WAI, this issue is about the error message, as I wrote earlier:
"This issue is about the error message, not the error itself (I should have called the variable's assign() method)."

Was able to reproduce the issue with TF v2.2.0-rc3 and TF-nightly. Please find the attached gist. Thanks!

Was able to replicate the issue with TF v2.5,please find the gist here ..Thanks!

Hi @ageron , Values can be  only added to variable using  assign_add/assign operations .For other variable operations  please refer to this .  providing gist for reference.

@mohantym , yes of course, that's why I wrote this: "This issue is about the error message, not the error itself (I should have called the variable's assign() method).". The error message is just as cryptic today with TF 2.6 as it was with TF 2.0.

Quick note that we're still tracking this issue and intend to fix it, so it should stay open.
It might ultimately be easier do what'd be normally expected and use assign instead of raising an error.


Added horizontal rules to FAQ section in readme

Adding horizontal rules between each question in the readme makes the FAQ section much easier to read.

Cheers :)


Support "Get Change Detail"

https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-change-detail

Coverage increased (+0.02%) to 90.754% when pulling 98d39603b113f9559a844e93249deff18f2b4d49 on Cosium:support-get-change-detail into 05264197cff4885d0c9beae5f5782576f054d212 on uwolfer:master.