Skip to content

Docker container doesn't create SQLite database #744

@wolkenschieber

Description

@wolkenschieber

Description:

The Docker container for the project doesn't create the SQLite database as expected. Upon startup, the container runs a sed command to modify the telemetry_settings.php file, but this change doesn't align with the actual configuration line in the file. As a result, the SQLite database isn't created.

Steps to Reproduce:

  1. Run the Docker container for the librespeed/speedtest project.
  2. Observe the startup logs.
  3. Note that the sed command modifies the $Sqlite_db_file variable in telemetry_settings.php.
  4. Check the telemetry_settings.php file configuration for $Sqlite_db_file.
  5. Notice that the sed command does not match the line in the config.

Expected Behavior:

The sed command should properly update the $Sqlite_db_file variable to ensure the database is created at the correct location (/database/db.sql).

Actual Behavior:

The sed command attempts to replace the $Sqlite_db_file path, but the existing configuration in telemetry_settings.php is as follows:

// Sqlite3 settings  
$Sqlite_db_file = __DIR__ . '/../../speedtest_telemetry.db';

This mismatch prevents the database from being created at the correct location.

Possible Cause:

The sed command executed at container startup is:

sed -i 's/$Sqlite_db_file = '\''.*'\''/$Sqlite_db_file='\''\/database\/db.sql'\''/g' /var/www/html/results/telemetry_settings.php

This command tries to replace the $Sqlite_db_file value, but it doesn't account for the exact structure of the current line:

$Sqlite_db_file = __DIR__ . '/../../speedtest_telemetry.db';

Therefore, the database path isn't updated properly, leading to the failure of database creation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions