Skip to content

createTelemetry crashes on none-shell host #8893

@hxhieu

Description

@hxhieu

Bug report

Describe the bug

When hosting Strapi on a none-shell host such as Google distroless container, the start up script will crash because node-machine is executing a shell script to get the machine ID.

Steps to reproduce the behavior

Like above

Expected behavior

Not crashing

Screenshots

If applicable, add screenshots to help explain your problem.

Code snippets

If applicable, add code samples to help explain your problem.

System

  • Node.js version: 12
  • NPM version: yarn v1.22.0
  • Strapi version: 3.3.4
  • Database: sqlite
  • Operating system: Windows 10

Additional context

According to this https://strapi.io/documentation/v3.x/getting-started/usage-information.html#commitment-to-our-users-data-collection, we can opt-out the telemetry but even that the code still try to execute node-machine get ID.
It should stop doing that if the consumer has chosen to opt-out

// lib/sevices/metrics/sender/js line 25

let deviceId = 'unknown'
// machineIdSync() will not work on none-shell host
// so we should disable it when opt-out telemetry
// https://strapi.io/documentation/v3.x/getting-started/usage-information.html#commitment-to-our-users-data-collection
if (uuid){
    deviceId = machineIdSync();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugIssue reporting a bugseverity: highIf it breaks the basic use of the productsource: core:strapiSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions