SimpleDemo Execution Exception

Version of Akka.NET? Which Akka.NET Modules? clone Akka.Hosting and executed Build.cmd
A clear and concise description of what the bug is.

[INFO][1/3/2023 5:31:47 AM][Thread 0001][remoting (akka://MyActorSystem)] Starting remoting
[INFO][1/3/2023 5:31:47 AM][Thread 0001][remoting (akka://MyActorSystem)] Remoting started; listening on addresses : [akka.tcp://MyActorSystem@localhost:8110]
[INFO][1/3/2023 5:31:47 AM][Thread 0001][remoting (akka://MyActorSystem)] Remoting now listens on addresses: [akka.tcp://MyActorSystem@localhost:8110]
[INFO][1/3/2023 5:31:47 AM][Thread 0001][Cluster (akka://MyActorSystem)] Cluster Node [akka.tcp://MyActorSystem@localhost:8110] - Starting up...
[INFO][1/3/2023 5:31:47 AM][Thread 0001][Cluster (akka://MyActorSystem)] Cluster Node [akka.tcp://MyActorSystem@localhost:8110] - Started up successfully
[INFO][1/3/2023 5:31:47 AM][Thread 0005][Cluster (akka://MyActorSystem)] Cluster Node [0.4.0] - Node [akka.tcp://MyActorSystem@localhost:8110] is JOINING itself (with roles [], version [0.4.0]) and forming a new cluster
[INFO][1/3/2023 5:31:47 AM][Thread 0005][Cluster (akka://MyActorSystem)] Cluster Node [akka.tcp://MyActorSystem@localhost:8110] - is the new leader among reachable nodes (more leaders may exist)
[INFO][1/3/2023 5:31:47 AM][Thread 0005][Cluster (akka://MyActorSystem)] Cluster Node [akka.tcp://MyActorSystem@localhost:8110] - Leader is moving node [akka.tcp://MyActorSystem@localhost:8110] to [Up]
[INFO][1/3/2023 5:31:47 AM][Thread 0015][akka.tcp://MyActorSystem@localhost:8110/system/sharding/myRegion] myRegion: Idle entities will be passivated after [00:02:00]
[INFO][1/3/2023 5:31:48 AM][Thread 0013][akka.tcp://MyActorSystem@localhost:8110/system/sharding/myRegionCoordinator] Singleton manager started singleton actor [akka://MyActorSystem/system/sharding/myRegionCoordinator/singleton]
[INFO][1/3/2023 5:31:48 AM][Thread 0013][akka.tcp://MyActorSystem@localhost:8110/system/sharding/myRegionCoordinator] ClusterSingletonManager state change [Start -> Oldest] Akka.Cluster.Tools.Singleton.Uninitialized
[INFO][1/3/2023 5:31:48 AM][Thread 0003][akka.tcp://MyActorSystem@localhost:8110/system/sharding/myRegionCoordinator/singleton/coordinator] Sharding Coordinator was moved to the active state Akka.Cluster.Sharding.PersistentShardCoordinator+State
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:61877
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:61878
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: G:\git\Akka.Hosting\src\Examples\Akka.Hosting.SimpleDemo\
[ERROR][1/3/2023 5:31:49 AM][Thread 0013][akka://MyActorSystem/system/sharding/myRegion/3/0HMND9F7KSI93%3A00000001] Error while creating actor instance of type Akka.Hosting.SimpleDemo.EchoActor with 0 args: ()
Cause: [akka://MyActorSystem/system/sharding/myRegion/3/0HMND9F7KSI93%3A00000001#345915985]: Akka.Actor.ActorInitializationException: Exception during creation
 ---> System.TypeLoadException: Error while creating actor instance of type Akka.Hosting.SimpleDemo.EchoActor with 0 args: ()
 ---> System.InvalidOperationException: Cannot resolve scoped service 'Akka.Hosting.SimpleDemo.IReplyGenerator' from root provider.
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteValidator.ValidateResolution(Type serviceType, IServiceScope scope, IServiceScope rootScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
   at Akka.DependencyInjection.ServiceProviderActorProducer.Produce()
   at Akka.Actor.Props.NewActor()
   --- End of inner exception stack trace ---
   at Akka.Actor.Props.NewActor()
   at Akka.Actor.ActorCell.CreateNewActorInstance()
   at Akka.Actor.ActorCell.<>c__DisplayClass116_0.<NewActor>b__0()
   at Akka.Actor.ActorCell.UseThreadContext(Action action)
   at Akka.Actor.ActorCell.NewActor()
   at Akka.Actor.ActorCell.Create(Exception failure)
   --- End of inner exception stack trace ---
   at Akka.Actor.ActorCell.Create(Exception failure)
   at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)
[INFO][1/3/2023 5:31:49 AM][Thread 0003][akka://MyActorSystem/system/sharding/myRegion/3/0HMND9F7KSI93%3A00000001] Message [String] from [akka://MyActorSystem/temp/g] to [akka://MyActorSystem/system/sharding/myRegion/3/0HMND9F7KSI93%3A00000001#345915985] was not delivered. [1] dead letters encountered. If this is not an expected behavior then [akka://MyActorSystem/system/sharding/myRegion/3/0HMND9F7KSI93%3A00000001#345915985] may have terminated unexpectedly. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

Steps to reproduce the behavior:
Clone -> Build -> Set Akka.Hosting.SimpleDemo as startup project. -> F5
A clear and concise description of what you expected to happen. -> There should be no exceptions?!
Are you running on Linux? Windows? Docker? Which version of .NET? => Windows 2019, .net 7.101

It seems like the service tries\ to create the actor without parameter entityId and replyGenerator...

Workaround:
Change
return s => resolver.Props<EchoActor>(s);

To
return s => resolver.Props<EchoActor>(new object[] { s, new DefaultReplyGenerator() });

@ingted
I could not reproduce this, are you running the simple demo from the latest dev branch?

are you running the simple demo from the latest dev branch => yes

Can you make sure that you rebuild the solution first? We did a dependency injection update a few weeks ago and that might have broken the sample.

I think so...
Actually you can see
public EchoActor(string entityId, IReplyGenerator replyGenerator)

It take 2 parameters however the invocation only feed 1
return s => resolver.Props<EchoActor>(s);

It is supposed to be like that, actually. IReplyGenerator is supposed to be injected automatically by the dependency injection. We'll investigate further, thank you for the report.

@ingted
I've managed to reproduce your error by commenting the service registration code, the clue is in the exception message:
Unable to resolve service for type 'Akka.Hosting.SimpleDemo.IReplyGenerator' while attempting to activate 'Akka.Hosting.SimpleDemo.EchoActor'

Can you make sure that the line builder.Services.AddScoped<IReplyGenerator, DefaultReplyGenerator>(); exists in your code?

I think so... (didn't change the cloned repo)

https://user-images.githubusercontent.com/4289161/210730288-53f46f36-3b1c-47aa-8356-c51f1d58d6ee.mp4
Hi @Arkatufus ,
I recorded my screen and you can take a look at it...

Hmmm... that is really weird, I'll try and look into it again today. Thanks!

I've tested the following environments in order to reproduce this:

VS2022 ❌
dotnet run -c Release ✔
JetBrains Rider 2022.3 (IIS) ✔
JetBrains Rider 2022.3 (Kestrel / Self-host) ❌

Actually, I'm not sure if this is Kestrel vs. IIS thing in Rider:

Why does the top profile fail but the other succeeds?

This is a bit weird, but when you set "ASPNETCORE_ENVIRONMENT" to "Production", the sample code works just fine.
Here's the content of my launchSettings.json
{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:50409",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Production"
      }
    },
    "Akka.Hosting.SimpleDemo": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Production"
      },
      "applicationUrl": "https://localhost:5001;http://localhost:5000"
    }
  }
}

Got an answer as to why this works sometimes but not others:
https://twitter.com/chton/status/1611051567892905986?s=20&t=-8TUuAd9GD2oZcFmZyxY1w

Wow!!! After reading all your discurrion... Got it now!!! @@a


API docstring does not rendered section titles correctly

The PR https://github.com/Qiskit/qiskit-terra/pull/9698 adds a section to the API docs. In particular, to a method. However, the title of the section does not get proper style:

This problem seems similar to https://github.com/Qiskit/qiskit_sphinx_theme/issues/45 that @karlaspuldaro solved in  https://github.com/Qiskit/qiskit_sphinx_theme/pull/146 . It even has the element that works correctly when applied to sphinx_guide/ .

I just tried reproducing this locally and the headings seem to be highlighted correctly, also checked the latest terra docs and I don't see any instances of the Example headings not rendering properly, so I think we can close this issue.


KOGITO-5535 Jenkins excluded_regions

https://issues.redhat.com/browse/KOGITO-5535
related PRs:

https://github.com/kiegroup/kogito-pipelines/pull/222
https://github.com/kiegroup/kogito-runtimes/pull/1473

The (build) Apps check has failed. Please check the logs.

closed by https://github.com/kiegroup/kogito-pipelines/pull/222/commits/03daf445e6ab359d1c9d663091445c97b000c5c0

@Ginxo I was talking about that method: https://github.com/kiegroup/kogito-runtimes/blob/main/.jenkins/dsl/jobs.groovy#L6-L8
We don't want that in kogito-pipelines as each repo is responsible of the files to ignore on PR checks ...

or we could have default ones in kogito-pipelines like
'LICENSE', '\\.gitignore', '.*\\.md', '.*\\.adoc', '.*\\.txt', '\\.github/.*', 'Jenkinsfile.*', '\\.jenkins/.*'

which are quite common

The (build) Examples check has failed. Please check the logs.

The (build) Examples check has failed. Please check the logs.

The (build) Examples check has failed. Please check the logs.

Errors not related to PR ...


Customizing the trace name

Hi there,
I'm opening this issue to discuss a work I've begun to work on my Remix app.
Here's my starting point, your instrumentation is a great work but it's annoying to have all traces be named like GET *.
After investigating this is due to the underlying Express implementation since the * is the Request.Route and since Remix is working with an app.all("*", createRequestHandler), it's logical that it uses it.
So I've now a work in progress version where for this kind of file structure:
routes
├── __layout
│   └── index.tsx
│   └── another.route.tsx
├── __layout.tsx
├── dashboard
│   ├── index.tsx
│   └── organizations.$name.tsx
├── dashboard.tsx
└── settings.tsx

I can have traces name like:
GET /
GET /another/route
GET /dashboard
GET /dashboard/organizations/$name
GET /settings

I would prefer, for my taste to also be able to have
GET /dashboard/organizations/:name

because I'm using express for other parts of my app so keeping a consistency with Express would be cool.
This could be done with options like so:
new RemixInstrumentation({
  displayExpressRoutes: true
})

Would you be open to a PR with all that?
Should the whole renaming of the trace be optional?
Thanks for your work in any case it's been a great help!

After a night, it also could be possible to just add hooks to the different calls

Hey @Fenntasy! Glad this package has been helpful so far.
This package doesn’t actually instrument the express routes, it only emits remix.request, LOADER $route, and ACTION $route spans. Not the GET $route spans you’re mentioning. You might have to check the express plugin package if those the spans you’re trying to change.
Let me know if that helps. If you ARE trying to change any of the span names from this package I’m happy to discuss possible ways to configure that.

I understand it doesn't intrument the express routes, my goal is to avoid having traces with GET * for every Remix routes since it's not really helping.
Here's what I've done at the moment for my needs (look for START CHANGES):
private _patchCreateRequestHandler(): (
    original: typeof remixRunServerRuntime.createRequestHandler,
  ) => any {
    const tracer = this.tracer;
    return function createRequestHandler(original) {
      return function patchCreateRequestHandler(
        this: any,
      ): remixRunServerRuntime.RequestHandler {
        const [{ routes }] = arguments as unknown as Parameters<
          typeof remixRunServerRuntime.createRequestHandler
        >;
        const originalRequestHandler: remixRunServerRuntime.RequestHandler =
          original.apply(this, arguments as any);

        return (
          request: Request,
          loadContext?: remixRunServerRuntime.AppLoadContext,
        ) => {
          // START CHANGES
          const url = new URL(request.url);
          const matches = matchServerRoutes(createRoutes(routes), url.pathname);
          if (matches && matches.length > 0) {
            const route = matches[matches.length - 1].route;
            const rpcMetadata = getRPCMetadata(opentelemetry.context.active());
            if (rpcMetadata) {
              rpcMetadata.span.updateName(
                `${request.method} ${displayRoute(route.id)}`,
              );
              rpcMetadata.route = displayRoute(route.id);
            }
          }
          // END CHANGES

          const span = tracer.startSpan(
            `remix.request`,
            {
              attributes: {
                [SemanticAttributes.CODE_FUNCTION]: "requestHandler",
              },
            },
            opentelemetry.context.active(),
          );
          addRequestAttributesToSpan(span, request);

          const originalResponsePromise = opentelemetry.context.with(
            opentelemetry.trace.setSpan(opentelemetry.context.active(), span),
            () => originalRequestHandler(request, loadContext),
          );
          return originalResponsePromise
            .then((response) => {
              addResponseAttributesToSpan(span, response);
              return response;
            })
            .catch((error) => {
              addErrorAttributesToSpan(span, error);
              throw error;
            })
            .finally(() => {
              span.end();
            });
        };
      };
    };
  }

with displayRoutes being
const displayRoute = (route: string): string => {
  if (route === "root") {
    return "/";
  }
  return route
    .replace("routes/", "/")
    .replace(/\/__[^\/]*\/?/, "/")
    .replace(".", "/")
    .replace("$", ":");
};

The meat is it is what's also done by the Express intrumentation:
const rpcMetadata = getRPCMetadata(opentelemetry.context.active());
if (rpcMetadata) {
  rpcMetadata.span.updateName(
    `${request.method} ${displayRoute(route.id)}`,
  );
  rpcMetadata.route = displayRoute(route.id);
}

rpcMetadata.span.updateName make the traces be displayed with the route instead of *
rpcMetadata.route is what's used by the HTTP intrumentation for setting the http.route attribute in the main trace.
displayRoute is just there to display the routes as express would but it's not necessary, just that we use express on our side so it's more convient.

Ah, okay, so you want to update the parent active span name from the express instrumentation plugin based on information from remix.
I'm not sure updating another instrumentation's context is advised, as it can rewrite history a bit.. but perhaps there are use cases where it is helpful for organizing your data how you need.
In this case, your code to get / modify the active span is good, but thinking through how to configure this there are a few options:

Use some frameworks-specific updateParentSpanNameForExpress boolean flag, which if set performs all the logic you have. This makes your use cases very simple to enable, but then means we have to add new flags for all upstream frameworks that might be used (koa, webworkers, etc)
Have a updateParentSpanName configuration option that accepts a function which returns a string representing the new parent span name. That function would be passed the request and route information and can format however the client chooses. This is a bit more work for the user, who has to know how to write the function, but easy to document in readme files. It's a more flexible option than (1) since it can support any upstream framework formats (or custom formats for whatever reason).
Have an updateParentSpan configuration option that accepts a function which returns nothing. That function would be passed the parent span, the request, and the route information and the user can use span.updateName in the function to modify. This is more cognitive work for the user to know how to update the name property, but is much more flexible than option (2) because now you could even add attributes to the parent span context.
Introduce a pre (and post?) lifecycle hook that runs the function before processing. This function would receive the request and route, but wouldn't receive the active span. The user would need to use the otel apis to get active span if they want. Much more cognitive load, but much more flexible.

I'm not keen on (1) since I don't like baking in other framework knowledge into the code. I'm open to (2) or (3) as a way to make it framework-agnostic and more flexible, without adding too much work on the client side. Option (4) is probably too much complexity back to the user for right now. Leaning a bit more towards (3) since it's just a line more for the client, but opens up a lot more flexibility down the road if people need.
Only part I'm not sure of is if instead of the span you have to pass the rpcMetadata because it looks like you're updating multiple properties on that object.
What do you think?


[BUG] dns_server: reverse resolution not working for /22 network prefix

This is relevant to the dns_server core role, currently it does not configure certain networks correctly and reverse resolution fails.
Context
When defining a network with the /22 prefix (<IP_ADDRESS> netmask), there can be nodes that are outside the "C-class range" of the network. For example, the <IP_ADDRESS>/22 network can go up to <IP_ADDRESS>, so it is possible to have a node with the <IP_ADDRESS> IP address inside that network.
The issue is that this node is not correctly configured in the dns_server role, namely the reverse resolution fails.
Process

Define this network <IP_ADDRESS>/22 in network.yml:

  ice1-2:
    subnet: <IP_ADDRESS>
    prefix: 22
    netmask: <IP_ADDRESS>
    broadcast: <IP_ADDRESS>
    is_in_dns: true

Assign the interface of a node to <IP_ADDRESS> which is inside this ice1-2 network (login1 in this example).

Run dns_server role, e.g.

ansible-playbook playbooks/managements.yml -t dns_server

Expected result
Both forward and reverse DNS resolutions should work:
[root@management1 bluebanquise]# host login1
login1.tumulus.local has address <IP_ADDRESS>

[root@management1 bluebanquise]# host <IP_ADDRESS>
<IP_ADDRESS>.in-addr.arpa domain name pointer login1-ice1-2.tumulus.local.
<IP_ADDRESS>.in-addr.arpa domain name pointer login1.tumulus.local.

Current result
DNS resolution works, but reverse resolution fails:
[root@management1 bluebanquise]# host login1
login1.smc.local has address <IP_ADDRESS>
[root@management1 bluebanquise]# host <IP_ADDRESS>
Host <IP_ADDRESS>.in-addr.arpa not found: 5(REFUSED)

In fact, the reverse address has not been calculated properly (notice 192.168.100 instead of 192.168.103):
[root@management1 bluebanquise]# host <IP_ADDRESS>
<IP_ADDRESS>.in-addr.arpa domain name pointer login1-ice1-2.tumulus.local.
<IP_ADDRESS>.in-addr.arpa domain name pointer login1.tumulus.local.

Possible Fix
Not a DNS guru by any means, but I saw articles regarding this issue, and the recommendation (or standard practice?) is to "delegate multiple zones of the closest smaller size", e.g.
<IP_ADDRESS>/22 would be 100.168.192.in-addr.arpa, 101.168.192.in-addr.arpa, 102.168.192.in-addr.arpa, 103.168.192.in-addr.arpa. In that scenario, the node would be declared only in the fourth zone.
Maybe a simpler solution (to code in ansible!) exists.
Edit: formatting

Bug confirmed.

Please see my suggest changes in pull request #683.
Test ouput:
wolf0:~ # host <IP_ADDRESS>
<IP_ADDRESS>.in-addr.arpa domain name pointer wolf1-ice1-2.wolf.home.mundayweb.com.
wolf0:~ #
wolf0:~ # host wolf1-ice1-2.wolf.home.mundayweb.com
wolf1-ice1-2.wolf.home.mundayweb.com has address <IP_ADDRESS>

Hello @neilmunday ,
Sorry for the delay. I have just tested this somewhat extensively for the /22 and /16 networks, and everything works.
There are now multiple reverse zones created, e..g. 192.168.100.rr.zone, 192.168.101.rr.zone, 192.168.102.rr.zone, 192.168.103.rr.zone, as needed (only if there are hosts in these ranges).
This looks OK to me, thanks!

@ginomcevoy glad to hear it works for you :-)

I am closing issue now, since it was solved 😊


fix: support the ratio less than 0.01 on TraceIdRatioBasedSampler

Which problem is this PR solving?

Fixes #2013

Short description of the changes

Use parseInt(aPartOfTraceId, 16) value to decide to record.

I revised the points that were review commented.
Any advice to handle TraceId that violates the spec(empty string, not hex, etc)?
The empty string is traced as in current implementations.
And parseInt(notHexString, 16) produces NaN and treated as a zero on XOR.
I don't think it's so good. I also feel it's not appropriate to add detailed validation here.

Any advice to handle TraceId that violates the spec(empty string, not hex, etc)?
The empty string is traced as in current implementations.
And parseInt(notHexString, 16) produces NaN and treated as a zero on XOR.

Please use isValidTraceId which is a part of api


Revert "Delete session without lock"

Reverts vespa-engine/vespa#14619
Changing this code has historically not worked all times, so this is in case something breaks. Please review only

@aressem FYI


[python3] modules linking failure using lld-9

Operating system
Ubuntu 18.04
Compiler
clang9, libc++, lld-9
Steps to reproduce the behavior
`cp x64-linux-clang9-custom.cmake vcpkg/triplets/`
`./vcpkg/bootstrap-vcpkg.sh`
`./vcpkg/vcpkg install python3 --recurse --triplet x64-linux-clang9-custom`

Failure logs
build-x64-linux-clang9-custom-dbg-err.log
build-x64-linux-clang9-custom-rel-err.log
ld.lld-9: error: undefined symbol: PyModuleDef_Init
>>> referenced by _contextvarsmodule.c:65 (/home/stepan/vcpkg_python3/vcpkg/buildtrees/python3/src/v3.10.7-d76da6766d.clean/Modules/_contextvarsmodule.c:65)
>>>               build/temp.linux-x86_64-3.10-pydebug/home/stepan/vcpkg_python3/vcpkg/buildtrees/python3/src/v3.10.7-d76da6766d.clean/Modules/_contextvarsmodule.o:(PyInit__contextvars)

ld.lld-9: error: undefined symbol: PyContext_CopyCurrent
>>> referenced by _contextvarsmodule.c:19 (/home/stepan/vcpkg_python3/vcpkg/buildtrees/python3/src/v3.10.7-d76da6766d.clean/Modules/_contextvarsmodule.c:19)
>>>               build/temp.linux-x86_64-3.10-pydebug/home/stepan/vcpkg_python3/vcpkg/buildtrees/python3/src/v3.10.7-d76da6766d.clean/Modules/_contextvarsmodule.o:(_contextvars_copy_context_impl)

...

Additional context
Custom triplet x64-linux-clang9-custom.cmake.tar.gz

I found that building python built-in modules failed because of static CRT linking. Building is ok with dynamic CRT linking. Is that a valid behavior? Is static CRT not supported by python3 package any more?
set(VCPKG_CRT_LINKAGE dynamic)

Is static CRT not supported by python3 package any more?

It is not well supported by pretty much any package on linux.
Just a guess:  -Wl,--no-export-dynamic in your triplet might cause this issue.

This issue hasn’t been updated in 3 month, if it is still an issue, please reopen this issue.


📝 Docs: Add documentation to Google calendar

Add documentation for Google calendar to show up at https://docs.poozle.dev/extensions/google-calendar similar to https://docs.poozle.dev/extensions/github

Can you please assign this ticket to me as well?
The provided link is not correct. I guess you are referring https://docs.poozle.dev/ticketing/integrations/github

@OzairKhanBro Yeah, you've referred to it correctly. I'm assigning it to you. if you've any questions, feel free to ping us on Slack.

Thanks.


Not server compatible?

crash-2021-07-11_16.15.23-fml.txt

Ah, forgot to test for that beforehand. I'll have it fixed shortly.


Update 01.configmap.md

"configuration" seems more accurate compared to "deployment"

Addressed with #90


IP-435 Pull pgbouncer stats

Why
We want to pull pgbouncer stats so we can create a dashboard in datadog.
What
Add creating  /app/.apt/opt/datadog-agent/agent/conf.d/pgbouncer.yaml so dd-agent can connect to pgbouncer
Jira Ticket

Could you explain why we're doing this, @emre-basala?
We're planning to remove dd-agent so we'll need to find another way...

I guess, I will close this PR then. I will follow  the conversation about deciding dd-agent replacement

will close this PR because we want to keep the buildpack on a specific branch (with_integrations_enabled)
https://github.com/deliveroo/heroku-buildpack-datadog/compare/dyno-hostnames...deliveroo:with_integrations_enabled


http-route with empty service port brakes cilium-controller pods

Is there an existing issue for this?

[X] I have searched the existing issues

What happened?

Creating a http-route and forgetting to type in port for the service

`---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: grafana-ui
namespace: grafana
spec:
parentRefs:

name: internal-shared
namespace: cilium
group: gateway.networking.k8s.io
kind: Gateway
hostnames:
grafana.domain.com
rules:
backendRefs:

group: ''
kind: Service
name: grafana
port:
weight: 1
matches:

path:
type: PathPrefix
value: /`

Cilium operator pods start crashing with error:

level=info msg="Reconciling Gateway" controller=gateway resource=cilium/internal-shared subsys=gateway-controller [controller-runtime] log.SetLogger(...) was never called, logs will not be displayed: goroutine 522 [running]: runtime/debug.Stack() 	/usr/local/go/src/runtime/debug/stack.go:24 +0x65 sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot() 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/log/log.go:59 +0xbd sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithValues(0xc0017c7200, {0xc00072d600, 0x2, 0x2}) 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/log/deleg.go:168 +0x54 github.com/go-logr/logr.Logger.WithValues(...) 	/go/src/github.com/cilium/cilium/vendor/github.com/go-logr/logr/logr.go:323 sigs.k8s.io/controller-runtime/pkg/builder.(*Builder).doController.func1(0xc00072d5e0) 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/builder/controller.go:398 +0x16b sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0007a3720, {0x30932a0, 0xc000660b40}, {0x293d120?, 0xc00072d5c0?}) 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:305 +0x18b sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0007a3720, {0x30932a0, 0xc000660b40}) 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:265 +0x1d9 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2() 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:226 +0x85 created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:222 +0x587
Cilium Version
v1.14.1
Kernel Version
Linux prod-k8s-md-0-p92wd-br5sh 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Kubernetes Version
1.28
Sysdump
cilium-sysdump-20231021-220818.zip
Relevant log output
level=info msg="Reconciling Gateway" controller=gateway resource=cilium/internal-shared subsys=gateway-controller
[controller-runtime] log.SetLogger(...) was never called, logs will not be displayed:
goroutine 522 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x65
sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/log/log.go:59 +0xbd
sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithValues(0xc0017c7200, {0xc00072d600, 0x2, 0x2})
	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/log/deleg.go:168 +0x54
github.com/go-logr/logr.Logger.WithValues(...)
	/go/src/github.com/cilium/cilium/vendor/github.com/go-logr/logr/logr.go:323
sigs.k8s.io/controller-runtime/pkg/builder.(*Builder).doController.func1(0xc00072d5e0)
	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/builder/controller.go:398 +0x16b
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0007a3720, {0x30932a0, 0xc000660b40}, {0x293d120?, 0xc00072d5c0?})
	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:305 +0x18b
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0007a3720, {0x30932a0, 0xc000660b40})
	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:265 +0x1d9
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:226 +0x85
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:222 +0x587

Anything else?
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct

please assign to me.

The log you are citing looks like a red herring, its complaining about a logger missing but not the cause of the crash it seems.  The logger error has since been fixed by #27961 but has not been backpacked (yet). The sysdump show this:
023-10-20T05:59:36.535726976Z level=info msg="Reconciling Gateway" controller=gateway resource=cilium/internal-shared subsys=gateway-controller
2023-10-20T05:59:36.541950542Z panic: runtime error: invalid memory address or nil pointer dereference [recovered]
2023-10-20T05:59:36.543958559Z 	panic: runtime error: invalid memory address or nil pointer dereference
2023-10-20T05:59:36.544036908Z [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x243edfa]
2023-10-20T05:59:36.544100325Z
2023-10-20T05:59:36.544123815Z goroutine 531 [running]:
2023-10-20T05:59:36.544145702Z sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
2023-10-20T05:59:36.544167440Z 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:115 +0x1fa
2023-10-20T05:59:36.544188938Z panic({0x27dea00, 0x48ec370})
2023-10-20T05:59:36.544210372Z 	/usr/local/go/src/runtime/panic.go:884 +0x213
2023-10-20T05:59:36.544231015Z github.com/cilium/cilium/operator/pkg/model.(*BackendPort).GetPort(...)
2023-10-20T05:59:36.544252366Z 	/go/src/github.com/cilium/cilium/operator/pkg/model/model.go:336
2023-10-20T05:59:36.544273101Z github.com/cilium/cilium/operator/pkg/model/translation.getNamespaceNamePortsMap(0xc000bfc7c8)
2023-10-20T05:59:36.555866980Z 	/go/src/github.com/cilium/cilium/operator/pkg/model/translation/translator.go:302 +0x4fa
2023-10-20T05:59:36.555931550Z github.com/cilium/cilium/operator/pkg/model/translation.(*defaultTranslator).getBackendServices(0x3093348?, 0xc000b12ab0?)
2023-10-20T05:59:36.555956204Z 	/go/src/github.com/cilium/cilium/operator/pkg/model/translation/translator.go:96 +0x31
2023-10-20T05:59:36.555978181Z github.com/cilium/cilium/operator/pkg/model/translation.(*defaultTranslator).Translate(0xc001245f78, 0xc0012467c8)
2023-10-20T05:59:36.555999242Z 	/go/src/github.com/cilium/cilium/operator/pkg/model/translation/translator.go:70 +0xad
2023-10-20T05:59:36.556020316Z github.com/cilium/cilium/operator/pkg/model/translation/gateway-api.(*translator).Translate(0xc000bfc6c0, 0xc000bfc7c8)
2023-10-20T05:59:36.556087838Z 	/go/src/github.com/cilium/cilium/operator/pkg/model/translation/gateway-api/translator.go:59 +0x5a7
2023-10-20T05:59:36.556119597Z github.com/cilium/cilium/operator/pkg/gateway-api.(*gatewayReconciler).Reconcile(0xc000322460, {0x3093348, 0xc000b12ab0}, {{{0xc00089f036, 0x6}, {0xc00089f040, 0xf}}})
2023-10-20T05:59:36.556141160Z 	/go/src/github.com/cilium/cilium/operator/pkg/gateway-api/gateway_reconcile.go:122 +0x1630
2023-10-20T05:59:36.556163008Z sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x3093348?, {0x3093348?, 0xc000b12ab0?}, {{{0xc00089f036?, 0x268dfc0?}, {0xc00089f040?, 0x30790b8?}}})
2023-10-20T05:59:36.556183932Z 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:118 +0xc8
2023-10-20T05:59:36.556205493Z sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc00083e960, {0x30932a0, 0xc0003221e0}, {0x293d120?, 0xc0008b1580?})
2023-10-20T05:59:36.556226560Z 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:314 +0x377
2023-10-20T05:59:36.556290619Z sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc00083e960, {0x30932a0, 0xc0003221e0})
2023-10-20T05:59:36.556327777Z 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:265 +0x1d9
2023-10-20T05:59:36.556351141Z sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
2023-10-20T05:59:36.556372136Z 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:226 +0x85
2023-10-20T05:59:36.556392853Z created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
2023-10-20T05:59:36.556413567Z 	/go/src/github.com/cilium/cilium/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:222 +0x587

hi @dylandreimerink , I've submitted the PR for the fix, kindly take a look if you have a chance. Thanks!

oops my bad, didn't realize about your comment @chaunceyjiang. Have you worked on this?

hi @janip81 , turns out that this issue will be solved on the upcoming version of the Cilium (might be on v1.15), that's because the gateway-api project, since v0.8.1 has been enabling CEL for validation so that the default behavior of backendRef which is Service will enforce the presence of a port.

hi @janip81 , turns out that this issue will be solved on the upcoming version of the Cilium (might be on v1.15), that's because the gateway-api project, since v0.8.1 has been enabling CEL for validation so that the default behavior of backendRef which is Service will enforce the presence of a port.

This is ok for me, for myself this is not so much of an issue anymore. Just have implemented checks before i merge PRs that port is configured.

I am closing this issue, feel free to let us know if you think otherwise.


Blocked Gibbs algorithm

So here's a draft I wrote yesterday. There's a few points of discussion:

Conditional density estimation. If it is as easy as it sounds, we would just need to replace conditional cluster masses with mixing weights for the k-th iteration. If so, eval_lpdf() would be the exact same, and it may be worth to move it to the base class. We would only need to override lpdf_from_state(), as well as writing a new proto which also stores weights. This may or may not be the most challenging part, since we use a marginal proto everywhere in the library right now.
~get_weights() could use log and propto bools, just like the conditional cluster masses methods.~ EDIT: I already went and added them
sample_unique_values() should just be the usual good old loop of sample_full_cond(). Should we do it only on nonempty hierarchies? If so, did we need to do the same in marginal algorithms?

Conditional density estimation. If it is as easy as it sounds, we would just need to replace conditional cluster masses with mixing weights for the k-th iteration. If so, eval_lpdf() would be the exact same, and it may be worth to move it to the base class. We would only need to override lpdf_from_state(),

sounds about right

as well as writing a new proto which also stores weights. This may or may not be the most challenging part, since we use a marginal proto everywhere in the library right now.

Yeah that's right.. I was wondering that maybe we don't need to change the proto after all. The ConditionalState is just as the MarginalState, just that the Mixing stores some extra information (namely the weights), while in the Marginal algorithms the weights are 'marginalized' out and we work on cluster cardinalities.
So you could just rename MarginalState into AlgorithmState or something like that and stuff should work right away right?

sample_unique_values() should just be the usual good old loop of sample_full_cond(). Should we do it only on nonempty hierarchies? If so, did we need to do the same in marginal algorithms?

I commented this in the code

Yeah that's right.. I was wondering that maybe we don't need to change the proto after all. The ConditionalState is just as the MarginalState, just that the Mixing stores some extra information (namely the weights), while in the Marginal algorithms the weights are 'marginalized' out and we work on cluster cardinalities.
So you could just rename MarginalState into AlgorithmState or something like that and stuff should work right away right?

Right. I'll do the renaming then.

To be as clear as possible, for the Logit Stick Breaking the weights are a function of the covariates and depend on the parameters alpha_h. It seems like you already store them in the LogSBState proto.
Suppose now we want to have a TruncatedDirichlet or TruncatedPY prior (i.e. the ones they use in Ishwaran and James, 2001), then the only thing we need is a proper TruncatedStickBreakState (horrible name) which stores the parameters of the stick-breaking process and the weights

I forgot we also store mixing states. So your suggestion is to somehow include weights in the mixing state protos, correct? Sounds good. Maybe we should create a base ConditionalMixing proto which stores weights by default? or a similar mechanism? This way we don't have to manually enforce every proto to have a weights field. What do you think?
Now, for the "unrelated question" part of my post; I noticed something in the sample_full_cond(data, covariates) overloaded version of BaseHierarchy, at lines 158-174 (or just Ctrl+F TODO). It calls the regular data-less version without passing a value for the update_params bool, thus resorting to the default false. Is this intended? Even if so, we might as well make it explicit.

I forgot we also store mixing states. So your suggestion is to somehow include weights in the mixing state protos, correct?  Sounds good. Maybe we should create a base ConditionalMixing proto which stores weights by default? or a similar mechanism? This way we don't have to manually enforce every proto to have a weights field. What do you think?

Ok so here's the thing, I'm mainly thinking of two conditional mixings: the dependent LogitSB and the plain old StickBreaking in Ishwaran and James.
In the first case, we're already storing everything we need to compute density estimates, since the weights will be a transformation of the alpha_h and of the mixing_covariate.
In the second case instead, the weights are an actual parameter of the model (no transformation with covariates involved) so they should be somehow saved in the state. I imagine that if we have a TruncatedSBMixing class, one of the members in its state will be a Eigen::VectorXd weights, that must be then serialized in the MCMC chain.
The best place to save those weights will be in a message TruncatedSBMixingState proto.
So I don't see the need for having a base ConditionalMixingState proto, since for instance for logitSB we don't need to save the weights but the alphas.

Now, for the "unrelated question" part of my post; I noticed something in the sample_full_cond(data, covariates) overloaded version of BaseHierarchy, at lines 158-174 (or just Ctrl+F TODO in the file). It calls the regular data-less version without passing a value for the update_params bool, thus resorting to the default false. Is this intended? Even if so, we might as well make it explicit.

Ok let's make it explicit!

The BlockedGibbs algorithm looks good to me! I would perform a couple of tests with the new LogitSB mixing. Also you could implement the TruncatedSBMixing as in Ishwaran and James, it should be pretty easy, you just need to implement the 'full conditional for p' step in http://people.ee.duke.edu/~lcarin/Yuting3.3.06.pdf (page 8 step (c)), to check that everything is fine and confront it with Neal2/8

The BlockedGibbs algorithm looks good to me! I would perform a couple of tests with the new LogitSB mixing.

Sure, I'm already working on it.

Also you could implement the TruncatedSBMixing as in Ishwaran and James, it should be pretty easy, you just need to implement the 'full conditional for p' step in http://people.ee.duke.edu/~lcarin/Yuting3.3.06.pdf (page 8 step (c)), to check that everything is fine and confront it with Neal2/8

You know, at some point the idea of implementing it crossed my mind, just for comparison with LogSB, but then I forgot. I will gladly do that after this PR is over.

You know, at some point the idea of implementing it crossed my mind, just for comparison with LogSB, but then I forgot. I will gladly do that after this PR is over.

Well that comparison wouldn't make much sense since LogSB is a dependent mixing, while the TruncatedSB is basically a Pitman-Yor process where you truncate the number of components, so you should better compare the BlockedGibbs + TruncatedSB with Neal8 + Pitman-Yor

After some very, very long and painful debugging, I managed to successfully perform the first run ever of a conditional algorithm! Hooray 🎉.
I don't know what tests you had in mind, but there still is one theoretical detail that escapes me. How does one generate plausible data points y? Mixing covariates should have no (direct?) impact on them since they involve mixing weights and not hierarchies. Unique values should then be sampled from their prior, for example from the Normal-Inverse Gamma. So what do I do to generate data, and how can I possibly hope to have three separate clusters of them if their unique values come iid from the same prior?
In the notebook I just did some random thing to get three separate groups of y's, but it did not seem to work well. I'm using parameter values you suggested in the test file, by the way.

You can (should) do these two tests:

fix k the number of clusters, some centers xc_1, ... xc_k in R^p  and some other centers yc_1, ..., yc_k in R^d
let p = (p1, ..., pk). For observations i=1, ..., n generate the cluster label s_i ~ Discrete(p1, ..., pk), generate the covariate from x_i ~ N(xc_{s_i}, \sigma^2 I), generate the observation from y_i ~ N(yc_{s_i}, \eta^2 I).
fix k the number of clusters and fix alpha1, ... alpha_{k-1} in R^p such that they are different (for instance alpha_j is zero everywhere except in position j where it is equal to 1, let k-1 = p). Fix cluster centers  yc_1, ..., yc_k in R^d. For observations i=1, ..., n generate x_i ~ N( \mu_x, \sigma^2 I) . Compute the cluster probabilities from the LogitSB mechanism having fixed the alpha_h's: nu_1 = sigmoid(-alpha_1x_i), nu_2 = sigmoid(-alpha_2x_i) ecc... and w_1 = nu_1, w_2 = nu_2(1- nu_1) .[I omitted the dependency on x_i but should be obvious.]
Generate the cluster label s_i ~ Discrete(w_1, ... w_k) and y_i ~ N(yc_{s_i}, eta^2 I).

For both examples, let n1 < n observations be part of a training set and let the remaining observations be part of the test set.
What to check:

the a posteriori clustering of the training set should be similar to the true one that you used to generate the data (compute the adjusted rand index)
the density estimates you get on the test set (i.e. eval_lpdf) should be close to the true values

Once these works I guess it means you're squared

Ok the test 1 stuff I was already doing. Now the dataset for test 2 is also available for generation on the notebook. Hopefully it's correct.
I will perform testing later today when I find the time.

Plots and Adjusted Rand Indexes are there. I don't really know what to think about them, but I don't recall negative ARIs as being a good thing. Could it be because the clusters have different labels? Anyways, everything to run these tests is in the notebook.

So I wanted to check if maybe we broke something at the root, and the 'plot.ipynb' does not seem to work anymore... can you please check that?

Right, I planned to update all notebooks some time in the future. I'll fix that one right now.

I tried running the stickbreak notebook, setting num_components: 15 in the right asciipb file. I get a Segmentation fault (core dumped) in (it seems) BlockedGibbsAlgorithm::sample_allocations()

Could it be because the clusters have different labels?

No the ARI is invariant under cluster labeling, there must be some bug :O

Now the first univariate example in plot.ipynb is fixed, so you can start a test right away. If you also need the other ones, just ask me. Remember I cannot run that command from the notebook, so I just run it locally and copy-paste it into the notebook with some tweaks (adding ../ to paths and whatnot). This is to say, hopefully the command works.
Also, don't forget to write Neal2 as the algorithm name in the settings file.

I tried running the stickbreak notebook, setting num_components: 15 in the right asciipb file. I get a Segmentation fault (core dumped) in (it seems) BlockedGibbsAlgorithm::sample_allocations()

Hm. I will look into it right now.

No the ARI is invariant under cluster labeling, there must be some bug :O

Oh dear. This comes next, I guess.

Ok there seem to be some other issue linked to plot.ipynb: the densities from Neal2 do not integrate to 1.
So the first thing to do is to go back to the eval_lpdf and figure out what is broken, hopefully that will lead somewhere

I found the cause for the segmentation fault. It has to do with init_num_clusters. We create that many hierarchies during algorithm initialization, but that is the wrong number in BlockedGibbs since the correct one comes from the mixing. How do we fix this without patching it with an if-clause specifically for BlockedGibbs? It seems kinda difficult to me. The easiest route would be to get rid of init_num_clusters and somehow always reading it from the prior or something.

The log weights thing sure worked! Now even num_components=15 is fine. Apparently logs are computationally wonky, I need to remember this for the future.
Now onto the density estimation issue...

Some small news, but not really. I'm trying to see why old and new density estimation are different at all. Old vs new algorithm runs seem to be identical, including file collectors, so the issue should indeed only have to do with density estimation. For most of the iterations, estimations are also identical, except for a small part, say 9 out of 30 iterations. Off the top of my head I have no clue on how there can be both different and unchanged estimates at the same time, but I'll investigate more later.

Found it. In the marginal algorithm, I was initializing mass weights outside of the nested loop over clusters, forgetting that they depend on the hierarchy which changes for each cluster. Now Neal2, but I'm not sure this has any impact over BlockedGibbs, which should be unchanged since conditional algorithms had this correctly implemented.

I can't understand what you're plotting. Please make sure this is what you're doing:

fit the MCMC chain on training data y_1, .. y_n and covariates x_1, ... x_n
for each of the test data, compute the predictive density: i.e. for each test-set covariate x*_1, ... x*_m, run the Algorithm::eval_lpdf(grid, Eigen::VectorXd(0), x*_j). This will return for each covariate a matrix of size (n_iter x size(grid)). Save those matrices, or just the mean across rows, these are the predictive densities for each covariate.

The ARI still don't make sense to me, I would like to see the state of the chain at some iterations, are the unique values coherent with the "true" ones?

I can't understand what you're plotting. Please make sure this is what you're doing:
1. fit the MCMC chain on training data y_1, .. y_n and covariates x_1, ... x_n

2. for each of the test data, compute the predictive density: i.e. for each test-set covariate x*_1, ... x*_m, run the Algorithm::eval_lpdf(grid, Eigen::VectorXd(0), x*_j). This will return for each covariate a matrix of size (n_iter x size(grid)). Save those matrices, or just the mean across rows, these are the predictive densities for each covariate.

I was only using a single covariate. This requires an ad-hoc main file instead. I will take care of it.

The ARI still don't make sense to me, I would like to see the state of the chain at some iterations, are the unique values coherent with the "true" ones?

For this, I will also add a notebook section in which I read from a file collector.

I was only using a single covariate. This requires an ad-hoc main file instead. I will take care of it.

Ok this is fine, since it's just a check at the moment. But then what is
ax1.scatter(yy_test1, np.exp(np.mean(matr1, axis=0))) ?

For this, I will also add a notebook section in which I read from a file collector.

Great

Ok this is fine, since it's just a check at the moment. But then what is
ax1.scatter(yy_test1, np.exp(np.mean(matr1, axis=0))) ?

It should be the mean over iterations. I just copy-pasted it from old plot.ipynb, but it made sense and still makes sense to me.

It should be the mean over iterations. I just copy-pasted it from old plot.ipynb, but it made sense and still makes sense to me.

I really don't get what you're doing, you have yy_test1 that is a sample of m variables y*_1, ... y*_m, each with an associated covariate x*_1, ... x^_m. But then you compute the predictive density only for one value of the covariate x^_k (I assume k=1??) as you told me in the previous comment.
Finally you plot the scatter-plot of the mean of the predictive density (which is not the predictive mean!) over y*_1, .., y*_m.
I'm completely lost. Please write exactly what you want to compute and why this plot makes sense

Basically I was treating the test set just as a grid, and plotting the prediction density for that one covariate (the first one from the test set). This is of course not using a test set as such, and I was planning to do proper testing akin to the one you described, but then all sorts of other issues came up and I couldn't finish it.

After the correction, the plots make way more sense:

Let us recall, this is the predictive density for test point number 1. (With a really bad grid, but still.) You have spikes in the true data centers (0, 4, 8), and the top spike corresponds to the correct true cluster (third cluster in test 1, first cluster in set 2, by checking the true allocations). I'll do proper testing in a minute, but for now I take this as a good sign.
Unfortunately the ARI are still garbage: 0.02 and -0.04.

I found another bug in the way you compute the ARIs...
the true clustering should be computed as
cc1 = np.array(cc1)
true_clust1 = cc1[np.where(training_mask1)[0]]

Here are the cluster means at iterations 0, 100, 200, ..., directly from the notebook:
Test 1:
[3.8888184826647523, 3.7472007590726446, 7.9904413692400835]
[2.1343484428778314, 3.8744322149704686, 8.121680946679708]
[2.8205999171011062, 4.008315150181021, 8.059774920098162]
[3.8910046549082193, 3.499130013962602, 7.999363815036371]
[3.9181821744685905, 3.863865305689541, 8.099898321618152]
[4.344919455411698, 3.9022231929756077, 8.067464255291629]
[3.6958767597733626, 3.677764719152293, 7.99368317792358]
[2.7705166839642565, 4.193337341924695, 8.01811680472974]
[4.6445126683929585, 3.9892188441748306, 7.907440692400335]
Test 2:
[-0.12131884871325319, 3.95164424088047, 8.413585570942733]
[-0.1685931102069758, 4.0040733177841625, 8.136586341403868]
[-0.27434068862206257, 4.263232014600639, 8.740452416866791]
[-0.1785645483502693, 4.278088522876812, 8.352665604542688]
[-0.14170041616653695, 4.613186465237009, 7.799043252422848]
[-0.0007855251876815461, 4.002299319590243, 8.082634351559339]
[-0.007883716313963895, 3.9232840604231165, 7.936040981459559]
[-0.2727112151750031, 4.2840658353609165, 8.208272203205157]
[-0.20290893507508984, 4.202604627257853, 8.353638147826464]
Test 2 predictions are spot-on! Yet another good sign.
I don't really know what's going on with test 1 though. Probably some oversight with data generation.

I found another bug in the way you compute the ARIs...
the true clustering should be computed as

Weird, I thought I checked that it worked correctly. I'll fix it right now, then go back to test 1 data and both plots.

You can try separating more the means of y, for instance -10,0,10

ARI 1 = 0.7632357464009022
ARI 2 = 0.9113149608333246

LET'S GO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Now, onto the test plots at last!

I only saved the mean densities for each covariate, since otherwise dealing with a 3D tensor (iterations x covariates x grid points) would be a mess. But below are some densities of arbitrarily chosen covariates, with the single point representing the true y. They look pretty nice to me!
You can see that one of these points is misclassified, but it shouldn't be too big of a deal, especially since it belongs to the test with the worst clustering among the two.
As mentioned earlier, this required the creation of a new main file, with the relevant part being:
  algo->run(coll);
  std::cout << "Computing log-densities..." << std::endl;
  Eigen::MatrixXd dens(mix_cov_grid.rows(), grid.rows());
  for (int i = 0; i < mix_cov_grid.rows(); i++) {
    Eigen::VectorXd dens_mean_i(grid.rows());
    Eigen::MatrixXd tmp =
        algo->eval_lpdf(coll, grid, hier_cov_grid,
                        mix_cov_grid.row(i));
    for (int j = 0; j < coll->get_size(); j++) {
      dens_mean_i += tmp.row(j);
    }
    dens.row(i) = dens_mean_i / coll->get_size();
  }
  bayesmix::write_matrix_to_file(dens, densfile);

Should I push this file? It is used in the notebook in the run cell, but everything else is already on the notebook.

Should I push this file? It is used in the notebook in the run cell, but everything else is already on the notebook.

Why not, you could call it run_dependent.cc


Flatpak Frog downloads from tessdata instead of tessdata_best

Hi,
I'm trying to ocr an arabic image, but frog couldn't read anything from the image, when i replaced the ara.tessdata from the frog flatpak directory with the one i downloaded from tessdata_best, frog managed to ocr tge image with great success.
Even using tessdata_fast had a very good success.
Please make tessdata_best the default

As you can see in the code we're trying to get the _best model by default and if an error happens we switch to the base model.
https://github.com/TenderOwl/Frog/blob/5608ab34547fc639dd97a31cab018a9ea0a18c35/frog/language_manager.py#L201

Great, i will close the issue then.


Embedded app: ./my-app run doesn't correctly match host names

What happened?
Embedded an app with frankenphp. Trying to run it with ./my-app php-server, it works under localhost:80.
Creating a Caddyfile and using ./my-app run has a few problems:

Need to specify /tmp/frankenphp.... directory manually, as using root public/ uses the cwd/public directory, which makes no sense
The hostname is never matched, even if it should be

2024/06/11 13:32:42.892 INFO    http.log.access NOP    {
   "request":{
      "remote_ip":"<IP_ADDRESS>",
      "remote_port":"49281",
      "client_ip":"<IP_ADDRESS>",
      "proto":"HTTP/2.0",
      "method":"GET",
      "host":"my.valid.server",
      "uri":"/seminar_type/",
      "headers":{
         "Sec-Fetch-Site":[
            "none"
         ],
         "Sec-Fetch-Mode":[
            "navigate"
         ],
         "Accept-Encoding":[
            "gzip, deflate, br, zstd"
         ],
         "Accept-Language":[
            "en,de;q=0.9"
         ],
         "Cache-Control":[
            "max-age=0"
         ],
         "Sec-Ch-Ua":[
            "\"Google Chrome\";v=\"125\", \"Chromium\";v=\"125\", \"Not.A/Brand\";v=\"24\""
         ],
         "Sec-Ch-Ua-Mobile":[
            "?0"
         ],
         "Upgrade-Insecure-Requests":[
            "1"
         ],
         "Cookie":[
            "REDACTED"
         ],
         "Sec-Ch-Ua-Platform":[
            "\"Windows\""
         ],
         "Sec-Fetch-Dest":[
            "document"
         ],
         "Priority":[
            "u=0, i"
         ],
         "User-Agent":[
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36"
         ],
         "Accept":[
            "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
         ],
         "Sec-Fetch-User":[
            "?1"
         ]
      },
      "tls":{
         "resumed":false,
         "version":772,
         "cipher_suite":4865,
         "proto":"h2",
         "server_name":"my.valid.server"
      }
   },
   "bytes_read":0,
   "user_id":"",
   "duration":0.0000027,
   "size":0,
   "status":0,
   "resp_headers":{
      "Server":[
         "Caddy"
      ],
      "Alt-Svc":[
         "h3=\":443\"; ma=2592000"
      ]
   }
}

What's interesting is the http.log.access NOP, which should usually be http.log.access handled request.
Example Caddyfile:
{
        debug
        frankenphp {
#               worker /tmp/frankenphp_c407ab7817f4cae00ecbd8679d4f2d09/public/index.php
        }
}

my.valid.server { # not matched
        tls /etc/pki/tls/certs/myvalid.cer /etc/pki/tls/private/myvalid.key # works

        log # works

        encode zstd gzip

        root * /tmp/frankenphp_c407ab7817f4cae00ecbd8679d4f2d09/public/ # better way to do this?

        php_server # commenting this out changes nothing

        file_server # commenting this out changes nothing

        respond "Not Found" 404 # doesn't do anything
}

# :443 { # would be matched
#         respond "Not Found" 405 # would respond
# }

Build Type
Standalone binary
Worker Mode
No
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
-not important-

Relevant log output
-see above-

Hi there @DubbleClick are this already resolved yet?
cause in my case is that you need to manually symlink to the root directory, since the automatic symlink seems not working, if you set root directory in the root * public/
then in your ./my-app should be create a symlink to it, for example if you are in the /app/my-app then the symbolik link is ln -s /tmp/franken_*random_number*/public/ /app/my-app
Hope this can help

I understand what you're saying, thank you for the suggestion. I can't test it out at the moment, but it should be fixed on frankenphp's side either way. Working seamlessly with a user-provided Caddyfile is a must, the entire point of bundling an application is completely moot otherwise.


Handle KO_DOCKER_REPO=ko.local/repo and --bare correctly

Fixes https://github.com/ko-build/ko/issues/807
cc @developer-guy
See comments in https://github.com/ko-build/ko/issues/807#issuecomment-1243695345 -- uniformly setting base: po.LocalDomain in NewDaemon was fine when we assumed/required that KO_DOCKER_REPO=ko.local would only be used without a repo, but we've since changed that assumption/requirement.
$ KO_DOCKER_REPO=ko.local/foo go run ./ build ./test --bare
...
ko.local/foo:3a28632fcb886b7a4c78be8cd36c34ec47e83f71ff55353e5602873400dca564

Note that this also handles ko.local/foo for other namers:
$ KO_DOCKER_REPO=ko.local/foo go run ./ build ./test --preserve-import-paths
...
ko.local/foo/github.com/google/ko/test:3a28632fcb886b7a4c78be8cd36c34ec47e83f71ff55353e5602873400dca564

KO_DOCKER_REPO=ko.local/foo go run ./ build ./test
...
ko.local/foo/test-46c4b272b3716c422d5ff6dfc7547fa9:3a28632fcb886b7a4c78be8cd36c34ec47e83f71ff55353e5602873400dca564

^ @eddycharly

:partying_face:

it would be good to release ko v0.13.0 that includes that fix ☝


build: Bump MSRV to 1.70

Windows on CRAN seems to still be running Rust 1.69, so if you do the 0.10.0 release soon, I'll have to do some work to fix MSRV...

Ah, we can just wait for the slowest dependency then. No great rush, no reason to delay once the dependencies are on 1.70.0 though...

@eitsupi do you happen to know whether winget requires a matching rust compiler? Debian does, but when I look at the winget manifest, it seems to take a binary: https://github.com/microsoft/winget-pkgs/pull/120030/files#diff-8a3a9ea01807574e4e83d54fadb778aafafb9002ab85cc894986ddc2b9ace7ceR15, suggesting that we don't need to wait for it to bump this?

In addition to Rust on Windows and macOS not being updated, Fedora on CRAN also hasn't been updated recently for some reason and appears to be stuck at Rust 1.69.
I hope it will be updated in the next R release which is scheduled for 2023-10-31...

I hope it will be updated in the next R release which is scheduled for 2023-10-31...

Cool, no rush from PRQL's side if not though!

Sorry it took me so long to get here, I was wondering why Fedora's Rust on CRAN was out of date, but the cause was that it was still Fedora 36, which was out of support in the first place.
This is obviously a problem, so I sent an email to the mailing list.
Now that Ubuntu LTS rustc has also reached 1.70, it makes perfect sense to set MSRV to 1.70.
This PR is out of date, so open another one.

Superseded by #3578.


CORE-17562 Metrics for Multi-Source Event Mediator

Metrics for Multi-Source Event Mediator

This was replaced by https://github.com/corda/corda-runtime-os/pull/4879


500 error when trying to setup reverse-proxy with SSL (Apache)

Is it a duplicate question?
Please search in Issues without filters: https://github.com/louislam/uptime-kuma/issues?q=
I couldn't find any issue with this problem
Describe your problem
Hello, I'm trying to setup Reverse-Proxy with SSL using Apache for Uptime-Kuma
But I get 500 Internal Server Error, I double-checked that I did everything correctly but the error is still there
Info
Uptime Kuma Version: 1.7.3
Using Docker?: No
Docker Version: //
Node.js Version (Without Docker only): v16.11.0
OS: Ubuntu 2004
Browser: Chrome

Hello, I have another problem, now I can't use dashboard because it says this:
Cannot connect to the socket server. [Error: websocket error] Reconnecting...

If localhost is working, it is usually because of missing the upgrade headers.

Yes, localhost is working, could you please tell me how to add the upgrade headers?


Add debug traces to buildah

Before you complete this pull request ...
Look for any open pull requests in the repository with the title "e2e-tests update" and
see if there are recent e2e-tests updates that will be applicable to your change.

Do not merge, I just need to build image and use it for debugging


add screen for unincorporated which sector other

add screen for unincorporated which sector other

CI: No security warnings found


Adding compressors to etmoses gas asset calculation

There's a new type of gas asset in ETMoses: the compressor. It's purpose is to compress gas from a lower pressure level to a higher pressure level. The current Upward capacity is Infinite but this should be set to a calculated amount based on the compressors.

I'm looking at the code directly but I can stare at it for days and probably just barely touch the essence of what is going on; also reading the specs doesn't make much sense due to the level of abstraction. So therefor these questions:
"The compressors need to control the Upward capacity of the Gas Load"
I was told this but I don't really have a clue what that means. How exactly does that influence the Gas Load? I understand that the compressor compresses gas so it's transportable (moveable) from for instance 4 bar to 8 bar. Ofcourse there's some energy lost (therefor the efficiency) but what has capacity got to do with it? Is that how much gas it can compress? I'm a bit lost here... I understand what it does but I have no idea how.
I was looking at Slots which are two pieces of Slot and I see that in there the connectors are the only things used from the @assets. My first little gut-feeling tells me that the compressors also have to be incorporated in here somewhere but than how would I correctly put this into specs?
To expand. What will happen right now is: I'll change gas_chain_spec.rb, just add a compressor and wait for an efficiency to differt from it's normal behavior and change the expectation accordingly blindly assuming it's correct. Which is not really something I should be doing.
--
Long story short: how does a compressor work and how does it influence the Gas load calculation?

I'm confused. Isn't upward efficiency and capacity already modelled in Connectors using the low_to_high capacity and efficiency?

Is that how much gas it can compress?

Yes. If more gas is being pushed upward then the compressor can handle, the gas is 'flared' away.

(explain it like I'm 5)

OK, a long, long time ago there was a beautiful princess in a very big and cold castle. She asked all the young princes from neighbouring countries to make her feel warm again. Her evil stepmother didn't like the sound of that at all and gave her a little gas-fired heater instead so she could warm up her crystal room high up in the highest tower of the castle. Because the tower was so high, the gas would not go up there out of its free will. The king installed a compressor to pump the gas upward to be used in the gas-fired heater.
Het heater needed 2kW of gas and the king fed those 2kW into the compressor but the poor compressor only had a capacity of 1kW. It pumped and it pumped its little lungs full of gas but only half of the 2kW made it to the princess. The other 1kW was coughed up by the brave little compressor (who is the actual hero of our story) filling up the dungeons of the castle with an explosive mixture. The king, content with his solution lit a nice pipe and the castle deflagrated in a ball of fire. Nobody survived the tragedy but the scorching heat was able to melt the frozen tears of the icy princess. So, that was somewhat of a happy ending right?

Isn't upward efficiency and capacity already modelled in Connectors using the low_to_high capacity and efficiency?

Yes, because we (I) thought at the time that the compressor would be an integral part of the connectors (GOS, DRS etc.). It turns out that they are not... But I think every connection between two levels still has a low_to_high capacity. Does that make sense @antw?

So, that was somewhat of a happy ending right?

It needs a bit more dragons but I get it though. 😄

I'm confused.

So am I.

So the low_to_high capacity of the compressor is added to the low_to_high capacity of the connector? Or is one swapped out for the other?

So the low_to_high capacity of the compressor is added to the low_to_high capacity of the connector? Or is one swapped out for the other?

I think of it like this: the connection between level 1 and level 2 (connection 1 <--> 2) has two directions of possible gas-flow. The connection is not a single entity but rather the effective sum of all connectors that are in the physical network (GOS, DRS etc.)
The direction from high to low pressure is simple at the moment in the sense that it is of limitless (infinite) capacity and lossless. If we can find some numbers (capacities) for the different (physical) stations that add up to the total connection between two levels we can add up the capacities of the stations to yield the total (finite) capacity for the high_to_low gas-flow (see https://github.com/quintel/etmoses/issues/861#issuecomment-199861250).
For the direction from low to high, the capacity and the losses are determined by the sum of the capacities and the weighted sum of the efficiencies of the compressors that are part of the connection.
Summarising: the total (unphysical) connection between two levels has two directions. The high_to_low is set by GOS, DRS etc. and is finished. The low_to_high capacity and efficiency needs to be set by the compressors.

I think of it like this: the connection between level 1 and level 2 (connection 1 <--> 2) has two directions of possible gas-flow. The connection is not a single entity but rather the effective sum of all connectors that are in the physical network (GOS, DRS etc.)

It currently is.

The low_to_high capacity and efficiency needs to be set by the compressors.

Ignoring the low_to_high capacity of all the connectors... ?

Ignoring the low_to_high capacity of all the connectors... ?

If by connectors you mean the GOS, DRS etc. things then yes. These units turn out not to have a low_to_high anything...

These units turn out not to have a low_to_high anything...

Aha, that makes sense. Thanks.

What is the status @grdw ?

What is the status @grdw ?

There's a pull request (#965). I understood it was awaiting "[ - ] Test it in a real LES", but perhaps that has been completed? It seems there is data in place from @jorisberkhout; assuming that data is ready, and the testing finished, I can work on getting the PR merged.

[Connectors] turn out not to have a low_to_high anything...

Is it the case that connectors have no low_to_high anything, and compressors have no high_to_low anything? Meaning: connectors do high-pressure to lower-pressure exclusively, and compressors do only low-pressure to higher-pressure?
Is there any case that you know of where either of these technologies might have both high-to-low and low-to-high attributes?
I ask because the relevant pull request still uses high_to_low and low_to_high attributes, but if each technology is only one-way we can probably simplify this.

connectors do high-pressure to lower-pressure exclusively, and compressors do only low-pressure to higher-pressure?

Yes!

Is there any case that you know of where either of these technologies might have both high-to-low and low-to-high attributes?

No. Not at the moment.

if each technology is only one-way we can probably simplify this.

👍

assuming that data is ready, and the testing finished, I can work on getting the PR merged.

Good to go!


Bound must be positive

http://pastebin.com/a7gD6uYq
Discovered this crash while trying it out as an addition for a future update to my pack. Is there anything that can be done about this, if you still support this mod? You might want to put this fix on both 1.7.10 and 1.9.4/1.10.2 if possible, as the only downloads for your mod are on 1.7, but you are working on a 1.9.4 port.

Was it generating a void world or something?  It's saying the world height was 0 or negative.

Not sure, but it was happening in a spooky forest.

I just encountered it in a bubblegum forest. It might be related to RTG integration.

https://github.com/Team-RTG/Realistic-Terrain-Generation/issues/988

So, something with your math is off according to the RTG devs @SpitefulFox

That's not what it says.  It says what I already previously said:  That something is causing the world height value to return 0.

https://github.com/Team-RTG/Realistic-Terrain-Generation/issues/988#issuecomment-251899052

@SpitefulFox
0 being returned from net.minecraft.world.World#getHeightValue is on RTG's side, however, whenever you are passing a value to java.util.Random you should be checking for an illegal value regardless, to prevent the possibility of an IllegalArgumentException. In this case, net.minecraft.world.World#getHeightValue has the possibility of returning 0.

That's all just copy-pasta'd Vanilla code, so I'm curious as to why other biomes don't also crash.


LightGBM Support?

I am using LIME with a lightgbm model. Is there an issue with using this since it only returns P(y=1) for a binary problem?
X_test=X_test.fillna(0)
explainer = lime.lime_tabular.LimeTabularExplainer(X_test[limit_vars].values, discretize_continuous=True, random_state=1231)

exp_idx = 0
exp = explainer.explain_instance(X_test[limit_vars].iloc[exp_idx,:].values,
                                 lgbm_mod.predict, num_features=10)

Gives:
NotImplementedError: LIME does not currently support classifier models without probability scores. If this conflicts with your use case, please let us know: https://github.com/datascienceinc/lime/issues/16

I'm assuming it returns a 1d array. If so, you just have to wrap it like this:
def wrapped_fn(X):
  p = lgbm_model.predict(x).reshape(-1, 1)
  return np.hstack((1-p, p))

and use  wrapped_fn in explain_instance

I am using LIME with a lightgbm model. Is there an issue with using this since it is multi-class ？

@marcotcr , thank you for your code. It helps to fix an issue.


Fixed failing compilation with serde::export

Hello!
Apparently at some point serde developers pushed an update that discouraged the use of their private, uh, stuff, so the library stopped compiling 😢
Luckily, after a quick google, it turned out to be a rather quick fix! Here's another project fixing this in the same way. All the tests pass, I checked 😉
❤

@arthurkhlghatyan can this be merged?

Looks like this is the error I just came across in #15 too, can this fix be merged and released?

Op appears to have gone AWOL so I have forked the repo in the meantime and its working properly now.
https://crates.io/crates/reqwest-graphql

Guys, 1.0.2 is published on crates.io,
I lost hopes someone would ever need this library, can't believe I didn't see all this going on for a year lol.
Seems you guys found it useful, is there any feature you would want to be added? Like subscriptions, compiled schema and etc?
@longfellowone @ibraheemdev @qwandor @thmey @vyneer

I've added @vyneer @ibraheemdev @longfellowone to the repository. Feel free to ping me in case you need anything also you can shoot me a dm on telegram @iamarthurk.


Create fixtures for Pelican backend to load with loaddata

For development and testing
https://docs.djangoproject.com/en/3.2/howto/initial-data/#initial-data-via-fixtures
Like in https://github.com/open-contracting/covid-19-procurement-explorer-admin

Done for development. See #12 for testing.


Refactor config/environment.rb and rake tasks for encapsulation

This removes the use of Ruby global variables in favor of an Environment class with a few magic class methods. The encapsulation is easier to manage and predict, and I think it cleans up the code a bit.
I also moved the Elasticsearch client creation out of rake altogether and into config/environment.rb, so that that can all be loaded in in the :environment task, and the dependencies by other tasks can just be on :environment.

Excellent, thank you for cleaning up my use of globals!

Phew! Took me a few tries to fix the tests. The test suite is really comprehensive, thanks for setting it up @divergentdave.


Unexpected error on City wise cluster.

Unexpected error on City wise cluster.

Duplicate of #42 & #41

fixed in https://github.com/someshkar/covid19india-network/pull/54


Stopping All Containers & Starting All Containers starts new containers instead of restarting old containers

only true for non-core things, correct?

@cglewis Correct!

Is this the intended behavior, and we just haven't been cleaning up unused non-core containers, or is the intended behavior to restart stopped non-core containers?

The intended behavior is to restart old containers rather than create new containers and leaving unused old containers until clean.


BFS

🚀 Feature
(A clear and concise description of what the feature is.)
Have you read the Contributing Guidelines on Pull Requests?
(Write your answer here.)
I would like to add breadth first search(BFS) for a graph.
Motivation
(Please outline the motivation for the proposal.)
Pitch
(Please explain why this feature should be implemented and how it would be used.)

Code present


Sim polishing

Removed bug in visualizer
Added framework for testing sim (still needs some work)

Mainly pulling in to resolve visualizer for training.

Seems to function


document.getElementsByClassName exists but node.getElementsByClassName does not

Hi,
I've encountered an issue where the check for document.getElementsByClassName passes, but Internet Explorer 8 will error on "node.getElementsByClassName" within getByClass.
var getByClass = function(searchClass, node, tag) {
var matches = [];
if (document.getElementsByClassName) {
matches = node.getElementsByClassName(searchClass);
} else {
The error is "object does not support this method or property". I'm not sure why it is supported on the document but not the node within the doc. In any case I've worked around it by:
var getByClass = function(searchClass, node, tag) {
var matches = [];
if (document.getElementsByClassName && node.getElementsByClassName) {
matches = node.getElementsByClassName(searchClass);
} else {
It seems like the test could be reduced to not include document.getElementsByClassName, but I figured it was safer to check both since the non DOM method fallback seems effective. Someone with further expertise in this area might be able to determine a better solution.
I'm not terribly familar with gitHub, so I hope the above is helpful.
Regards,
Mark

The problem is that you're probably using the old version of the prototype library, which provides a broken implementation of document.getElementsByClassName, but isn't available to any other nodes. I'd say, upgrade prototype. But I'll go ahead and provide a pull request anyway to incorporate Mark's fix.
http://www.prototypejs.org/api/utility/getElementsByClassName

Thanks for answer and I'm sorry late reply.
You are right. ;)
A day after I posted my question, I upgraded all JavaScript library in my system and everything worked.
So your answer is completely correct.
Thanks again
Sengchheang


🐛 BUG:

Which Cloudflare product(s) does this pertain to?
Pages
What version of Wrangler are you using?
1.0
What operating system are you using?
Ubuntu
Describe the Bug
2023-06-24T06:30:12.599311Z	Cloning repository...
2023-06-24T06:30:14.336536Z	From https://github.com/super1002/MetaSwap-FrontEnd-Next.js
2023-06-24T06:30:14.337273Z	 * branch            7166b7bcc58f31a96bc10f9a63b2e29e91ea0149 -> FETCH_HEAD
2023-06-24T06:30:14.33747Z
2023-06-24T06:30:14.436975Z	HEAD is now at 7166b7b Merge pull request #15 from super1002/modify-order
2023-06-24T06:30:14.437662Z
2023-06-24T06:30:14.559862Z
2023-06-24T06:30:14.592982Z	Success: Finished cloning repository files
2023-06-24T06:30:15.324469Z	Detected the following tools from environment<EMAIL_ADDRESS><EMAIL_ADDRESS>2023-06-24T06:30:15.325381Z	Installing project dependencies: npm install --progress=false
2023-06-24T06:30:35.949662Z
2023-06-24T06:30:35.950251Z	added 379 packages, and audited 380 packages in 19s
2023-06-24T06:30:35.950445Z
2023-06-24T06:30:35.95067Z	133 packages are looking for funding
2023-06-24T06:30:35.950912Z	  run npm fund for details
2023-06-24T06:30:35.964768Z
2023-06-24T06:30:35.965128Z	5 moderate severity vulnerabilities
2023-06-24T06:30:35.965299Z
2023-06-24T06:30:35.965434Z	To address issues that do not require attention, run:
2023-06-24T06:30:35.965602Z	  npm audit fix
2023-06-24T06:30:35.965733Z
2023-06-24T06:30:35.965885Z	To address all issues (including breaking changes), run:
2023-06-24T06:30:35.966024Z	  npm audit fix --force
2023-06-24T06:30:35.966152Z
2023-06-24T06:30:35.96628Z	Run npm audit for details.
2023-06-24T06:30:35.99818Z	Executing user command: npm run build
2023-06-24T06:30:37.209153Z
2023-06-24T06:30:37.209686Z	><EMAIL_ADDRESS>build
2023-06-24T06:30:37.209913Z	> next build
2023-06-24T06:30:37.210061Z
2023-06-24T06:30:37.810838Z	- warn No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2023-06-24T06:30:37.843581Z	Attention: Next.js now collects completely anonymous telemetry regarding usage.
2023-06-24T06:30:37.843956Z	This information is used to shape Next.js' roadmap and prioritize features.
2023-06-24T06:30:37.844148Z	You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
2023-06-24T06:30:37.844306Z	https://nextjs.org/telemetry
2023-06-24T06:30:37.84446Z
2023-06-24T06:30:37.97592Z	- info Skipping linting
2023-06-24T06:30:37.97632Z	- info Checking validity of types...
2023-06-24T06:30:42.697811Z	- info Creating an optimized production build...
2023-06-24T06:30:56.794545Z	- info Compiled successfully
2023-06-24T06:30:56.804483Z	- info Collecting page data...
2023-06-24T06:31:10.51114Z	- info Generating static pages (0/6)
2023-06-24T06:31:10.606425Z	- info Generating static pages (1/6)
2023-06-24T06:31:10.631234Z	- info Generating static pages (2/6)
2023-06-24T06:31:10.658519Z	- info Generating static pages (4/6)
2023-06-24T06:31:10.677411Z	- info Generating static pages (6/6)
2023-06-24T06:31:10.942922Z	- info Finalizing page optimization...
2023-06-24T06:31:10.952097Z
2023-06-24T06:31:10.966122Z	Route (pages)                              Size     First Load JS
2023-06-24T06:31:10.966485Z	┌ ○ /                                      53.6 kB         171 kB
2023-06-24T06:31:10.966719Z	├   /_app                                  0 B            74.3 kB
2023-06-24T06:31:10.966884Z	├ ○ /404                                   182 B          74.5 kB
2023-06-24T06:31:10.967068Z	├ ○ /about                                 4.31 kB         116 kB
2023-06-24T06:31:10.967219Z	├ ○ /admin                                 3.67 kB         109 kB
2023-06-24T06:31:10.967364Z	├ λ /api/hello                             0 B            74.3 kB
2023-06-24T06:31:10.967506Z	└ ○ /order/[slug]                          8.62 kB         126 kB
2023-06-24T06:31:10.967645Z	+ First Load JS shared by all              79.2 kB
2023-06-24T06:31:10.967793Z	  ├ chunks/framework-cda2f1305c3d9424.js   45.2 kB
2023-06-24T06:31:10.967948Z	  ├ chunks/main-9c8fd354a6242c23.js        27.6 kB
2023-06-24T06:31:10.968082Z	  ├ chunks/pages/_app-83ad0af753575c33.js  618 B
2023-06-24T06:31:10.968207Z	  ├ chunks/webpack-527576ff117bb29f.js     826 B
2023-06-24T06:31:10.96833Z	  └ css/39ffcaeabe9799cf.css               4.94 kB
2023-06-24T06:31:10.968463Z
2023-06-24T06:31:10.968587Z	λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
2023-06-24T06:31:10.968723Z	○  (Static)  automatically rendered as static HTML (uses no initial props)
2023-06-24T06:31:10.968852Z
2023-06-24T06:31:11.700143Z	Finished
2023-06-24T06:31:11.700896Z	Note: No functions dir at /functions found. Skipping.
2023-06-24T06:31:11.701256Z	Validating asset output directory
2023-06-24T06:31:12.397323Z	Deploying your site to Cloudflare's global network...
2023-06-24T06:31:14.256465Z
2023-06-24T06:31:14.399259Z	✘ [ERROR] Error: Pages only supports files up to 26.2 MB in size
2023-06-24T06:31:14.399609Z
2023-06-24T06:31:14.399783Z	  cache/webpack/client-production/0.pack is 165 MB in size
2023-06-24T06:31:14.399961Z
2023-06-24T06:31:14.4001Z
2023-06-24T06:31:14.400245Z	If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
2023-06-24T06:31:14.412926Z	Failed: upload process exited with code: 1
2023-06-24T06:31:15.350728Z	Failed: an internal error occurred
2023-06-24T06:31:15.350728Z	Error: Failed to publish assets. For support, join our Discord (https://discord.gg/cloudflaredev) or create a ticket and reference the deployment ID: 07b4492a-a308-4312-9398-5cb467884de2

Thanks for reporting this! As the error message says:

Pages only supports files up to 26.2 MB in size

Pages has a file size limit smaller than 165MB, which is how big the file cache/webpack/client-production/0.pack is.


Update Ignition version to latest 3.4.1

Update Ignition version to latest 3.4.1

PR has been merged.


[Feature] The save and load methods for tensor

Hi, I was finding a way to save and load a tensor with Tensor.NET. I found two static classes TensorWriter and TensorReader. However, maybe some apis like Tensor.Load() and Tensor.Save to directly be called from a tensor instance will make it more convinience.

There has already been a Tensor<T>.Save method now. I guess you tried to use Tensor.Save so that you didn't find it.
I will add Tensor.Save and Tensor.Load soon. Thank you for your advise!


CompositeClasspathTests fails with odd noclassdef error

Two tests exclude spring-jdbc-*.jar, but JdbcEnvironmentRepositoryTests is somehow loaded and then there is a Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.core.ConnectionCallback

Closed via c1bff9c27b0002de9b1b20b4615af751e1e8f4c8 and c1f01297bbb666f99b6dcb08ee1b12a7f424caf2


On navigating between routes, entire app reloads

Issue and Steps to Reproduce
I have integrated react-oidc in on of my application. The authentication works good and after login I redirect the application to a home page, which is the only protected route (wrapped with <OidcSecure> or withOidcSecure, tried both). the home page has several other routes, like home/accounts, home/questions, etc.. Once I land on the home page if I try to change the route to home/accounts the app seems to be reloaded.
App.ts
const App = (): ReactElement => (
  <StoreProvider>
    <ThemeProvider theme={theme}>
      <BrowserRouter>
        <AuthenticationProvider
          configuration={oidcConfiguration}
          loggerLevel={oidcLog.DEBUG}
          authenticating={AuthenticatingPage}
          callbackComponentOverride={AuthenticatingPage}
          notAuthenticated={AuthenticatingPage}
          notAuthorized={NotAutherizedPage}
        >
          <AppRouter />
        </AuthenticationProvider>
      </BrowserRouter>
    </ThemeProvider>
  </StoreProvider>
);

AppRouter.ts
const AppRouter = (): ReactElement => {
  const oidc = useReactOidc();
  const history = useHistory();
  useEffect(() => {
    if (oidc.oidcUser !== null) {
      console.log('HOME REDIRECTION');
      history.push('/home');
    } else {
      console.log('login REDIRECTION');
      oidc.login();
    }
  }, []);
  return (
    <Switch>
      <Route exact path="/">
        <Login />
      </Route>
      <Route path="/home">
        <OidcSecure>
          <Home />
        </OidcSecure>
      </Route>
    </Switch>
  );
};

Home.ts
export default function Home(): ReactElement {
  return (
    <>
      <Header />
      <HomeRouter />
      <Footer copyright="ProtoCall Services © 2020" />
    </>
  );
}

Versions
@axa-fr/react-oidc-context: ^3.1.4
oidc-client: ^1.10.1
Expected
Should not rerender the application when on local routes change.
Actual
It is re-rendering/reloading entire app when I navigating to home/accounts or home/questions
Additional Details
It seems like when I do a history.push('home/accounts') the app is redirected to the identity server and came back to the home/accounts route

Hi @Ansalibrahim,
I thing that you do not need that part of code
const oidc = useReactOidc();   const history = useHistory();   useEffect(() => {     if (oidc.oidcUser !== null) {       console.log('HOME REDIRECTION');       history.push('/home');     } else {       console.log('login REDIRECTION');       oidc.login();     }   }, []);

Hi @Ansalibrahim, do you solve your problem.?

@guillaume-chervet I am not sure. Maybe it was a misunderstanding of how things work. But it now works perfectly. I will close the issue. Thank you for your support and for the library.


New batch of translations

As part of some A11y issues, we're adding new strings in need of translating. This issue tracks doing a new batch of translations and updating the TODOs associated with this issue once translations are available.

I'll continue editing this comment as new translated strings are added.
The translations we're looking for are:

button.editSr - from #3562
button.continueSr - from #3562
link.externalLinkOpensInNewTab - from #3564

More translations:

validation.errorAnnouncementSr from #3706
ariaLabel.begin from #3709
ariaLabel.continue from #3709


[worker reload] [worker init] Cannot find package 'micromark'  | Nuxt 3.4.1

Environment
Platfrom: Windows 10,
"@nuxt/content": "^2.5.2",
"@nuxt/devtools": "^0.4.0",
"@nuxtjs/tailwindcss": "^6.6.6",
"nuxt": "^3.4.1",

Would you provide a reproduction? 🙏

Hello @danielroe ,
The issue got resolved by running:
nuxi upgrade --force
Reproduction steps:
I was previously in these version:
{   "private": true,   "scripts": {     "build": "nuxt build",     "dev": "nuxt dev",     "generate": "nuxt generate",     "preview": "nuxt preview",     "postinstall": "nuxt prepare"   },   "devDependencies": {     "@nuxt/content": "^2.5.2",     "@nuxt/devtools": "^0.2.5",     "@nuxtjs/tailwindcss": "^6.6.4",     "nuxt": "^3.3.2",     "sass": "^1.60.0",     "sass-loader": "13.2.1"   },   "dependencies": {     "@picocss/pico": "^1.5.7",     "@pinia/nuxt": "^0.4.7",     "@shopid/vue3-swipe-box": "^0.1.5",     "@tailwindcss/typography": "^0.5.9",     "daisyui": "^2.51.5",     "pinia": "^2.0.33",     "vue-sidebar-menu": "^5.2.5"   },   "overrides": {     "vue": "latest"   } }
After that i did the following:

npm check-npm-updates -u
npm install

and these issue arrived ,
{   "private": true,   "scripts": {     "build": "nuxt build",     "dev": "nuxt dev",     "generate": "nuxt generate",     "preview": "nuxt preview",     "postinstall": "nuxt prepare"   },   "devDependencies": {     "@nuxt/content": "^2.5.2",     "@nuxt/devtools": "^0.4.0",     "@nuxtjs/tailwindcss": "^6.6.6",     "nuxt": "^3.4.1",     "sass": "^1.62.0",     "sass-loader": "13.2.2"   },   "dependencies": {     "@pinia/nuxt": "^0.4.8",     "@shopid/vue3-swipe-box": "^0.1.5",     "@tailwindcss/typography": "^0.5.9",     "daisyui": "^2.51.5",     "pinia": "^2.0.34",     "vue-sidebar-menu": "^5.2.5"   },   "overrides": {     "vue": "latest"   } }

Great! I'm glad it was resolved.


Crashes when previewing videos in the .ts file format.

Microsoft PowerToys version
0.70.1
Installation method
PowerToys auto-update
Running as admin
No
Area(s) with issue?
Peek
Steps to reproduce
To reproduce the issue:

Copy various video files with different formats to a folder.
Open Peek and wait for the UI to appear.

Note that the crash does not appear in the logs.
✔ Expected Behavior
Since the new W11 media player works with .ts files, it expected that Peek worked with this files too.
❌ Actual Behavior
The app crashes.
Other Software
No response

Hi @DanielTolentino, is .ts opened as a text?
/needinfo

No, it stays blank and close right away. Works fine when opening with the default media player.

Peek here would use Monaco which needs a webview, wonder if that is present.  /reportbug


creation of web browser

Aim

What is the objective of the Script
The objective of the script is to build a low functionality web browser

Details

What the features will your script have
By this script we will be having some basic functionality of the web browser like searching the web

@avinashkranjan would like to make this as part of swoc

Sure @Sloth-Panda Go ahead...


Font cache causing memory leak

Ebitengine Version
master
Operating System

[ ] Windows
[ ] macOS
[X] Linux
[ ] FreeBSD
[ ] OpenBSD
[ ] Android
[ ] iOS
[ ] Nintendo Switch
[ ] PlayStation 5
[ ] Xbox
[ ] Web Browsers

Go Version (go version)
1.23
What steps will reproduce the problem?
When calling
text.DrawWithOptions(screen, "some text", myFace, opts)

Font is cached here
I'm working on an application using a lot of various fonts and I can't keep all of them loaded.
What is the expected result?
Memory usage remains stable.
What happens instead?
Memory is leaking.
Anything else you feel useful to add?
I couldn't find a way to clear this cache.
Here is what I found when debugging the memory usage:

For now, I'm solving the issue like this:
//go:linkname FontCache github.com/hajimehoshi/ebiten/v2/text.faceWithCacheCache
var FontCache map[font.Face]any

func switchFont() {
     // loading new one, removing old one, and then clear ebiten cache
     delete(FontCache, oldFont)
}

https://github.com/hajimehoshi/ebiten/issues/498