This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Graham168
Graham168

Hi Everyone, has anyone managed to get October running on a Laravel Forge server?

I'm installing via the installer script, permissions are fine but nothing I do/change will allow OctoberCMS to connect to the empty database I've created in MySQL.

As a test I've created a new MySQL user that has permissions to do everything from anywhere but in the October installation screen I'm still getting:

Connection failed: SQLSTATE[HY000] [2002] Connection refused There is a problem with the specified Database configuration.

Anyone have any suggestions what to try next?

Thanks

Scott
Scott

I have had no problems running October on Digital Ocean/Forge. There is probably a problem with the database or user you set up. Have you tried connecting to the database using something other than the installer script to see if it works?

Here is how I go about the database setup on my Forge server. You could give this a try, it works fine for me.

  1. Connect via SSH using Heidi SQL.
  2. Create a database.
  3. Create a username for that database, using a randomly generated password.
  4. Plug the DB and login credentials into the October installer.
Graham168
Graham168

thanks for the response Scott. I'm doing pretty much as you suggest except I'm using Sequel pro over SSH to my Forge server.

No problem authenticating and viewing the database from the SequelPro side, it's just authenticating from the installer that has issues.

I might give it another go later today.

Colbydude
Colbydude

I'm actually having a similar issue as well. However this is the error I'm getting: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

It appears to be wanting to use the root account for connecting to the database rather than what I provided in the installer? I've tried with both the provisioned forge user and a user I created, with the same results.

Output from the log file:

.============================ POST REQUEST ==========================.
[2015/05/28 07:51:02] Postback payload: Array
(
    [step] => createAdmin
    [meta] => Array
        (
            [core] => Array
                (
                    [hash] => 0abac4a0732cf88e3c987c1d6c1f1d8e
                    [build] => 259
                    [uhash] => 4c89c19aaecb9efe116df793bdc99055
                )

        )

    [db_type] => mysql
    [db_host] => localhost
    [db_port] => 
    [db_name] => doomroomlafayette
    [db_user] => forge
    [db_pass] => *******
    [admin_first_name] => Admin
    [admin_last_name] => Person
    [admin_email] => *******@*****.com
    [admin_login] => admin
    [admin_password] => *******
    [admin_confirm_password] => *******
    [backend_uri] => /backend
    [encryption_code] => *******
    [file_mask] => 777
    [folder_mask] => 777
    [handler] => onInstallStep
)

[2015/05/28 07:51:02] Install step: createAdmin
[2015/05/28 07:51:02] Handler error (onInstallStep): SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
[2015/05/28 07:51:02] Trace log:
#0 /home/forge/new.doomroomlafayette.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct('mysql:host=loca...', 'root', '', Array)
#1 /home/forge/new.doomroomlafayette.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(20): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#2 /home/forge/new.doomroomlafayette.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(58): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#3 /home/forge/new.doomroomlafayette.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(47): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array)
#4 /home/forge/new.doomroomlafayette.com/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(177): Illuminate\Database\Connectors\ConnectionFactory->make(Array, 'mysql')
#5 /home/forge/new.doomroomlafayette.com/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(65): Illuminate\Database\DatabaseManager->makeConnection('mysql')
#6 /home/forge/new.doomroomlafayette.com/plugins/bedard/debugbar/vendor/illuminate/support/Facades/Schema.php(26): Illuminate\Database\DatabaseManager->connection()
#7 /home/forge/new.doomroomlafayette.com/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(118): Illuminate\Support\Facades\Schema::getFacadeAccessor()
#8 /home/forge/new.doomroomlafayette.com/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(202): Illuminate\Support\Facades\Facade::getFacadeRoot()
#9 /home/forge/new.doomroomlafayette.com/modules/system/classes/UpdateManager.php(121): Illuminate\Support\Facades\Facade::__callStatic('hasTable', Array)
#10 /home/forge/new.doomroomlafayette.com/modules/system/classes/UpdateManager.php(121): Illuminate\Support\Facades\Schema::hasTable('migrations')
#11 /home/forge/new.doomroomlafayette.com/install_files/php/Installer.php(512): System\Classes\UpdateManager->update()
#12 /home/forge/new.doomroomlafayette.com/install_files/php/Installer.php(369): Installer->createAdminAccount()
#13 /home/forge/new.doomroomlafayette.com/install_files/php/Installer.php(48): Installer->onInstallStep()
#14 /home/forge/new.doomroomlafayette.com/install_files/php/boot.php(74): Installer->__construct()
#15 /home/forge/new.doomroomlafayette.com/install.php(1): include('/home/forge/new...')
#16 {main}
jfo
jfo

For future reference, I'm successfully deploying OctoberCMS using Forge for more than a month now without any issues.

Here is my deployment script:

cd /home/forge/mysite.example.com
git pull origin master
composer install --no-interaction --no-dev --prefer-dist
php artisan october:up

Also, I'm ignoring modules folder on my .gitignore file.

Hope this helps someone as I couldn't find any reference when I started and spent days to figure that out myself.

abass
abass

jfo said:

For future reference, I'm successfully deploying OctoberCMS using Forge for more than a month now without any issues.

Here is my deployment script:

cd /home/forge/mysite.example.com
git pull origin master
composer install --no-interaction --no-dev --prefer-dist
php artisan october:up

Also, I'm ignoring modules folder on my .gitignore file.

Hope this helps someone as I couldn't find any reference when I started and spent days to figure that out myself.

Appreciate that. Wasn't aware that I could get away with having modules in the .gitignore.

What exactly do you have in your .gitignore?

This is what mine looks like at the moment, would love to know what else is unnecessary:

/bootstrap/compiled.php
/vendor
/node_modules
/plugins
/modules
.DS_Store
Thumbs.db
.idea
*.log
*.ini
selenium.php
.env.*.php
.env.php
rss.xml

(not sure why some things like /bootstrap/compiled.php are even in there when I have never once seen that file appear, but I am pretty sure it came default in the gitignore.)

Thanks @jfo !

info14532
info14532

We struggled with Quick Deploy on Forge and had to admin defeat so this is how Leader Internet do it. We actually spent a lot of time and that's the best solution we came up with. It's pretty seamless once set up and still allows you to retain all the other features of forge that we couldn't live without

abass
abass

info14532 said:

We struggled with Quick Deploy on Forge and had to admin defeat so this is how Leader Internet do it. We actually spent a lot of time and that's the best solution we came up with. It's pretty seamless once set up and still allows you to retain all the other features of forge that we couldn't live without

Why use DeployHQ when auto deployment is baked right into Forge? That seems very redundant.

info14532
info14532

With October treating content as code, clients editing or creating pages on production changes files directly on the server. These live edits then cause conflicts when Forge tries to auto deploy.

Have you used forge auto deploy to push your October instance from local to production?

abass
abass

info14532 said:

With October treating content as code, clients editing or creating pages on production changes files directly on the server. These live edits then cause conflicts when Forge tries to auto deploy.

Have you used forge auto deploy to push your October instance from local to production?

Yes, we just have our client's sites do an hourly/nightly push to a "production" branch. We have "master" set up to auto deploy so when locally editing, we pull in the changes from production and make changes locally and then when we are good to go, we push changes to Master which pushes it up to the server.

E.g. the server updates get pushed to the production branch. We try to do most of our editing on the server when possible, but when we have to locally edit we pull from production, make changes, and then push to master which auto-deploys to the server.

info14532
info14532

We try to do most of our editing on the server when possible

That sounds like a dangerous strategy. Have any production edits ever broke the site?

One of our client sites is a high traffic domain so we just can't take that risk. In fact we lock them out of the CMS tab on production unless they are a super admin user. We try to do everything locally except actual content things like changing meta data and uploading images.

Do you use a cron or plugin to configure your servers to push to the master branch? We load balance that site across nodes so we'd have a bit more work to get a server push operating.

When your clients server updates are pushed to the production branch does it go through any unit testing or CI tool?

This very discussion proves there is no standard way of handling local dev/deployments. What works for us may not be an option for others. There's definitely scope for collaboration to find a universal approach and I'm interested in hearing all the methods.

1-11 of 11

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.