Skip to content

Unable to use the Database option with Statamic CLI 3.6.0 - Receive FATAL ERROR #96

@bzerangue

Description

@bzerangue

I am having problems with the Statamic CLI setting up a new website with a database.

I am running Statamic CLI 3.6.0 on macOS 15.3 running Laravel Herd 1.14.1, using php 8.3 (since php 8.4 has all the deprecated warnings with the one of the dependencies).

The following happens after I go through the steps of creating a new site via the CLI, I am able to create a super user and then, when it would normally prompt me for what repositories or sections that I want to be moved to the Database, it doesn't show me those options and it gives me the fatal error. Nothing is moved to the database.

Fatal error: Uncaught Error: Call to undefined function Statamic\Cli\Concerns\collect() in /Users/user/.composer/vendor/statamic/cli/src/Concerns/ConfiguresDatabase.php:18
Stack trace:
#0 /Users/user/.composer/vendor/statamic/cli/src/NewCommand.php(599): Statamic\Cli\NewCommand->promptForDatabaseOptions()
#1 /Users/user/.composer/vendor/statamic/cli/src/NewCommand.php(146): Statamic\Cli\NewCommand->configureDatabaseConnection()
#2 /Users/user/.composer/vendor/symfony/console/Command/Command.php(279): Statamic\Cli\NewCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /Users/user/.composer/vendor/symfony/console/Application.php(1076): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /Users/user/.composer/vendor/symfony/console/Application.php(342): Symfony\Component\Console\Application->doRunCommand(Object(Statamic\Cli\NewCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /Users/user/.composer/vendor/symfony/console/Application.php(193): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /Users/user/.composer/vendor/statamic/cli/bin/statamic(29): Symfony\Component\Console\Application->run()
#7 /Users/user/.composer/vendor/bin/statamic(119): include('/Users/bmz/.com...')
#8 {main}
  thrown in /Users/user/.composer/vendor/statamic/cli/src/Concerns/ConfiguresDatabase.php on line 18

NOTE: Same error happens with PHP 8.4, except we have all the deprecated errors with the the thecodingmachine/safe dependency that the laragraph/utils dependency is using. And I can't tell which Statamic dependency is using the laragraph/utils dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions