spotify / XCMetrics

XCMetrics is the easiest way to collect Xcode build metrics and improve developer productivity.
https://xcmetrics.io
Other
1.1k stars 77 forks source link

Fatal error: No Queues driver configured #79

Closed ctreffs closed 1 year ago

ctreffs commented 2 years ago

We encountered an issue trying to deploy the latest XCMetrics backend docker image via Google Could Run and are unable to resolve it.

Environment:

Env variables are set to

Google Could Run docker image start failed

{
"textPayload": "Fatal error: No Queues driver configured. Configure with app.queues.use(...): file Queues/Application+Queues.swift, line 67",
"insertId": "***",
"resource": {
"type": "cloud_run_revision",
"labels": {
"revision_name": "xcmetrics-00004-soz",
"project_id": "***",
"configuration_name": "xcmetrics",
"location": "europe-west1",
"service_name": "xcmetrics"
}
},
"timestamp": "2022-01-27T09:53:07.063545Z",
"labels": {
"instanceId": "***"
},
"logName": "***/logs/run.googleapis.com%2Fstderr",
"receiveTimestamp": "2022-01-27T09:53:07.067705330Z"
}

Any idea what we could be doing wrong?

mustiikhalil commented 1 year ago

Good evening,

Hope you are doing well. It seems that we are also facing this issue and after a long debugging session we found out that this might be an error in the documentation, however we aren't really sure. I tried running the project locally to reproduce the error logs we are facing in the server, and this is what we found:

docker error (server error):

xcmetrics-xcmetrics-s-job-1  | 0x40047ed97f
xcmetrics-xcmetrics-s-job-1  | 0x400382917b
xcmetrics-xcmetrics-s-job-1  | 0x4000d6390f, (extension in Queues):Vapor.Application.Queues.driver.getter : Queues.QueuesDriver at /build/.build/checkouts/queues/Sources/Queues/Application+Queues.swift:67
xcmetrics-xcmetrics-s-job-1  | 0x4000d6390f, (extension in Queues):Vapor.Application.Queues.queue(_: Queues.QueueName, logger: Swift.Optional<Logging.Logger>, on: Swift.Optional<NIOCore.EventLoop>) -> Queues.Queue at /build/.build/checkouts/queues/Sources/Queues/Application+Queues.swift:91
xcmetrics-xcmetrics-s-job-1  | 0x4000d63585, (extension in Queues):Vapor.Application.Queues.queue.getter : Queues.Queue at /build/.build/checkouts/queues/Sources/Queues/Application+Queues.swift:61
xcmetrics-xcmetrics-s-job-1  | 0x40011ea3a6, XCMetricsBackendLib.routes(Vapor.Application) throws -> () at /build/Sources/XCMetricsBackendLib/Config/routes.swift:58
xcmetrics-xcmetrics-s-job-1  | 0x40011e8c7f, XCMetricsBackendLib.configure(Vapor.Application) throws -> () at /build/Sources/XCMetricsBackendLib/Config/configure.swift:125
xcmetrics-xcmetrics-s-job-1  | 0x40011ac1c6, main at /build/Sources/XCMetricsBackend/main.swift:27
xcmetrics-xcmetrics-s-job-1  | 0x40061cfc86
xcmetrics-xcmetrics-s-job-1  | 0x400022b2e9
xcmetrics-xcmetrics-s-job-1  | 0xffffffffffffffff
xcmetrics-xcmetrics-s-job-1  | qemu: uncaught target signal 4 (Illegal instruction) - core dumped

and that's also reproducible on local machines, by using the following env variables, where the crash accures because of app.queues.use(...) not being set. And that's due to XCMETRICS_USE_ASYNC_LOG_PROCESSING being set to 0 which is required by the queues library.

Screenshot 2022-10-12 at 6 50 46 PM

@ecamacho

cc: @joeboyscout04 @bogren