<p>This was due to the following problems on the system, some where 'gotchas' and some were just generic mistakes on my part. Putting this as an answer to help others.</p>

<ol>
<li><strong>Nanobox's <code>boxfile.yml</code></strong> was classing anything that was in <code>storage/logs/web.log</code> as an <code>[error]</code> but obviously, it's not an error but rather a stack trace. This was fixed by changing it to the following within the boxfile:</li>
</ol>

<pre><code>    craft[stacktrace]: /app/storage/logs/web.log
    craft[error]: /app/storage/logs/phperrors.log
    php[error]: /data/var/log/php/php_error.log
    php[fpm]: /data/var/log/php-fpm.log
</code></pre>

<ol start="2">
<li><strong>db.php <code>driver</code> was set to <code>mysql</code></strong> when it was using postgres as a database. Changing it to the following 1/2 fixed the problem of installing.</li>
</ol>

<p><code>'driver'      =&gt; 'pgsql'</code></p>

<ol start="3">
<li><code>.env</code> was correctly set to <code>DB_DRIVER="pgsql"</code> but obviously this didn't match up to what my database was booting up as. This was the final piece of the puzzle.</li>
</ol>

<p>Essentially the learning from this was make sure your <code>db.php</code> is nicely matched up to your <code>.env</code> file especially regarding your database structure. Make sure you properly set your logs to report as the correct things. As you can see above there are numerous log's craft reports into. </p>

CC BY-SA 4.0
2019-03-04T15:07:14.740Z
2019-03-04T15:07:14.740Z
JMKelley
<p>Getting Numerous errors when trying to test a staging environment with Craft 3.1. States <code>Install Failed - Check Logs</code> which I have and I'm seeing the following logs being given. I don't understand what's causing this problem at all. </p>

<p>When the server starts, it presents me with the following error repeated many times:</p>

<pre><code>data.db (postgresql[daemon]) ::  STATEMENT:  INSERT INTO "resourcepaths" ("path", "hash") VALUES ($1, $2)
data.db (postgresql[daemon]) ::  ERROR:  relation "resourcepaths" does not exist at character 13
</code></pre>

<p>Then when I head through the install window it presents me with the following error outputs in the link below (was too much to paste here)</p>

<p><a href="https://paste.ee/p/lrFsi" rel="nofollow noreferrer">https://paste.ee/p/lrFsi</a></p>

<p><strong>db.php</strong></p>

<pre><code>&lt;?php

 return [
     'driver'      =&gt; 'pgsql',
     'server'      =&gt; $_ENV['DATA_DB_HOST'],
     'user'        =&gt; $_ENV['DATA_DB_USER'],
     'password'    =&gt; $_ENV['DATA_DB_PASS'],
     'database'    =&gt; 'gonano',
     'schema'      =&gt; 'public',
     'tablePrefix' =&gt; '',
     'port'        =&gt; 5432
 ];
</code></pre>

<p><strong>.env</strong></p>

<pre><code># The database driver that will be used ('mysql' or 'pgsql')
DB_DRIVER="pgsql"

# The database server name or IP address (usually this is 'localhost' or '127.0.0.1')
DB_SERVER="localhost"

# The database username to connect with
DB_USER="root"

# The database password to connect with
DB_PASSWORD=""

# The name of the database to select
DB_DATABASE=""

# The database schema that will be used (PostgreSQL only)
DB_SCHEMA="public"

# The prefix that should be added to generated table names (only necessary if multiple things are sharing the same database)
DB_TABLE_PREFIX=""

# The port to connect to the database with. Will default to 5432 for PostgreSQL and 3306 for MySQL.
DB_PORT=""
</code></pre>

<p><strong>Composer.json</strong></p>

<pre><code>{
  "require": {
    "craftcms/cms": "3.1.15",
    "craftcms/redactor": "2.3.2",
    "lukeyouell/craft-fetch": "1.2.0",
    "nystudio107/craft-seomatic": "3.1.44",
    "verbb/feed-me": "3.1.10",
    "verbb/feed-me-pro": "3.0.4",
    "vlucas/phpdotenv": "^2.4.0"
  },
  "autoload": {
    "psr-4": {
      "modules\\": "modules/"
    }
  },
  "config": {
    "sort-packages": true,
    "optimize-autoloader": true,
    "platform": {
      "php": "7.0"
    }
  },
  "scripts": {
    "post-root-package-install": [
      "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ]
  }
}
</code></pre>

<p><strong>Project.yaml</strong></p>

<p><a href="https://paste.ee/p/VkgNe#F3NWs50GBWk0M1B7AgmQDuVphbDcwRau" rel="nofollow noreferrer">https://paste.ee/p/VkgNe#F3NWs50GBWk0M1B7AgmQDuVphbDcwRau</a></p>

CC BY-SA 4.0
2019-03-02T16:16:30.533Z
Can you post your `composer.json`, `composer.lock`, and `config/project.yaml` (if it exists)?
Brandon Kelly
<database><install><installation><postgresql>
Install Failed - Numerous Errors when running with pgsql
# Install Failed - Numerous Errors when running with pgsql

(Asked by: username_0 on 2019-03-02)

Getting Numerous errors when trying to test a staging environment with Craft 3.1. States Install Failed - Check Logs which I have and I'm seeing the following logs being given. I don't understand what's causing this problem at all. 
When the server starts, it presents me with the following error repeated many times:
data.db (postgresql[daemon]) ::  STATEMENT:  INSERT INTO "resourcepaths" ("path", "hash") VALUES ($1, $2)
data.db (postgresql[daemon]) ::  ERROR:  relation "resourcepaths" does not exist at character 13

Then when I head through the install window it presents me with the following error outputs in the link below (was too much to paste here)
https://paste.ee/p/lrFsi
db.php
 'pgsql',
     'server'      => $_ENV['DATA_DB_HOST'],
     'user'        => $_ENV['DATA_DB_USER'],
     'password'    => $_ENV['DATA_DB_PASS'],
     'database'    => 'gonano',
     'schema'      => 'public',
     'tablePrefix' => '',
     'port'        => 5432
 ];

.env
# The database driver that will be used ('mysql' or 'pgsql')
DB_DRIVER="pgsql"

# The database server name or IP address (usually this is 'localhost' or '127.0.0.1')
DB_SERVER="localhost"

# The database username to connect with
DB_USER="root"

# The database password to connect with
DB_PASSWORD=""

# The name of the database to select
DB_DATABASE=""

# The database schema that will be used (PostgreSQL only)
DB_SCHEMA="public"

# The prefix that should be added to generated table names (only necessary if multiple things are sharing the same database)
DB_TABLE_PREFIX=""

# The port to connect to the database with. Will default to 5432 for PostgreSQL and 3306 for MySQL.
DB_PORT=""

Composer.json
{
  "require": {
    "craftcms/cms": "3.1.15",
    "craftcms/redactor": "2.3.2",
    "lukeyouell/craft-fetch": "1.2.0",
    "nystudio107/craft-seomatic": "3.1.44",
    "verbb/feed-me": "3.1.10",
    "verbb/feed-me-pro": "3.0.4",
    "vlucas/phpdotenv": "^2.4.0"
  },
  "autoload": {
    "psr-4": {
      "modules\\": "modules/"
    }
  },
  "config": {
    "sort-packages": true,
    "optimize-autoloader": true,
    "platform": {
      "php": "7.0"
    }
  },
  "scripts": {
    "post-root-package-install": [
      "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ]
  }
}

Project.yaml
https://paste.ee/p/VkgNe#F3NWs50GBWk0M1B7AgmQDuVphbDcwRau

**Tags:** database, install, installation, postgresql

> **Comments:**
> **username_1**: Can you post your `composer.json`, `composer.lock`, and `config/project.yaml` (if it exists)?  

---

## 1 answers

### Answer by username_0 on 2019-03-04. Score: 1 | Accepted answer

This was due to the following problems on the system, some where 'gotchas' and some were just generic mistakes on my part. Putting this as an answer to help others.

Nanobox's boxfile.yml was classing anything that was in storage/logs/web.log as an [error] but obviously, it's not an error but rather a stack trace. This was fixed by changing it to the following within the boxfile:

    craft[stacktrace]: /app/storage/logs/web.log
    craft[error]: /app/storage/logs/phperrors.log
    php[error]: /data/var/log/php/php_error.log
    php[fpm]: /data/var/log/php-fpm.log


db.php driver was set to mysql when it was using postgres as a database. Changing it to the following 1/2 fixed the problem of installing.

'driver'      => 'pgsql'

.env was correctly set to DB_DRIVER="pgsql" but obviously this didn't match up to what my database was booting up as. This was the final piece of the puzzle.

Essentially the learning from this was make sure your db.php is nicely matched up to your .env file especially regarding your database structure. Make sure you properly set your logs to report as the correct things. As you can see above there are numerous log's craft reports into.


---

