Kitware / CDash

An open source, web-based software testing server
http://www.cdash.org/
Other
218 stars 76 forks source link

503 Service unavailable #1883

Open rajeshwar1504 opened 11 months ago

rajeshwar1504 commented 11 months ago

I have followed the steps mentioned in CDASH documentation on Azure VM Ubunut 22.04 , But facing an issue while opening the URL in a browser.

Documentation URL - https://github.com/Kitware/CDash/blob/master/docs/install.md#php-modules

CDash Version - 3.1.0

Issue screenhot:

ErrorMesg

Configured below required software:

  1. Apach2 web server
  2. PostgreSQL version 14+238
  3. PHP 8.1.2 version and required modules
  4. npm version 8.19.4

Could you please share the suggestions/ detailed documentation to configure CDASH on ubuntu 22.04 machine?

Thanks, Reddy

williamjallen commented 11 months ago

There are many reasons why this might be happening, and it's hard to know without having more information. Is there any information in the logs?

rajeshwar1504 commented 11 months ago

Thank you for your response.

  1. I could see the below error message in the logs whenever i restart the Apache service.

[Mon Dec 18 00:00:23.515837 2023] [mpm_prefork:notice] [pid 500781] AH00171: Graceful restart requested, doing restart AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.xxx.xxx.xxx. Set the 'ServerName' directive globally to suppress this message.

  1. I commented reponse.send() line in /public/index.php file , i could see below php information on web browser.

index.php file

<?php
define('LARAVEL_START', microtime(true));
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);
#$response->send();
phpinfo();
?>

I could see php info on browser.

ErrorMesg2

Please let me know if you need more information.

Thank you.

williamjallen commented 11 months ago

That all looks normal. Was there anything in the CDash logs (storage/logs/*)?

rajeshwar1504 commented 11 months ago

I found the below error in the storage/logs/cdash-2023-11-28.log-old file.

Database error: [2023-11-28 15:44:49] production.ERROR: Database connection [postgres] not configured. {"exception":"[object] (InvalidArgumentException(code: 0): Database connection [postgres] not configured. at /CDash/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:173) [stacktrace]

I have configured the database in .env file like below , please check it once.

# database.php
DB_DATABASE=cdash_database
DB_CONNECTION=pgsql
DB_HOST=localhost
#DB_PORT=
DB_USERNAME=cdash
DB_PASSWORD=admin

Database query:

CREATE USER cdash WITH PASSWORD 'admin';
CREATE DATABASE cdash_database;
GRANT ALL PRIVILEGES ON DATABASE cdash_database TO cdash;

image

Please let me know your suggestions.

Thank you.

williamjallen commented 11 months ago

You have a configuration issue of some kind with your database. You could try setting the port: DB_PORT=5432

rajeshwar1504 commented 11 months ago

Observed the same issue on the browser (503 service unavailable) after setting up the port DB_PORT=5432

Performed below steps to proceed further.

Step:1 Updated CDash/config/database.php file for database configuration

'default' => env('DB_CONNECTION', 'pgsql'),

'pgsql' => [
            'driver' => 'pgsql',
            'host' => env('DB_HOST', 'localhost'),
            'port' => env('DB_PORT', 5432),
            'database' => env('DB_DATABASE', 'cdash_database'),
            'username' => env('DB_USERNAME', 'cdash'),
            'password' => env('DB_PASSWORD', 'admin'),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
            'search_path' => 'public',
            'sslmode' => 'prefer',
        ],

Step-2: Updated /etc/postgresql/14/main/pg_hba.conf file with below line to accept database connections

image

restarted postgresql service - systemctl restart postgresql restarted apache2 service - systemctl restart apache2.service

New log file is not getting generated under storage/logs/ folder to check other issues. image

Please let me know your suggestions.

Thank you.

rajeshwar1504 commented 10 months ago

Please suggest on the above issue?

Thanks, Rajesh.