You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The current .env.docker.local.example has a different idea of what should be in METRICS than backend/packages/Upgrade/src/init/seed/initMetrics.ts. In the env, it is just a metrics array, but initMetrics expects an object containing a metrics and a contexts attribute. This causes MetricService.saveAllMetrics to be called with metrics=undefined, which instantly crashes the app.
cd ../../../ && mv ./backend/packages/Upgrade/.env.docker.local.example ./backend/packages/Upgrade/.env.docker.local
docker-compose -f singleContainerApp-docker-compose.yml up -d
Expected behavior
The backend starts up correctly.
Screenshots
Desktop (please complete the following information):
OS: macOS 14.1.1
Docker version 25.0.3, build 4debf41
Additional context
To fix this, I believe the .env.docker.local.example should have an updated METRICS that reflects its actual usage in the application. Additionally, in backend/packages/Upgrade/src/api/services/MetricService.ts, line 168, this line could be added:
private parseMetrics(metrics: Array<IGroupMetric | ISingleMetric>): IMetricUnit[] {
// add this line since this function gets called with undefined
if (!metrics) return [];
// ... rest of file
to prevent issues like this from completely crashing the backend.
The text was updated successfully, but these errors were encountered:
Version where bug was found:
dev latest (54de016)
Describe the bug
The current
.env.docker.local.example
has a different idea of what should be inMETRICS
thanbackend/packages/Upgrade/src/init/seed/initMetrics.ts
. In the env, it is just a metrics array, butinitMetrics
expects an object containing ametrics
and acontexts
attribute. This causesMetricService.saveAllMetrics
to be called withmetrics=undefined
, which instantly crashes the app.To Reproduce
Install the app:
Expected behavior
The backend starts up correctly.
Screenshots
Desktop (please complete the following information):
Additional context
To fix this, I believe the
.env.docker.local.example
should have an updatedMETRICS
that reflects its actual usage in the application. Additionally, in backend/packages/Upgrade/src/api/services/MetricService.ts, line 168, this line could be added:to prevent issues like this from completely crashing the backend.
The text was updated successfully, but these errors were encountered: