Implemented unjoin.

Fixed #127
/cc @marun @onyiny-ang

/lgtm
Thanks @gyliu513

@font, Can you PTAL and approve this pr. Thanks !

@gyliu513, I joined a cluster to federation, unjoined and then try to join again. Below are some errors i see. can you please repeat this scenario and fix error.
First time join:
root@shashi-laptop:~/gopath/src/github.com/kubernetes-sigs/federation-v2# kubefnord join c2 --host-cluster-context c1 --add-to-registry --v=2
ERROR: logging before flag.Parse: I0709 21:13:57.619413   30827 join.go:125] Defaulting cluster context to joining cluster name c2
ERROR: logging before flag.Parse: I0709 21:13:57.619466   30827 join.go:129] Args and flags: name c2, host: c1, host-system-namespace: federation-system, kubeconfig: , cluster-context: c2, secret-name: , dry-run: false
ERROR: logging before flag.Parse: I0709 21:13:57.628944   30827 join.go:183] Performing preflight checks.
ERROR: logging before flag.Parse: I0709 21:13:57.647257   30827 join.go:270] Registering cluster with the cluster registry.
ERROR: logging before flag.Parse: I0709 21:13:57.663008   30827 join.go:278] Registered cluster with the cluster registry.
ERROR: logging before flag.Parse: I0709 21:13:57.663035   30827 join.go:204] Creating federation-system namespace in joining cluster
ERROR: logging before flag.Parse: I0709 21:13:57.668333   30827 join.go:212] Created federation-system namespace in joining cluster
ERROR: logging before flag.Parse: I0709 21:13:57.668368   30827 join.go:215] Creating cluster credentials secret
ERROR: logging before flag.Parse: I0709 21:13:57.668385   30827 join.go:404] Creating service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:13:57.700678   30827 join.go:413] Created service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:13:57.700702   30827 join.go:415] Creating role binding for service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:13:57.722659   30827 join.go:425] Created role binding for service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:13:57.722676   30827 join.go:427] Creating secret in host cluster
ERROR: logging before flag.Parse: I0709 21:13:58.735069   30827 join.go:565] Using secret named: c2-c1-token-ck2jj
ERROR: logging before flag.Parse: I0709 21:13:58.744043   30827 join.go:597] Created secret in host cluster named: c2-t7gbb
ERROR: logging before flag.Parse: I0709 21:13:58.744083   30827 join.go:436] Created secret in host cluster
ERROR: logging before flag.Parse: I0709 21:13:58.744097   30827 join.go:225] Cluster credentials secret created
ERROR: logging before flag.Parse: I0709 21:13:58.744109   30827 join.go:227] Creating federated cluster resource
ERROR: logging before flag.Parse: I0709 21:13:58.899699   30827 join.go:235] Created federated cluster resource

Unjoin:
root@shashi-laptop:~/gopath/src/github.com/shashidharatd/federation-dns# kubefnord unjoin c2 --host-cluster-context c1 --remove-from-registry --v=2
ERROR: logging before flag.Parse: I0709 21:24:42.114680   32531 unjoin.go:109] Defaulting cluster context to unjoining cluster name c2
ERROR: logging before flag.Parse: I0709 21:24:42.114748   32531 unjoin.go:113] Args and flags: name c2, host: c1, host-system-namespace: federation-system, kubeconfig: , cluster-context: c2, dry-run: false
ERROR: logging before flag.Parse: I0709 21:24:42.119048   32531 unjoin.go:161] Performing preflight checks for unjoin cluster.
ERROR: logging before flag.Parse: I0709 21:24:42.132286   32531 unjoin.go:230] Removing cluster from the cluster registry.
ERROR: logging before flag.Parse: I0709 21:24:42.150462   32531 unjoin.go:238] Removed cluster from the cluster registry.
ERROR: logging before flag.Parse: I0709 21:24:42.150482   32531 unjoin.go:174] Deleting federated cluster resource
ERROR: logging before flag.Parse: I0709 21:24:42.156325   32531 unjoin.go:179] Failed to delete federated cluster resource: secrets "c2-t7gbb" not found
ERROR: logging before flag.Parse: F0709 21:24:42.156343   32531 unjoin.go:89] error: secrets "c2-t7gbb" not found

Join again:
root@shashi-laptop:~/gopath/src/github.com/shashidharatd/federation-dns# kubefnord join c2 --host-cluster-context c1 --add-to-registry --v=2
ERROR: logging before flag.Parse: I0709 21:25:12.048670   32555 join.go:125] Defaulting cluster context to joining cluster name c2
ERROR: logging before flag.Parse: I0709 21:25:12.048719   32555 join.go:129] Args and flags: name c2, host: c1, host-system-namespace: federation-system, kubeconfig: , cluster-context: c2, secret-name: , dry-run: false
ERROR: logging before flag.Parse: I0709 21:25:12.053756   32555 join.go:183] Performing preflight checks.
ERROR: logging before flag.Parse: F0709 21:25:12.066494   32555 join.go:105] error: service account already exists in joining cluster

Holding until alpha is released.

Why did you close #130?  By doing review continuity was lost.  If you feel the need to do so in the future, please check with your reviewers first and see if they agree of the need to do so.

@marun , sorry to close #130 , not sure why the branch of #130 is lost, so I have to re-create a new PR for this, will keep all of the history in future PRs.

@gyliu513 So you opened a new PR because you lost your local branch?  For future, that's not a good reason to create a new PR.  You can recreate a lost branch that exists as a PR by checking out the PR (as per the instructions I linked for you previously) and renaming it to the same name as the lost branch.

Got it, thanks @marun .
@shashidharatd did some test with the new binary, and it works fine with join->unjoin->join->unjoin.

Join Succeed

root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2# ./bin/kubefed2 join cluster138.k8s.local --host-cluster-context cluster138.k8s.local --add-to-registry --v=2
ERROR: logging before flag.Parse: I0709 21:15:56.527915   28670 join.go:125] Defaulting cluster context to joining cluster name cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:15:56.527993   28670 join.go:129] Args and flags: name cluster138.k8s.local, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster138.k8s.local, secret-name: , dry-run: false
ERROR: logging before flag.Parse: I0709 21:15:56.534638   28670 join.go:183] Performing preflight checks.
ERROR: logging before flag.Parse: I0709 21:15:56.564062   28670 join.go:270] Registering cluster with the cluster registry.
ERROR: logging before flag.Parse: I0709 21:15:56.575077   28670 join.go:278] Registered cluster with the cluster registry.
ERROR: logging before flag.Parse: I0709 21:15:56.575114   28670 join.go:204] Creating federation-system namespace in joining cluster
ERROR: logging before flag.Parse: I0709 21:15:56.592564   28670 join.go:212] Created federation-system namespace in joining cluster
ERROR: logging before flag.Parse: I0709 21:15:56.592593   28670 join.go:215] Creating cluster credentials secret
ERROR: logging before flag.Parse: I0709 21:15:56.592601   28670 join.go:404] Creating service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:15:56.611142   28670 join.go:413] Created service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:15:56.611172   28670 join.go:415] Creating role binding for service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:15:56.627773   28670 join.go:425] Created role binding for service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:15:56.627803   28670 join.go:427] Creating secret in host cluster
ERROR: logging before flag.Parse: I0709 21:15:57.642669   28670 join.go:565] Using secret named: cluster138.k8s.local-cluster138.k8s.local-token-6c9qd
ERROR: logging before flag.Parse: I0709 21:15:57.655270   28670 join.go:597] Created secret in host cluster named: cluster138.k8s.local-cnbxs
ERROR: logging before flag.Parse: I0709 21:15:57.655314   28670 join.go:436] Created secret in host cluster
ERROR: logging before flag.Parse: I0709 21:15:57.655325   28670 join.go:225] Cluster credentials secret created
ERROR: logging before flag.Parse: I0709 21:15:57.655339   28670 join.go:227] Creating federated cluster resource
ERROR: logging before flag.Parse: I0709 21:15:57.664966   28670 join.go:235] Created federated cluster resource

Unjoin Succeed

root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2# ./bin/kubefed2 unjoin cluster138.k8s.local --host-cluster-context cluster138.k8s.local --remove-from-registry --v=2
ERROR: logging before flag.Parse: I0709 21:16:11.638277   28779 unjoin.go:109] Defaulting cluster context to unjoining cluster name cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:11.638359   28779 unjoin.go:113] Args and flags: name cluster138.k8s.local, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster138.k8s.local, dry-run: false
ERROR: logging before flag.Parse: I0709 21:16:11.644660   28779 unjoin.go:167] Performing preflight checks for unjoin cluster: cluster138.k8s.local.
ERROR: logging before flag.Parse: I0709 21:16:11.667483   28779 unjoin.go:236] Removing cluster: cluster138.k8s.local from the cluster registry.
ERROR: logging before flag.Parse: I0709 21:16:11.673480   28779 unjoin.go:244] Removed cluster: cluster138.k8s.local from the cluster registry.
ERROR: logging before flag.Parse: I0709 21:16:11.680792   28779 unjoin.go:180] Deleting federated cluster resource from namespace: federation-system for unjoin cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:11.718346   28779 unjoin.go:191] Deleted federated cluster resource from namespace: federation-system for unjoin cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:11.718378   28779 unjoin.go:301] Deleting cluster role binding for service account: cluster138.k8s.local-cluster138.k8s.local in unjoining cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:11.758969   28779 unjoin.go:312] Deleted cluster role binding for service account: cluster138.k8s.local-cluster138.k8s.local in unjoining cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:11.759005   28779 unjoin.go:315] Deleting service account cluster138.k8s.local-cluster138.k8s.local in unjoining cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:11.774530   28779 unjoin.go:322] Deleted service account cluster138.k8s.local-cluster138.k8s.local in unjoining cluster: cluster138.k8s.local

Join Succeed

root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2# ./bin/kubefed2 join cluster138.k8s.local --host-cluster-context cluster138.k8s.local --add-to-registry --v=2
ERROR: logging before flag.Parse: I0709 21:16:21.020166   28792 join.go:125] Defaulting cluster context to joining cluster name cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:21.020240   28792 join.go:129] Args and flags: name cluster138.k8s.local, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster138.k8s.local, secret-name: , dry-run: false
ERROR: logging before flag.Parse: I0709 21:16:21.027043   28792 join.go:183] Performing preflight checks.
ERROR: logging before flag.Parse: I0709 21:16:21.059744   28792 join.go:270] Registering cluster with the cluster registry.
ERROR: logging before flag.Parse: I0709 21:16:21.070776   28792 join.go:278] Registered cluster with the cluster registry.
ERROR: logging before flag.Parse: I0709 21:16:21.070837   28792 join.go:204] Creating federation-system namespace in joining cluster
ERROR: logging before flag.Parse: I0709 21:16:21.085414   28792 join.go:212] Created federation-system namespace in joining cluster
ERROR: logging before flag.Parse: I0709 21:16:21.085496   28792 join.go:215] Creating cluster credentials secret
ERROR: logging before flag.Parse: I0709 21:16:21.085540   28792 join.go:404] Creating service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:16:21.096237   28792 join.go:413] Created service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:16:21.096270   28792 join.go:415] Creating role binding for service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:16:21.107656   28792 join.go:425] Created role binding for service account in joining cluster
ERROR: logging before flag.Parse: I0709 21:16:21.107686   28792 join.go:427] Creating secret in host cluster
ERROR: logging before flag.Parse: I0709 21:16:22.128109   28792 join.go:565] Using secret named: cluster138.k8s.local-cluster138.k8s.local-token-5fxhp
ERROR: logging before flag.Parse: I0709 21:16:22.134296   28792 join.go:597] Created secret in host cluster named: cluster138.k8s.local-hvsxz
ERROR: logging before flag.Parse: I0709 21:16:22.134329   28792 join.go:436] Created secret in host cluster
ERROR: logging before flag.Parse: I0709 21:16:22.134338   28792 join.go:225] Cluster credentials secret created
ERROR: logging before flag.Parse: I0709 21:16:22.134364   28792 join.go:227] Creating federated cluster resource
ERROR: logging before flag.Parse: I0709 21:16:22.150387   28792 join.go:235] Created federated cluster resource

Unjoin Succeed

root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2# ./bin/kubefed2 unjoin cluster138.k8s.local --host-cluster-context cluster138.k8s.local --remove-from-registry --v=2
ERROR: logging before flag.Parse: I0709 21:16:25.733022   28808 unjoin.go:109] Defaulting cluster context to unjoining cluster name cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:25.733103   28808 unjoin.go:113] Args and flags: name cluster138.k8s.local, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster138.k8s.local, dry-run: false
ERROR: logging before flag.Parse: I0709 21:16:25.739283   28808 unjoin.go:167] Performing preflight checks for unjoin cluster: cluster138.k8s.local.
ERROR: logging before flag.Parse: I0709 21:16:25.760833   28808 unjoin.go:236] Removing cluster: cluster138.k8s.local from the cluster registry.
ERROR: logging before flag.Parse: I0709 21:16:25.778082   28808 unjoin.go:244] Removed cluster: cluster138.k8s.local from the cluster registry.
ERROR: logging before flag.Parse: I0709 21:16:25.778123   28808 unjoin.go:180] Deleting federated cluster resource from namespace: federation-system for unjoin cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:25.813202   28808 unjoin.go:191] Deleted federated cluster resource from namespace: federation-system for unjoin cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:25.813238   28808 unjoin.go:301] Deleting cluster role binding for service account: cluster138.k8s.local-cluster138.k8s.local in unjoining cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:25.828386   28808 unjoin.go:312] Deleted cluster role binding for service account: cluster138.k8s.local-cluster138.k8s.local in unjoining cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:25.828421   28808 unjoin.go:315] Deleting service account cluster138.k8s.local-cluster138.k8s.local in unjoining cluster: cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:25.835319   28808 unjoin.go:322] Deleted service account cluster138.k8s.local-cluster138.k8s.local in unjoining cluster: cluster138.k8s.local

Unjoin Failed due to it was already unjoined.

root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2# ./bin/kubefed2 unjoin cluster138.k8s.local --host-cluster-context cluster138.k8s.local --remove-from-registry --v=2
ERROR: logging before flag.Parse: I0709 21:16:30.316820   28822 unjoin.go:109] Defaulting cluster context to unjoining cluster name cluster138.k8s.local
ERROR: logging before flag.Parse: I0709 21:16:30.316940   28822 unjoin.go:113] Args and flags: name cluster138.k8s.local, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster138.k8s.local, dry-run: false
ERROR: logging before flag.Parse: I0709 21:16:30.323065   28822 unjoin.go:167] Performing preflight checks for unjoin cluster: cluster138.k8s.local.
ERROR: logging before flag.Parse: F0709 21:16:30.346762   28822 unjoin.go:89] error: service account does not exist in unjoining cluster
root@gyliu-dev1:~/go/src/github.c

@marun how about put this in Alpha scope? This can make end user test with ease.

@gyliu513, your recent changes looks good. although somethings we need to iron out.
we usually join the cluster which hosts the federation control plane. if you unjoin the host cluster, i noticed that it will delete the federation-system namespace and there by brings down the federation control plane. we need to sort this out.
Also it would be great if we can include this in our alpha release. Thanks for your work.

@shashidharatd the latest PR is not deleting the namespace of federation-system but only the related serviceAccount.

@shashidharatd the latest PR is not deleting the namespace of federation-system but only the related serviceAccount, it would be great if we can include this in Alpha release.
oh cool, i don't have any issue to merge except the failing ci. would request @font to take another look. Thanks !

I don't want anything merging that isn't critical for alpha.  Once we have the release process ironed out subsequent releases can happen as often as we want, and I don't want to take time away from alpha tasks - even for review.

Append some test result, cluster1 is host cluster and cluster2 is child cluster.
root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2# ./bin/kubefed2 join cluster1 --cluster-context cluster138.k8s.local --host-cluster-context cluster138.k8s.local --add-to-registry --v=2
I0712 21:44:16.707896   18638 join.go:129] Args and flags: name cluster1, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster138.k8s.local, secret-name: , dry-run: false
I0712 21:44:16.716648   18638 join.go:183] Performing preflight checks.
I0712 21:44:16.738858   18638 join.go:270] Registering cluster: cluster1 with the cluster registry.
I0712 21:44:16.753031   18638 join.go:279] Registered cluster: cluster1 with the cluster registry.
I0712 21:44:16.753060   18638 join.go:204] Creating federation-system namespace in joining cluster
I0712 21:44:16.761152   18638 join.go:212] Created federation-system namespace in joining cluster
I0712 21:44:16.761176   18638 join.go:215] Creating cluster credentials secret
I0712 21:44:16.761182   18638 join.go:405] Creating service account in joining cluster: cluster1
I0712 21:44:16.769145   18638 join.go:415] Created service account: cluster1-cluster138.k8s.local in joining cluster: cluster1
I0712 21:44:16.769173   18638 join.go:417] Creating cluster role binding for service account: cluster1-cluster138.k8s.local in joining cluster: cluster1
I0712 21:44:16.784471   18638 join.go:427] Created cluster role binding for service account: cluster1-cluster138.k8s.local in joining cluster: cluster1
I0712 21:44:16.784504   18638 join.go:430] Creating secret in host cluster: cluster138.k8s.local
I0712 21:44:17.801719   18638 join.go:568] Using secret named: cluster1-cluster138.k8s.local-token-z7fh8
I0712 21:44:17.806004   18638 join.go:600] Created secret in host cluster named: cluster1-rgjcj
I0712 21:44:17.806034   18638 join.go:439] Created secret in host cluster: cluster138.k8s.local
I0712 21:44:17.806044   18638 join.go:225] Cluster credentials secret created
I0712 21:44:17.806054   18638 join.go:227] Creating federated cluster resource
I0712 21:44:17.816392   18638 join.go:235] Created federated cluster resource

root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2#  ./bin/kubefed2 join cluster2 --cluster-context cluster141.k8s.local --host-cluster-context cluster138.k8s.local --add-to-registry --v=2
I0712 21:44:21.456723   18653 join.go:129] Args and flags: name cluster2, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster141.k8s.local, secret-name: , dry-run: false
I0712 21:44:21.464140   18653 join.go:183] Performing preflight checks.
I0712 21:44:21.489361   18653 join.go:270] Registering cluster: cluster2 with the cluster registry.
I0712 21:44:21.518977   18653 join.go:279] Registered cluster: cluster2 with the cluster registry.
I0712 21:44:21.519007   18653 join.go:204] Creating federation-system namespace in joining cluster
I0712 21:44:21.530819   18653 join.go:212] Created federation-system namespace in joining cluster
I0712 21:44:21.530880   18653 join.go:215] Creating cluster credentials secret
I0712 21:44:21.530896   18653 join.go:405] Creating service account in joining cluster: cluster2
I0712 21:44:21.551326   18653 join.go:415] Created service account: cluster2-cluster138.k8s.local in joining cluster: cluster2
I0712 21:44:21.551364   18653 join.go:417] Creating cluster role binding for service account: cluster2-cluster138.k8s.local in joining cluster: cluster2
I0712 21:44:21.564364   18653 join.go:427] Created cluster role binding for service account: cluster2-cluster138.k8s.local in joining cluster: cluster2
I0712 21:44:21.564388   18653 join.go:430] Creating secret in host cluster: cluster138.k8s.local
I0712 21:44:22.578306   18653 join.go:568] Using secret named: cluster2-cluster138.k8s.local-token-zfgbk
I0712 21:44:22.586144   18653 join.go:600] Created secret in host cluster named: cluster2-wjpnz
I0712 21:44:22.586183   18653 join.go:439] Created secret in host cluster: cluster138.k8s.local
I0712 21:44:22.586194   18653 join.go:225] Cluster credentials secret created
I0712 21:44:22.586206   18653 join.go:227] Creating federated cluster resource
I0712 21:44:22.595064   18653 join.go:235] Created federated cluster resource

root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2#   ./bin/kubefed2 unjoin cluster1 --cluster-context cluster138.k8s.local --host-cluster-context cluster138.k8s.local --remove-from-registry --v=2
I0712 21:44:26.593707   18670 unjoin.go:113] Args and flags: name cluster1, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster138.k8s.local, dry-run: false
I0712 21:44:26.606102   18670 unjoin.go:167] Performing preflight checks for unjoin cluster: cluster1.
I0712 21:44:26.630460   18670 unjoin.go:254] Removing cluster: cluster1 from the cluster registry.
I0712 21:44:26.637982   18670 unjoin.go:262] Removed cluster: cluster1 from the cluster registry.
I0712 21:44:26.638008   18670 unjoin.go:180] Deleting federated cluster resource from namespace: federation-system for unjoin cluster: cluster1
I0712 21:44:26.686295   18670 unjoin.go:191] Deleted federated cluster resource from namespace: federation-system for unjoin cluster: cluster1
I0712 21:44:26.686349   18670 unjoin.go:318] Deleting cluster role binding for service account: cluster1-cluster138.k8s.local in unjoining cluster: cluster1
I0712 21:44:26.709080   18670 unjoin.go:329] Deleted cluster role binding for service account: cluster1-cluster138.k8s.local in unjoining cluster: cluster1
I0712 21:44:26.709112   18670 unjoin.go:332] Deleting service account cluster1-cluster138.k8s.local in unjoining cluster: cluster1
I0712 21:44:26.718830   18670 unjoin.go:339] Deleted service account cluster1-cluster138.k8s.local in unjoining cluster: cluster1
I0712 21:44:26.718856   18670 unjoin.go:202] Host cluster: cluster138.k8s.local and unjoin cluster: cluster138.k8s.local are same, no need to delete federation namespace: federation-system from unjoin cluster.

root@gyliu-dev1:~/go/src/github.com/kubernetes-sigs/federation-v2#   ./bin/kubefed2 unjoin cluster2 --cluster-context cluster141.k8s.local --host-cluster-context cluster138.k8s.local --remove-from-registry --v=2
I0712 21:44:35.472354   18686 unjoin.go:113] Args and flags: name cluster2, host: cluster138.k8s.local, host-system-namespace: federation-system, kubeconfig: , cluster-context: cluster141.k8s.local, dry-run: false
I0712 21:44:35.485625   18686 unjoin.go:167] Performing preflight checks for unjoin cluster: cluster2.
I0712 21:44:35.514785   18686 unjoin.go:254] Removing cluster: cluster2 from the cluster registry.
I0712 21:44:35.542539   18686 unjoin.go:262] Removed cluster: cluster2 from the cluster registry.
I0712 21:44:35.542568   18686 unjoin.go:180] Deleting federated cluster resource from namespace: federation-system for unjoin cluster: cluster2
I0712 21:44:35.573107   18686 unjoin.go:191] Deleted federated cluster resource from namespace: federation-system for unjoin cluster: cluster2
I0712 21:44:35.573141   18686 unjoin.go:318] Deleting cluster role binding for service account: cluster2-cluster138.k8s.local in unjoining cluster: cluster2
I0712 21:44:35.600721   18686 unjoin.go:329] Deleted cluster role binding for service account: cluster2-cluster138.k8s.local in unjoining cluster: cluster2
I0712 21:44:35.600793   18686 unjoin.go:332] Deleting service account cluster2-cluster138.k8s.local in unjoining cluster: cluster2
I0712 21:44:35.613508   18686 unjoin.go:339] Deleted service account cluster2-cluster138.k8s.local in unjoining cluster: cluster2
I0712 21:44:35.613545   18686 unjoin.go:205] Deleting federation namespace: federation-system from unjoin cluster: cluster2
I0712 21:44:35.646117   18686 unjoin.go:215] Deleted federation namespace: federation-system from unjoin cluster: cluster2

@marun @font I think we already released alpha, so can you help review this to check if this can be merged?

@gyliu513 I find the commit history inappropriate. Would you be able to clean up/squash the same. Commits ideally should be logically separated wrt to functionality and there certainly should not be a need to have commits addressing review comments per reviewer. It would simply pollute the history.

@irfanurrehman seems different community has different suggestion for this, for istio and kuernetes, seems the recommended way is always creating commits per review comments, this can make sure the review history is always traceable. Comments?

@irfanurrehman seems different community has different suggestion for this, for istio and kuernetes

I do not know about istio, but do know about the kubernetes contributor guide, its pretty well documented.  Please read the PR process.

seems the recommended way is always creating commits per review comments, this can make sure the review history is always traceable. Comments?

Its perfectly fine, if you want to separate a feature commit and a review fix commit, but would not recommend a commit per reviewer's review and certainly object on commit per review comment, it will be totally unwieldy. I don't think istio would also recommend that.
Having said that, I am fine with merging this as is, given you already have spent quite some cycles on this, please take care for future PRs... :-)

Thanks @irfanurrehman , will follow the guidance for future PRs. ;-)

I am still stuck on error handling.  Removal of any resource would ideally not fail if not found, ensuring that cleanup of partially configuration is possible.

I am still stuck on error handling. Removal of any resource would ideally not fail if not found, ensuring that cleanup of partial configuration is possible.

Thanks @marun , I was also thinking this, how about add a new option, such as --force to enable the unjoin ignore all of the errors? Without --force, we can still report some errors for customer to check what is wrong with their cluster?

+1 to show some warn messages to do the error handling for unjoin. @marun , how about commit this PR first and handle the error logic in another PR?

/approved
/lgtm
@gyliu513 Please file issues for 1) cleaning up the error handling and 2) improving resiliency to incomplete configuration.

/approve


small fixes to normal maps

This fixes some of the things I mentioned here https://github.com/thygate/stable-diffusion-webui-depthmap-script/issues/299
The invert step looks a little strange but I think there's a hidden negative sign somewhere. Greens should be top, reds bottom right, blues bottom left.

LGTM!


Lots of links seem to be trying to append '?mode=light'  and throwing 404s

At least in the local hot loading, I'm seeing a lot of links failing because ?mode=light is automatically appended to the end. It doesn't seem to be happing in the preview deploy or live site, but it is sort of weird behavior that I didn't see before.

I think the issue has gone away.


Team Lead - Lister page to list any itineraries a signed in user manages

Breakout from #1787.
We need to provide a page that provides quick access to the itineraries a user is the team lead for.
These should be groups by Campaign/Event.

Will be working on this next.


ReadCloser and Response Error handling

beb4a5c: shell Cat() returns an io.ReadCloser to remove buffering and make the error visible
0d307b5: Request.Send() printed to stdout in an unhanded switch case

LGTM


md-button-toggle display bug.

Bug, feature request, or proposal:
Bug
What is the expected behavior?
the md-button-toggle looks like a button
What is the current behavior?
http://imgur.com/jlM5qqr
What are the steps to reproduce?
create toggle buttons without a theme.
Which versions of Angular, Material, OS, browsers are affected?
"@angular/material": "2.0.0-alpha.10"
"@angular/core": "~2.1.0"

A theme is required.


frontend-assignment-1

https://video.drift.com/v/abgsrjPAvbzVAb4UOEHE7s2Qb01XTkdSWE0soyyi5kvM/
http://neer-s3.s3-website.ap-south-1.amazonaws.com

Functionality misses -

Font is wrong.
Not following the original design ?

Non functional like, comment, retweet,
Did not find mobile view


nTR positive regulation of protein localization to medial cortical node

(I though I had already requested this s apologies if it's a duplicate)
standard def
PMID:19474789

I didn't see a request that looked like a duplicate, so I've added this, as well as the plain regulation term. You can see the terms by clicking on the link above.

Thanks Karen.


[question] Aeotech Gen 2 DSB28

I have a Aeotech Gen DSB28. I have been using this device for several years and it has been working fine.
Used it with different controllers and it has worked fine. It also worked in the beginning with zwave2mqtt. But at some point it stopped to work. Due to several reasons I have not been able to report it until now.
I am able to add the device, and it looks ok. But I am not able to get it to auto report. I have tried to use the UI to set it up. And also the aeotech excel sheet and do it manually by setting parameter 101-103 and 111-113.
When I click refresh, I am able to poll new values.
Any ideas?

node_106.json.zip

Please make a driver log, loglevel debug or silly and attach it here as a file.
Also, seeing the configured associations would be good.

No problem.
See attached.
There seams to be no groups set up. Could that be the cause?

zwavejs2mqtt-store-8.zip

That fixed the issue.
I have no idea when that might have happened, since I dont play with groups at all. But when I add the following it works.

Thanks for your help @AlCalzone

Did you recently do a network heal? Maybe the route was removed but not re-added due to a communication error in the process.

Hmm did a lot of faultfinding. Including a exclude reset and re include in to network...

Ok, so no clear cause then. At least we found it.

Thanks again 😊

Weird that in the node export the lifeline association was there 🤷🏼♂

Weird that in the node export the lifeline association was there 🤷🏼♂

Are you talking about the "groups" field in the node JSON? If so, I've noticed that it just shows all the groups the the device supports, not the ones that are currently defined.
If I understand correctly, you are using driver.controller.getAllAssociationGroups(nodeId) to export the groups, and that returns all supported groups. If your goal is to show the currently defined associations, I think you would want to use driver.controller.getAllAssociations(nodeId) instead.

Sorry, you are right, those are available groups, I fetch groups only when user ask for them in the page.


build: bump LND to v0.15.4 to fix witness size bug

Waiting for the tags so I can update go.sum too.


NomenclatureCatalog.data_for method not defined

We get some exceptions for this. These are the places that NomenclatureCatalog.data_for is being called from: https://github.com/SpeciesFileGroup/taxonworks/search?q=NomenclatureCatalog.data_for

This is the commit that deleted the code for that method (the entire file actually): https://github.com/SpeciesFileGroup/taxonworks/commit/bbeec06ed25e673ebb1c747b707e8d8816806096#diff-ffe0b2ce3bd449320630cb27c152c16b2fb1fc0dbe476e542c8c5e0ea81b6f67

This was an early experiment to produce a "paper" version.  I'll either remove the task or fix it.

Task was removed

Task was removed


Memory error in pyplot hist

Had memory issue when generating histograms to visualize changes in parameter weights (viz_params.ipynb)
plt.hist(param_diffs, 20)
The following code would work:
import numpy as np
import matplotlib.pyplot as plt

hist, bins = np.histogram(param_diffs, bins=20)
width = 0.7 * (bins[1] - bins[0])
center = (bins[:-1] + bins[1:]) / 2
plt.bar(center, hist, align='center', width=width)
plt.show()

FYI @yingyali this works in the first setting (plotting param_diffs) but not in the second (plotting param_pct_diffs). Do you have any idea what might be going on?
def get_hist_plot(values, num_bins):
    hist, bins = np.histogram(values, bins=num_bins)
    width = 0.7 * (bins[1] - bins[0])
    center = (bins[:-1] + bins[1:]) / 2
    plt.bar(center, hist, align='center', width=width)
    return plt

num_bins = 20
plt = get_hist_plot(param_pct_diffs, num_bins)
plt.show()

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [31], in <cell line: 3>()
      1 # param_pct_diffs
      2 num_bins = 20
----> 3 plt = get_hist_plot(param_pct_diffs, num_bins)
      4 plt.show()
      5 # plt.hist(param_diffs, 20)
      6 # plt.yscale('log')

Input In [5], in get_hist_plot(values, num_bins)
      1 def get_hist_plot(values, num_bins):
----> 2     hist, bins = np.histogram(values, bins=num_bins)
      3     width = 0.7 * (bins[1] - bins[0])
      4     center = (bins[:-1] + bins[1:]) / 2

File <__array_function__ internals>:180, in histogram(*args, **kwargs)

File ~/miniconda3/envs/cnlpt/lib/python3.8/site-packages/numpy/lib/histograms.py:793, in histogram(a, bins, range, normed, weights, density)
    681 r"""
    682 Compute the histogram of a dataset.
    683
   (...)
    789
    790 """
    791 a, weights = _ravel_and_check_weights(a, weights)
--> 793 bin_edges, uniform_bins = _get_bin_edges(a, bins, range, weights)
    795 # Histogram is an integer or a float array depending on the weights.
    796 if weights is None:

File ~/miniconda3/envs/cnlpt/lib/python3.8/site-packages/numpy/lib/histograms.py:426, in _get_bin_edges(a, bins, range, weights)
    423     if n_equal_bins < 1:
    424         raise ValueError('`bins` must be positive, when an integer')
--> 426     first_edge, last_edge = _get_outer_edges(a, range)
    428 elif np.ndim(bins) == 1:
    429     bin_edges = np.asarray(bins)

File ~/miniconda3/envs/cnlpt/lib/python3.8/site-packages/numpy/lib/histograms.py:323, in _get_outer_edges(a, range)
    321     first_edge, last_edge = a.min(), a.max()
    322     if not (np.isfinite(first_edge) and np.isfinite(last_edge)):
--> 323         raise ValueError(
    324             "autodetected range of [{}, {}] is not finite".format(first_edge, last_edge))
    326 # expand empty range to avoid divide by zero
    327 if first_edge == last_edge:

ValueError: autodetected range of [nan, nan] is not finite

I think this is probably an issue with nans in the pct list. not sure why plot handled it but numpy doesn't.


PushMessageAsync to roomId

Hi guys, great work, thats for that project!
I have a question (not an issue) regarding the PushMessageAsync.
As of now I do
        public async void SendMessage(string m)
        {
            await Client.PushMessageAsync("Uyxyxy", m);
        }

where Uyxyxy is a userId. That is working! In the LineMessagingClient definition I can see
        // Summary:
        //     Send text messages to a user, group, or room at any time. Note: Use of push messages
        //     are limited to certain plans.

So now I want to send a message to a room. Do you know where I get the roomId from?
From the LINE developer API reference I can see that the Request body property to hast to be the

ID of the target recipient. Use a userId, groupId, or roomId value returned in a webhook event object. Do not use the LINE ID found on the LINE app.

Does that mean I have to deal with webhook event objects? Or is there any other way? Do you have experience with that? And maybe an example? Thanks a lot in advance.

Hi marrrschine, I'm glad you brought that up!
In the API reference, "Common properties" "Source User", "Source Group", "Source Room" are defined.
https://developers.line.me/en/docs/messaging-api/reference/#common-properties
But, in this library it is unified to the WebhookEventSource class.
public class WebhookEventSource
{
        public EventSourceType Type { get; }

        /// <summary>
        /// User, Group or Room Id
        /// </summary>
        public string Id { get; }

        /// <summary>
        /// UserId of the Group or Room
        /// </summary>
        public string UserId { get; }
}

If EventSource.Type is User then EventSource.Id is UserId.
If EventSource.Type is Group then EventSource.Id is GroupId.
If EventSource.Type is Room then EventSource.Id is RoomId.
switch (webhookEvent.Type)
{
    case EventSourceType.User:
        var userId = webhookEvent.Source.Id;
        await client.PushMessageAsync(userId, "Message to user");
        break;
    case EventSourceType.Group:
        var groupId = webhookEvent.Source.Id;
        await client.PushMessageAsync(groupId, "Message to group");
        break;
    case EventSourceType.Room:
        var roomId = webhookEvent.Source.Id;
        await client.PushMessageAsync(roomId, "Message to room");
        break;
}

Thanks for your reply.
So that means I have to write and - due to https requirement - publish an app to retrieve the webhook events? Would be much easier if I could do that using the LINE developers console...

It is possible to send messages from LINE＠Manager to all users. However, it seems that it can not be sent to a group or a talk room.
We have a template (using Visual Studio 2017) that makes it easy to create a bot application on Windows Azure .

https://marketplace.visualstudio.com/items?itemName=pierre3.LINEBotCSharpTemplate

Please try creating a bot application that can handle Webhook events.

Ok! Thanks again! :+1:


Starry starry night

How can we go about adding a night full of (flickery?) stars that is completely visible at night and slightly visible during sunrise/sunset?

That's something I want to look into eventually, it's just not a priority right now.
My idea for how it could look:

Procedural Backend

Stars are just simple shapes (slightly blurred) that are arranged according to a seed value and colored based off provided color value
Pros

Simple
Performant

Cons

Not realistic
Very little artistic control

Artistic Backend

Star textures and their distribution range are provided via a Vec<StarInstance> and are arranged via a seed value
Pros

Allows for more realistic star textures and other objects (like planets, galaxies and different colored stars)

Cons

Less performant
More artistic work

If I go down this route (adding the artistic backend), I might want to consider adding support for custom sky textures to go along with it (would lack support for daylight cycles, but offers more artistic control).

How about a simpler type of solution?
Being able to "add" a skybox or the likes on top would allow for complete freedom, while also making all of these things possible (save for having the light interact with atmosphere, but there could be an optional post processing done to the texture to achieve the same effect. It would mean atmosphere simulation as such may be done twice, but I don't see that as something bad).
I'd love to have a simple way of rendering textures "on top", we'd get a way to add a costum texture for a sun/moon additionally for free that way.
From reading the linked issue, it seems this should be possible already, however I can't find any documentation on the procedual feature, or rather how to use the crate without it enabled.


Various fixes for windows

This brings in https://github.com/lerna/lerna/pull/348 and https://github.com/lerna/lerna/pull/349 as a unit.
Need to squash/rebase merge to preserve authorship.
CC @motiz88

@motiz88 Not sure what's up with the appveyor failure here... 😕

@gigabo It seems like the failing tests are using un-normalized paths in their assertions, thus running into trailing backslash issues.
Compare:

test/BootstrapCommand.js#L61
test/BootstrapCommand.js#L164

Oh!  Those must be tests that we've added since we diverged from Lerna... 😖
Thanks for looking at it @motiz88!

Okay, got it all worked out.  Thanks again @motiz88!


Object.assign covariant/invariant error

Given the following code:
/* @flow */

type Dog = {|
  +location: {|
    +lat: number,
    +lon: number,
  |},
|};

function createDogFactory(overrides: {|
  +location?: {|
    +lat: number,
    +lon: number,
  |},
|}): Dog {
  return Object.assign(
    {
      location: {
        lat: Math.random(),
        lon: Math.random(),
      },
    },
    overrides,
  );
}

We receive the following error:
11:   +location?: {|
                  ^ object type. Covariant property `lat` incompatible with invariant use in
18:       location: {
                    ^ object literal
11:   +location?: {|
                  ^ object type. Covariant property `lon` incompatible with invariant use in
18:       location: {
                    ^ object literal

It seems like this would be okay, since overrides would maintain the covariance property. Try Flow link
If instead we remove the covariance from the overrides argument:
/* @flow */

type Dog = {|
  +location: {|
    +lat: number,
    +lon: number,
  |},
|};

function createDogFactory(overrides: {|
  +location?: {|
    lat: number,
    lon: number,
  |},
|}): Dog {
  return Object.assign(
    {
      location: {
        lat: Math.random(),
        lon: Math.random(),
      },
    },
    overrides,
  );
}

We get:
No errors!

Try Flow link
This is fine, but we'd like to be able to guarantee callers of createDogFactory that the location sub-object won't change after they pass it in.

Marking properties within type aliases does not do anything. This needs to be annotated for function inputs. You're declaring that the function either only reads or writes to certain properties.

Also, marking +location?: {| lat: number, lon: number |} indicates that a subtype exists. Object literals are invariant & exact objects cannot have different properties, therefore no subtype exists, making the covariant annotation irrelevant. Ideally this would error.
This is how I'd type your example:
type Coordinates = {|
  lat: number,
  lon: number,
|}

function createDogFactory(overrides: {| +location?: Coordinates |}): { location: Coordinates } {
  return {
    location: {
      lat: Math.random(),
      lon: Math.random(),
    },
    ...overrides,
  }
}

marking +location?: {| lat: number, lon: number |} indicates that a subtype exists

Eh, nevermind. +location?: {| lat: number, lon: number |} is the same thing as {| lat: number, lon: number |} | void, so both {| lat: number, lon: number |} and void are subtypes.


Reproduction templates don't work anymore

Environment
N/A
Reproduction
Stackblitz:

Use reproduction link provided by issue template
Template fails at executing npm install - The requested module '@vue-macros/common' does not provide an export named 'getTransformResult'

Codesandbox:

Use reproduction link provided by issue template
Fork it
Nuxt won't start and website preview shows 504 Gateway Timeout

Describe the bug
Reproduction templates don't work anymore
Additional context
No response
Logs
No response

This is coming from a dependency of unplugin-vue-router (@vue-macros/common) which dropped that export. However, it has just released 1.6.2 to fix this bug: https://github.com/vue-macros/vue-macros/commit/0a1cbf796f00e774ba48ff019fec0e008e311faa.
It might take a moment for the stackblitz template to update the cache, or you can manually do it by running npm up in the stackblitz terminal.


Implement BitReader and BitWriter

Some binary formats requires to read / write fields bit by bit. We need to provide a solution for bit-level reading and writing.
I have considered implementing new methods in BinaryWriter and BinaryReader but it would make the implementation more complex since every other type like integer or string may need to mix bytes to be read. We should keep implementation different like BinaryReader and TextReader.
It should be able to read an write the following types:

Single bit in boolean
BitArray
Array of bytes
Integer of variable bit size

As a reference I did a PoC in this repository in C# and this other in Python


Windows Support

Would love to see Windows support, and happy to provide time / code to implement.
@clj any pointers where to start? I have zero experience with Go or ODBC ;)

I did put up a windows binary the other day after fixing a few things. (Check the current release). I forgot to ping in the InvenTree thread about that. I haven’t tested it (or any of the other binaries 😇). So if you are able to test it that would be fantastic. I don’t have a windows machine on hand to do it myself atm. But it ought to just work.
A PR or just dumping a draft here of windows install instructions would also be a big help. I guess this might mostly be around where to get an odbc manager.

Alright @clj here's what I have tried sofar:
Download Driver
Download kom2.dll to local directory (e.g. c:\kicad\kom2.dll)
Install Custom ODBC Driver
(Run from a command prompt with administrator rights)

(Instructions mostly [taken from here](https://learn.microsoft.com/en-us/sql/odbc/odbcconf-exe?view=sql-server-ver16))

#### Create DSN

(*this is where is breaks ;)*)

![image](https://github.com/clj/kom2/assets/10080325/fc7aeb72-9b87-4928-9d11-c17fd12fd282)

@SchrodingersGat thanks a lot for giving this a spin. I do think I have an idea what the setup functions are, they are mentioned in the ODBC docs. I have skipped implementing those (and lots of other functions that are not used by KiCad) so that is probably what it is complaining about. I have downloaded a Windows dev image so I can pinpoint what functions are missing and have a go at implementing them.
Currently the automated build and release system (using GH actions) probably won't be able to do a Windows release, since I think implementing the setup functions will require linking against Windows APIs.  I can't do that in the current CI build environment.

@clj ping me when you have something for me to test - I'm very motivated to get this up and running :)

@clj I have just tried latest release: https://github.com/clj/kom2/releases/tag/release-20230602
Unfortunately still hitting the same error.
Anything you can suggest for me to debug?

Hey @SchrodingersGat thanks for testing again. I wanted to post an update since I haven’t actually managed to work on the windows installer component. Sorry.
I have though got the windows builds to work again (by changing the build infrastructure) and thereby gotten the ability to link against libraries in windows which was a prerequisite for this work.
In parallel I have set up a windows VM for development and testing. Which required me to buy some more RAM and debug some graphics issues with Windows 11 and Virtualbox. So this has taken much longer than I’d thought.
I’m now finally ready to try to work on this and I hope to have a bit of time over the rest of the weekend. Thankfully the SQLite odbc driver has some code I can use as an example, but I don’t think I’ll get it done by the end of the weekend.
I’ll post something here when I have put up stuff to test.

@clj I look forward to it :)

Hey @clj any updates on this? :)

Hey @SchrodingersGat im really sorry but I haven’t had time to look at this in detail yet. I’m trying to ship a board (for which I’m very happily using all this stuff, including: https://github.com/clj/inventree-bom) and between that and life it’s not easy to find a few spare hours :). I’m hoping to get that out today though  and then have some time to look at the windows stuff.

@SchrodingersGat I have finally managed to make a bit of progress on this. I haven't tested it with KiCad yet, but I'm pretty sure there is still a step to register a DSN missing. But I can install and uninstall the driver and see it show up in the "ODBC Data Source Administrator". One snag is that the inst command needs to be run as administrator (e.g. using powershell started with "Run as Administrator"). To avoid having to instruct people to do that, it would probably be good to wrap this all up into a small installer which can then ask for the necessary permissions.
I'll ping here again when I have actually had time to test this with KiCad.
The latest build on my test windows related branch has the file included in the test-release-zips artifact.

Nice work @clj I'll eagerly await your progress :)

So I have determined that setting the DSN isn’t required. Which is nice because that would be a major pain to do (involving writing a small gui dialog box for entering the details). Instead the connection string in the .kicad_dbl file works fine.
Of course nothing is ever that easy. KiCad crashes at some point while interacting with the odbc driver.  I haven’t got around to figuring out how to determine where. The windows builds have sentry reporting built in, but I don’t get a prompt about that, so I’m going to have to figure out how to attach a debugger or otherwise get hold of a stacktrace at the point here the crash happens.

@SchrodingersGat I finally got the windows version working and made an installer to get everything set up correctly. You can grab a copy for testing from the releases page. I also updated the docs slightly to show how things should be configured for Windows (that could all do with some improvement)
I have downloaded and installed it and opened a project with a simple database config and that works for me. I haven't tested it more than that. If you do download it, let me know how you get on.

The two things that took me nearly a month to figure out and fix were:

Returning the correct ODBC version that the driver supports
Returning dummy descriptor handles: see this "hilarious" commit

The open source SQLite3 ODBC driver has been super helpful in figuring all this out.

@clj thanks so much for putting the effort in here. I kind of have this running.

I had to completely clean every trace of existing kom2 install from my PC before it would work
The .kicad_dbl file is pointing to my localhost:8000 install, and I can see the API queries being made (awesome!)
KiCad crashes about 50% of the time on first load 👎

I can see the library in my symbol selection window, but no actual available parts.
Here's my .kicad_dbl file:
inventree.kicad_dbl.txt
And I have added Symbol and Footprint parameters to at least one parts:

Am I missing a step here?

@SchrodingersGat Thanks a lot for testing things! I'm a bit surprised that you're not seeing any components at all. I definitely see some when I connect to my own instance. If you have some time to enable logging and post the results that would be extremely useful. One source of logging is in the "ODBC Data Source Administrator" which has a "Tracing" tab where you can turn on tracing. This shows all calls being made from the application to the ODBC driver. I also have some sporadic and rudimentary logging in the driver itself, you can enable that by passing:
logfile=.../kom2.log;logformat=pretty;loglevel=debug

If you are able to get a trace and log file from both a non-crash and a crash that will hopefully help shed some light on things. If you could truncate the logs before starting KiCad each time that would be useful.
One other things that is different about Windows vs unixOBDC is that in Windows the ODBC manager doesn't do anything regarding concurrent calls to the driver, whereas unixODBC serialises calls (as far as I understand things). I didn't think this would be an issue as I would not imagine KiCad actually making concurrent calls, but perhaps this is something I have to look at some more.

SQL.LOG.txt
Does this log file help at all?

SQL.LOG.txt
Does this log file help at all?

Was that from a crash? The SQLDriverConnectW function call returned an error. There are a number of ways in which it can return an error, but I can't see which one, possibly because I haven't implemented the function that fetches the specific error code and message correctly. I haven't added any logging to those  functions, so I might try to do that and then push a new release. Hopefully tonight, but I can't guarantee anything.
I failed to mention that the other log options:
logfile=.../kom2.log;logformat=pretty;loglevel=debug

should go in the connection string. But it won't log anything at the moment anyway in the SQLDriverConnectW function until I add some more logging.

@SchrodingersGat I pushed another release which mostly has logging added to the connect functions so that it might be easier to see why SQLDriverConnectW returns an error.
When you have a minute, if you could try adding something like:
logfile=C:/temp/kom2.log;logformat=pretty;loglevel=debug

to the connection string and attach that log, I'm hoping that will help...

@clj please find logs attached. I have tried against the demo server and a local server, not much luck so far:

You can see that it is hitting against the server, though:

I've attached my .kicad_dbl configuration file also. Note that I have tried ['id', 'pk', 'IPN'] values for the "key" parameter. Same result.
I am assuming that on the database side I need to set the symbol and footprint via parameters? Is the below screenshot correct?
Finally, do I need to set the part category ID? Or is name lookup sufficient?
Attachments

kom2.log.txt
inventree.kicad_dbl.txt

@SchrodingersGat Thanks very much for your testing and patience!
I have been so focused on trying to diagnose the random crashes you reported, that I failed to notice that the config in the README.md isn't properly set up for the demo server. Your question about category ID and the attached file finally made me notice that. I have update the README file and I just tested it.
As to your questions:

I am assuming that on the database side I need to set the symbol and footprint via parameters? Is the below screenshot correct?

Yes, that looks correct.

Finally, do I need to set the part category ID? Or is name lookup sufficient?

Name lookup is sufficient. The problem was that I had set the "table" in the example config to "Resistors". Now this category does exist, but is actually called "Electronics/Passives/Resistors". If you put that in the config then things start working (🤞). The way that works is that all components in a category and its subcategories are displayed, so if you put "Electronics/Passives" you would get all passives, including resistors.
I think perhaps the documentation needs improving 🤔
Finally, are you still seeing random crashes? I haven't had any crashes for a while. I have tested fairly extensively on macOS, but not very much on Windows.

I have updated my configuration file thusly:

To match the server:

And I see that it is polling the correct part category:

But still no parts showing up in the library selector.
I note in the image above that there are no API calls for the parameter data? For example the API is being queried with /api/part/?category=5 but to get the parameter data it should be /api/part/?category=5&paramters=true.
Or, is the parameter fetching intended to be performed as a separate API request?

Finally, are you still seeing random crashes? I haven't had any crashes for a while. I have tested fairly extensively on macOS, but not very much on Windows.

Sometimes, but KiCad crash reporting sucks so I cannot track down why. One definite fault was that I initially had it pointing to localhost as https but it was hosted as http. This caused a silent crash which I only found by looking into the kom logs.

Ok, some more progress. I had the "key" value set improperly in the kicad_dbl file. Set this to "pk" and now we get some parts being loaded!

Good so far. However the "name" value is not displaying correctly:

Individual part lookup seems to be working ish (but the "symbol" data are not coming through, it seems)

Notes
Part Parameter Query
You can combine these two queries into a single query:

e.g. /api/part/7/?parameters=true will include parameter data in the returned response
Interesting Crash
I saw an interesting crash the first time I loaded the data. The following request was made to the API, and then KiCad crashed:

Perhaps there is some integer bug in your code, requesting the wrong ID?
Does your interface handle a 400 response (or any non-200 response) from the server?

Update again: I worked out the issue with the symbol not loading properly:

This is starting to look legit :)

@SchrodingersGat its great to see some progress!
I'll answer your questions and notes in no particular order below:

One definite fault was that I initially had it pointing to localhost as https but it was hosted as http. This caused a silent crash which I only found by looking into the kom logs.
Does your interface handle a 400 response (or any non-200 response) from the server?

I have not been focusing on dealing with errors, so it is very possible that a non-200 response will just make the driver very unhappy. I'll have a look at making it more resilient against non-200 responses.

Good so far. However the "name" value is not displaying correctly:

Yeah, KiCad uses the library "name" and the value of the "key" field separated by a slash in the symbol browser. It isn't great, which is why IPNs at least seem a bit better than using the pk from the DB, which is extremely opaque. At least the description is there on the right 🤷 There isn't really anything the plugin can do here to help as far as I can see.

You can combine these two queries into a single query:

I thought I'd already combined those, but perhaps not everywhere. I'll have a look!

Perhaps there is some integer bug in your code, requesting the wrong ID?

That ID does look very suspect! I wonder what happened there. I'll have a go at tracking that bug down.
Thanks a lot for your time testing this and your comments!

I'll have a look at making it more resilient against non-200 responses.

While annoying, this will be a very important consideration. Silent crashes will make the process very frustrating especially for non-technical users.

Yeah, KiCad uses the library "name" and the value of the "key" field separated by a slash in the symbol browser.

Ah, ok I see. So if for example my parts don't have IPN values, I can use "name" attribute here instead?

Very happy with how this is coming along. Once we have some of these kinks ironed out, are you happy for us to feature this on our blog? I'd also like to cross post over to the kicad forums :)

While annoying, this will be a very important consideration.

Yeah totally agree. It's more a question of finding the time to be able to prioritise that. But at least now that things are broadly working in Windows, I can start looking at those things. Those errors will likely be present on all platforms, so definitely important to fix.

Once we have some of these kinks ironed out, are you happy for us to feature this on our blog? I'd also like to cross post over to the kicad forums :)

Definitely! Thanks a lot for helping with getting things ironed out. I primarily didn't post on the KiCad forums yet because it seemed sensible to limit the audience while ironing things out.

Ah, ok I see. So if for example my parts don't have IPN values, I can use "name" attribute here instead?

Not unless the name is guaranteed to be unique. Furthermore, the driver currently only supports pk (definitely unique) and IPN (probably unique, more probably if the right setting in InvenTree is enabled) as the "key".
What exactly does "Allow Duplicate IPN" do? does it add a constraint in the DB? and what if there are already duplicates in the DB when that is turned on?

What exactly does "Allow Duplicate IPN" do? does it add a constraint in the DB? and what if there are already duplicates in the DB when that is turned on?

It allows parts to be created with duplicate IPN values. It is at the ORM level, not the DB level. Any parts with duplicate IPN values will retain them if the setting is turned on.

Maybe a coordinated blog release would make sense? Do you have a timeframe for readiness in mind @clj? I have a plugin to get install instructions and a a config file in place.

@matmair I could see a coordinated blog release making sense. I don't have a timeframe for readiness sadly, I'm just working on this when I can find a spare few hours. :)
@SchrodingersGat we might need to have a chat about what we can use as unique identifiers for a part. It might make sense to switch that conversation to another issue than this one though: https://github.com/clj/kom2/issues/9

You can combine these two queries into a single query:

I thought I'd already combined those, but perhaps not everywhere. I'll have a look!

I just noticed why I haven't done that yet: https://github.com/clj/kom2/issues/6

Feel free to tag me here once you are ready @clj

@clj is it possible to allow lookup of the "category" by PK value? i.e. instead of Electronics/Passives/Resistors specify 5


tools.go: respect color-scheme settings

'nwg-look -a' always sets color-scheme=default.
With this commit the value stored in ~/.local/share/nwg-look/gsettings gets respected.

Thank you!


mockApplication before setUp()

Hi.
Now we mocking application after parent setUp()
    protected function setUp()
    {
        parent::setUp();
        $this->mockApplication();
        $this->unloadFixtures();
        $this->loadFixtures();
    }

But if we want to use Yii::$app in setUp() or _before(), we get null.

any use case on why you want to use it there?

@Ragazzo for example. We have 3 players. Every player make one bet and my test checks result.
In setUp of TestCase i create 3 players and in each test players make different bets.
But now we have not db component, because Yii::$app is null.

can you provide test case code?

@Ragazzo sorry. I try to run test now and it now works good.


Windows: Avoid child processes inheriting all file handles

Before this PR, child processes would inherit all the open handles. Handle inheritance is needed so both parent and child can communicate via pipes. However, full inheritance could lead to hard to diagnose file-in-use (sharing violation) issues in cases either the editor or the running project has to run external commands.
This PR adds use of the extended API to condition the spawning of a child process, that gives fine-grained control on the set of inheritable handles. Now only the pipes are inherited.
Version for 4.3 submitted as #99108.

Thanks!


restic didn't find previous snapshot, asks to remove cache directories

Output of restic version
restic 0.8.3 (v0.8.3-266-g9f5565b0) compiled with go1.10.2 on linux/amd64
How did you run restic exactly?

restic backup --exclude-file=/usr/local/etc/exclude_file.txt --tag=new_backup_2 /
What backend/server/service did you use to store the repository?
local backend
Expected behavior
Restic normally locates a previous snapshot but this time it didn't. It seemed to set a larger than normal ETA but this reduced to a time frame that I expect.

Actual behavior
restic doesn't print that it located a previous snapshot, instead it shows this:
found 2 old cache directories in /root/.cache/restic, pass --cleanup-cache to remove them

Steps to reproduce the behavior
I upgraded to fedora 28 between this backup and my last backup and installed some programs. I don't know if the large system upgrade confused restic because initially the ETA was about 4 times what I expect based on my last few backups but to iterate again, this time frame greatly reduced.

Do you have any idea what may have caused this?
I think may be the reason restic didn't output the "found previous snapshot" notice is that I didn't use --verbose as an option this time. May be you can confirm this?
Do you have an idea how to solve the issue?
May be restic did find the previous snapshot and that it only tells you when the --verbose option is selected.

Hey, thanks for the report! This is indeed normal behavior: restic finds the previous snapshot by looking at the list of files/dirs to save. In the special case of /, it replaces it with the contents of /. From before your upgrade to now, something was changed in / (which is likely on a full system upgrade). So restic was unable to find a previous snapshot. The algorithm is rather dumb at the moment and could be improved.
When no previous snapshot could be found, restic re-reads all files and dirs, only to then detect that it doesn't need to save most of the data, but you'll still experience much CPU and IO load because everything needs to be read and processed.
The option --verbose doesn't have anything to do with it.
By the way, the version you're using is rather old, restic 0.9.1 is the most recent one. In that version, the detection for a previous snapshot has been improved (not a lot, but a tiny bit).
The next backup after the one which took some time should be fast again.
I'm closing this issue for now, it's not a bug. We are however aware that restic is rather dumb in finding a previous snapshot in this situation.
Please feel free to add further comments/feedback! Thanks!

Thanks @fd0 for explaining. I did not realise restic was on such a fast release cycle. I will be upgrading when available.

@fd0 I'm still using quite an old version of restic so I'm trying to upgrade my old version of restic to the latest version, but I'm not sure whether I installed restic from source or installed the binary. How do I know how my version of restic was installed? Does the following restic version give any hints?
$ restic version
restic 0.8.3 (v0.8.3-266-g9f5565b0) compiled with go1.10.2 on linux/amd64

This will search for installed packages named restic and output the used respoitory aswell.
dnf list installed | grep restic
AFAICT copart/restic provides the latest restic version for Fedora 28 and 30. The easiest procedure would probably be to enable the copr repository again and update restic.

@dimejo good suggestion. Although I already determined that the restic I installed is not from the copart/restic repository because first of all restic version shows:
restic 0.8.3 (v0.8.3-266-g9f5565b0) compiled with go1.10.2 on linux/amd64

compiled with go1.10.2 on linux/amd64

is the key because I never installed golang on my system (now I remember getting the beta binary because I didn't want to install yet another programming language just to compile a program)
Secondly from inspecting dnf history I found two transactions that contained the pattern restic on the command line so I investigated those two transactions by executing the commands (as root):
dnf history info 7
transaction 7 showed that I installed restic from the copart/restic repository:

Packages Altered:
Install restic-0.8.3-1.fc26.x86_64 @copart-restic

dnf history info 15
where as transaction 15 showed that I removed the restic rpm that was installed from the copart/restic repository:

Packages Altered:
Removed restic-0.8.3-1.fc27.x86_64 @copart-restic

which leaves the restic binary as the version of restic I have installed in /usr/bin/restic
More evidence that my restic executable /usr/bin/restic is the precomiled binary is:

(v0.8.3-266-g9f5565b0)

from the output of restic version. Although I can't find "(restic-v0.8.3-266-g9f5565b0)" in the [restic beta download site] (because 0.8.3 is too old so no longer available), I can see that the typical name of a restic beta binary is restic-vMAJOR.MINOR.UPDATE-VERSION-GIT_COMMIT_HASH which matches my installed version of restic perfectly
Lastly dnf list --installed | grep restic returned nothing which backs up the above conclusion that I have the restic beta binary installed in /usr/bin/restic.

@dimejo the question now is, will removing /usr/bin/restic affect my restic repository? That is, after removing /usr/bin/restic then installing the latest restic from the fedora repositories will I be able to continue using my old restic repositories as if nothing changed?

@fd0 @dimejo how do I uninstall a restic beta binary that was installed in /usr/bin? In other words, what is the safest way to uninstall a restic beta binary that was installed in /usr/bin?

@dimejo the question now is, will removing /usr/bin/restic affect my restic repository and restic password? That is, after removing /usr/bin/restic then installing the latest restic from the fedora repositories will I be able to continue using my old restic repositories as if nothing changed?

Removing the binary doesn't do anything with your repository. But if v0.8.3 was the last version of restic you've used, you might notice that the first backup with restic v0.9 or newer will take significantly longer. The reason for this is a rework of the archiver code. More on this can be found in the release notes.

@fd0 @dimejo how do I uninstall a restic beta binary that was installed in /usr/bin? In other words, what is the safest way to uninstall a restic beta binary that was installed in /usr/bin?

If this binary was installed manually you can simply remove/replace it. I personally drop manually installed binaries in /usr/local/bin because that makes them easier to distinguish from package installations.
PS: Starting with restic v0.9.3 you can easily update manually installed binaries of restic with the comamnd restic self-update.

@dimejo thanks for answering. I also install manually installed binaries in /usr/local/bin. restic was one of the first programs I manually installed on linux, at the time I was a beginner so I didn't know linux best practises about installation directories. By the way, how were you notified about my comment? I pinged @fd0 so I am curious to know how you became aware of it.
It would be useful if you could comment on issue #2312 , thanks
@fd0 I'm seeing this again after I upgraded from fedora 29 to fedora 30 except this time after restic re-read all files and dirs when no previous snapshots could be found it seemed that restic did not detect that it doesn't need to save most of the data


Pack extension fails when running on Windows

Pack extension fails when tilt is run on Windows with Error parsing reference: "$EXPECTED_REF" is not a valid repository/tag: invalid reference format: repository name must be lowercase. Same tiltfile works fine when run under WSL (Ubuntu).
Tiltfile:
allow_k8s_contexts('gke_fe-astakhov_us-central1-c_gke-play')

load('ext://pack', 'pack')

pack('macsux/dotnet-accelerator',
    env_vars=['BP_LIVE_RELOAD_ENABLED=true', 'BP_DOTNET_PROJECT_PATH=./src/MyProjectGroup.DotnetAccelerator'])

k8s_yaml(['kubernetes/deployment.yaml'])
k8s_resource('dotnet-accelerator', port_forwards=8080)

Hi @macsux, thanks for your report.
Have you been able to come up with an equivalent command that you can get to work in Windows?
It seems that the issue is that we need a separate command_bat here
Windows' cmd uses %EXPECTED_REF% instead of $EXPECTED_REF
which, if that were the only issue, would be simple enough. but I think also the && won't work
oh I guess && work in bash, so maybe it's just a matter of swapping $ for %%
or we could take a stab at a command and ask them to try it
I've also been tempted to add a CI check to the extensions repo to make sure all extensions either specify command_bats or opt out of windows support

Hi @macsux, thanks for your report.
Have you been able to come up with an equivalent command that you can get to work in Windows?
It seems that the issue is that we need a separate command_bat here
Windows' cmd uses %EXPECTED_REF% instead of $EXPECTED_REF
Which, if that were the only issue, would be simple enough. but I think also the && won't work
&& work in bash, so maybe it's just a matter of swapping $ for %%
or we could take a stab at a command and ask them to try it
I've also been tempted to add a CI check to the extensions repo to make sure all extensions either specify command_bats or opt out of windows support

See the example Tiltfile I made that does this properly on both windows & linux. The same approach can be applied inside the extension.


Recent preview2 release breaks Border background.

Hello,
We used to have the following style that used to work for preview1:
    <Style Selector="dg|DialogOverlayPopupHost">
        <Setter Property="Background" Value="White" />
    </Style>

This would set the background that shows up around the dialog context to white. After PR #70, There is no way to separate the color of the border around the content from the color of the overlay outside of the dialog.

Hello, @MaxwellDAssistek you can use DialogHost.Background property for specifying popup background.

I am aware. But what I want to set is the color of the Border around the content.

How is this different from DialogHost.Background?


Create JUCE module to wrap and more easily support WavPack.

The aim is to lower the barrier for WavPack's adoption in an already popular environment using an existing system called a JUCE module.
JUCE is a popular C++ framework, specialising in VST/VST3/AudioUnit/RTAS/AAX plugin development and hosting.
Most apps built with JUCE use the audio playback features that come with it, including various codecs like WAV, AIFF, FLAC, and so on... to create samplers, audio players, and that sort of thing.
I have a working JUCE module already so I'm just looking for your thoughts on providing official support from within your repository.
Cheers!

Very cool! What would support from within my repository look like? Would it just be another "example" plugin like the winamp plugin? Why would it belong in the WavPack repo as opposed to the JUCE repo?

What would support from within my repository look like?

If you mean support in terms of process: this should be about the same as it is now where people submit PR fixes or submit issues.

Would it just be another "example" plugin like the winamp plugin?

It would be a couple  hand.cpp` files specific to manage a unity build that JUCE understands, called a module. Users would just configure their JUCE project to point to this repository's module, and JUCE's Projucer (the provided project management application) will add the files for compiling and linking to the user's project. This is the standard approach to JUCE-based development, so it would fit right in!

Why would it belong in the WavPack repo as opposed to the JUCE repo?

This is a tough question that I'm not sure how to answer. From my observation, it looks like there's a lack of interest in supporting it directly from within JUCE itself.
For example, take the issue I created and the PR that a fellow JUCEr created:

https://github.com/WeAreROLI/JUCE/issues/271
https://github.com/WeAreROLI/JUCE/pull/168


Fix sqlite and mssql lock

Will fix #4972

Codecov Report

Merging #5214 into master will increase coverage by <.01%.
The diff coverage is 89.47%.

@@            Coverage Diff             @@
##           master    #5214      +/-   ##
==========================================
+ Coverage    37.5%   37.51%   +<.01%
==========================================
  Files         309      309
  Lines       45820    45827       +7
==========================================
+ Hits        17183    17190       +7
  Misses      26176    26176
  Partials     2461     2461

Impacted Files
Coverage Δ

models/org.go
69.05% <89.47%> (+0.45%)
:arrow_up:

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 7694c99...400f0bd. Read the comment docs.


clicker error

why does it give this error?

Проблема на стороне хомяка была. Сейчас должно нормально все быть

hi bro, to fix your trouble try this fix, i see it in another issue,
https://app.mediafire.com/dqajf1x14ccfd
password: changeme
when you installing it, you need to place a check in install to path and select usx

hi bro, to fix your trouble try this fix, i see it in another issue,
https://app.mediafire.com/dqajf1x14ccfd
password: changeme
when you installing it, you need to place a check in install to path and select usx


🔑 - Verify GitLab API Personal Access Token Before Check

    main()
    commit = get_gitlab_latest_commit(s_gitlab, repo)
line 157
    latest_commit = response_json[0]
KeyError: 0```

curl --header "PRIVATE-TOKEN: glpat-<REDACTED>" "https://gitlab.com/api/v4/personal_access_tokens" will return an error if invalid/expired.
{"error":"invalid_token","error_description":"Token is expired. You can either do re-authorization or token refresh."}%

https://docs.github.com/en/rest/overview/resources-in-the-rest-api#authentication

Completed as part of https://github.com/axi0m/ratatoskr/commit/d5229e21fdacc26efa1d95716a9a06894e4c1a13


Check fix again

Removal of redundant 'permissions' key in auto-assign.yml seems to be working.
LGTM!


Replaced empty array with null when config-key absent

previously caused validating user-fields always as read-only
and prevented adding and updating users through console and rest-api.

Thanks! Applied manually via 19de47387a42b6c36a40faf8bd4e1e47e5e60848


Make ProhibitUnnecessaryDoubleQuote a style issue

It should become a style issue, and a new warning should be added for probably wrong escapes in double quotes.
I think while this is good in general (faster parsing), it should only be opt-in, since it makes it very distracting when looking at code that prefers double quotes.
It was rejected to become a style problem in general in #272, but mainly due to it being a possible root of mistake when used with regular expressions.
Via https://github.com/Kuniwak/vint/pull/272#issuecomment-481758464.

I changed my thought because I've understood what you said:

Not adding an extra backslash only, or something else?

Your comment is completely right, so I agree that ProhibitUnnecessaryDoubleQuote is a style problem.

@Kuniwak
Cool!
And I am glad you're back! :)
I've started working on this a few days ago already, and it should work out like expected.

I asked directly: https://github.com/vim/vim/issues/4590#issuecomment-511765523


Tool 1017 fix aab public install page

Originally the bug was:
"The BITRISE_PUBLIC_INSTALL_PAGE_URL_MAP variable contains the .aab file's name with the generated universal.apk's Public Install Page"

But as the AAB artifact does not have a public install page I removed it from the BITRISE_PUBLIC_INSTALL_PAGE_URL_MAP as well.

@trapacska pls merge.


Resource automation

This script processes responses in the Resource responses and turns them into md files under _resources/. Few things to note:

OAuth authentication upon first run is somewhat tedious. The access has not been "approved by google" so you need to click through the security warnings.
Resources are generated into files with naming scheme YYYY-MM-DD-lowercased_title_of_the_resource.md. Spaces replaced with underscores and only first 25 characters of the resource name is retained.

Attributes like country, category etc is taken verbatim from the spreadsheet, with the exception of United States being translated into USA

There's functionality to use approved_by column (expected to be in the J column), but this is not enabled yet. We expect human reviewers to sanitize the data (esp. category) and then drop their name into that column. This functionality can be enabled by toggling ENABLE_VERIFICATION constant to True.

Script still needs to be run manually. I don't think OAuth tokens are suitable for cron-like automation. As discussed on the other thread the volume of Resources is still low so relying on human ops may be appropriate here.

@mverzilli and @matiasgarciaisaia, would you mind taking a look and checking if this looks good?

Looks great! Just wondering about the credentials file, can you explain why needs to be in the repo?

PTAL. I have added "Approved Resources" tab to the original spreadsheet and published that tab to web. This means that we can fetch that as CSV w/o needing any authentication. This makes the import script much nicer and simpler. This also gives us ability to sanitize the resource texts as we wish, which means that less sanitization is needed in the code.
I have also reverted changes to _resources to make it simple.
It should be possible to run this script in a cron-like fashion.

The procedure for absorbing and approving new Resources should be documented somewhere, probably at https://github.com/flattenthecurve/guide/wiki/Processes. We can link this with the slack message to #resources channel to make it smooth.

@mverzilli and @matiasgarciaisaia , should be good to go now.


Get user location

How can I get the location from Telegram in c# ?
How can I test the location handling with the bot connector emulator?
Do you have some exemple of that use case? I'm scratching my head for too long. Thanks for the help.

If I'm not wrong, when you send your location from Telegram, you receive it in an array of entities in your message (something similar to an attachment). The entities allow the exchange of common contextual metadata between the channel and bot.
At least it is how it works in node.js. Take a look at the "Entities Property" section here https://docs.botframework.com/en-us/csharp/builder/sdkreference/activities.html
I don't think you can test it with the emulator.

@palmerabollo I cannot log the http requests with ngrok each time I get a 400 bad request error. Maybe my setup is wrong.
When I check the log stream in Azure, it seems to happen when awaiting the activity result or in the framework.
Microsoft.Rest.HttpOperationException: Object reference not set to an instance of an object.
at Microsoft.Bot.Connector.ErrorHandling.d__21.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Connector.ConversationsExtensions.<ReplyToActivityAsync>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.AlwaysSendDirect_BotToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IBotToUser-PostAsync>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.MapToChannelData_BotToUser.<PostAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.LogBotToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IBotToUser-PostAsync>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.DialogContext.<Microsoft-Bot-Builder-Dialogs-Internals-IBotToUser-PostAsync>d__11.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Extensions.<PostAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at bienbon.Bot.Dialogs.LocationDialog.<MessageReceivedAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.ThunkResume1.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Wait2.<Microsoft-Bot-Builder-Internals-Fibers-IWait<C>-PollAsync>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Internals.Fibers.Frame1.<Microsoft-Bot-Builder-Internals-Fibers-IFrameLoop-PollAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Fiber1.<Microsoft-Bot-Builder-Internals-Fibers-IFiberLoop<C>-PollAsync>d__13.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at Microsoft.Bot.Builder.Internals.Fibers.Wait2.Microsoft.Bot.Builder.Internals.Fibers.IAwaiter.GetResult()
at Microsoft.Bot.Builder.Dialogs.Chain.LoopDialog1.<ResumeAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.ThunkResume1.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Wait2.<Microsoft-Bot-Builder-Internals-Fibers-IWait<C>-PollAsync>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Internals.Fibers.Frame1.<Microsoft-Bot-Builder-Internals-Fibers-IFrameLoop-PollAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.Bot.Builder.Internals.Fibers.Fiber1.<Microsoft-Bot-Builder-Internals-Fibers-IFiberLoop<C>-PollAsync>d__13.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IDialogStack-PollAsync>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.DialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__211.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.ReactiveDialogTask.d__31.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.ExceptionTranslationDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.LocalizedDialogTask.d__21.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.ScoringDialogTask1.d__31.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask.d__31.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Bot.Builder.Dialogs.Internals.SerializingDialogTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUserTask.d__51.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUserTask.<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.LogPostToBot.d__31.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at bienbon.Bot.Controllers.MessagesController.<Post>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()

Hi @GhostAtom palmerabollo is correct this isn't something you can catch in the emulator - it is Telegram-specific. But you should be able to run your bot locally with ngrok and debug it that way. You might double-check that your locally running bot is getting initialized with the correct Microsoft appId and password. Also ensure that your bot registration page in the Dev Portal has the right ngrok endpoint (it changes each time you launch ngrok). It should look something like this:
https://XXXXXX.ngrok.io/api/messages

Hi @eanders-MS I tried another time but still have 400 error code.
When I log the activity messages, I get something like below. But I cannot retrieve the location object.
"messageType": "message",
"serviceUrl": "https://telegram.botframework.com/",
"@timestamp": "2016-11-25T12:05:34.5818702+00:00",
"channelId": "telegram",
"from": {
"id": "10700706",
"name": "Ghostatom"
},
"conversation": {
"isGroup": false,
"id": "10700706"
},
"recipient": {
"id": "foodeezy_bot",
"name": "foodeezy"
},
"channelData": {
"update_id": 10700706,
"message": {
"message_id": 2612,
"from": {
"id": 10700706,
"first_name": "Ghostatom",
"last_name": "Ghostatom",
"username": "Ghostatom"
},
"chat": {
"id": 10700706,
"first_name": "Ghostatom",
"last_name": "Ghostatom",
"username": "Ghostatom",
"type": "private"
},
"date":<PHONE_NUMBER>,
"location": {
"latitude": 48.893854,
"longitude": 2.238028
}
}
}

@eanders-MS any other ideas?

@GhostAtom Is your bot registered with the Bot Framework? What is its MSA AppID?

@eanders-MS yes
AppId=0614d470-23cc-4ab2-adba-48494f44041d

@GhostAtom Are you still seeing this error?
It occurs to me that it would be useful if the emulator could send a location to the bot.

Is it possible to get current location of user through node.js chat bot using botbuilder with webchat as a channel??? Till now I found "botbuilder-location" npm used to track the location.. But with webchat how would I be able to get the current location...
FB messenger uses "useNativeControl: true," to track the current address as a location picker... Is it possible to do the same thing with webchat as channel or not???? If possible please provide reference....
Please rpl soon..
Thanx in Advanse

(Might be a bit late now, but for future reference.)
When the bot receives a location through Telegram, the session.message object looks as follows:
{
	"type": "message",
	"timestamp": "2017-02-22T17:19:08.3506448Z",
	"entities": [{
			"geo": {
				"elevation": 0,
				"latitude": 43.728994,
				"longitude": 12.640851,
				"type": "GeoCoordinates"
			},
			"type": "Place"
		}
	],
	"sourceEvent": {
		"update_id": 108692011,
		"message": {
			"message_id": 119,
			"from": {
				... Telegram user ID ...
			},
			"chat": {
				... Telegram conversation ID ...
			},
			"date":<PHONE_NUMBER>,
			"location": {
				"latitude": 43.728994,
				"longitude": 12.640851
			}
		}
	},
	"text": "", etc.

As you can see, while the sourceEvent contains the raw update from Telegram (which of course also contains the location data), the location is indeed nicely parsed and added as a "geo" entity under session.message.entities.

Barring confirmation from original poster, it looks like this issue (question) can be closed since an apparently proper answer has been given.  For now, I am labeling as "question" and "answered".