Installation Problem with DreamFactory beta

I downloaded DreamFactory beta from github.
completed composer install and even done composer update
then php argisan migrate and then php artisan db:seed
When I run the app using php artisan serve, it asks me to create a root account. When I submit my admin user details, it takes me to an error page with the following details

FatalErrorException in SplashController.php line 51:
Call to undefined method DreamFactory\Core\Components\Registrar::createFirstAdmin()
in SplashController.php line 51
at FatalErrorException->__construct() in HandleExceptions.php line 133
at HandleExceptions->fatalExceptionFromError() in HandleExceptions.php line 118
at HandleExceptions->handleShutdown() in HandleExceptions.php line 0
at SplashController->createFirstUser() in Controller.php line 256
at call_user_func_array:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:256}() in Controller.php line 256
at Controller->callAction() in ControllerDispatcher.php line 164
at ControllerDispatcher->call() in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}() in Pipeline.php line 139
at call_user_func:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}() in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103
at call_user_func:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack() in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch() in Route.php line 201
at Route->runWithCustomDispatcher() in Route.php line 134
at Route->run() in Router.php line 704
at Router->Illuminate\Routing\{closure}() in Pipeline.php line 139
at call_user_func:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}() in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103
at call_user_func:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in Router.php line 706
at Router->runRouteWithinStack() in Router.php line 671
at Router->dispatchToRoute() in Router.php line 631
at Router->dispatch() in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}() in Pipeline.php line 139
at call_user_func:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}() in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}() in HandleCors.php line 43
at HandleCors->handle() in Pipeline.php line 124
at call_user_func_array:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in FirstUserCheck.php line 43
at FirstUserCheck->handle() in Pipeline.php line 124
at call_user_func_array:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle() in Pipeline.php line 124
at call_user_func_array:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in StartSession.php line 62
at StartSession->handle() in Pipeline.php line 124
at call_user_func_array:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle() in Pipeline.php line 124
at call_user_func_array:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in EncryptCookies.php line 59
at EncryptCookies->handle() in Pipeline.php line 124
at call_user_func_array:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle() in Pipeline.php line 124
at call_user_func_array:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103
at call_user_func:{/home/mfissehaye/workspace/projects/dfactory/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in Kernel.php line 122
at Kernel->sendRequestThroughRouter() in Kernel.php line 87
at Kernel->handle() in index.php line 53
in server.php line 21
at {main}() in server.php line 0

What is going wrong?

I’m not familiar with php artisan serve.
After you seed the database you should just have to load the site in a web browser. It will walk you through creating the first admin.

You’ll want to check your Apache error logs to see if anything is generated there.
One problem I see a lot is the Apache process user not having write access to the public and storage directories.

Okay thank you @drewpearce. php artisan serve is a development server for Laravel. I don’t undersrtand the configurations on the Enable site section of the Install Debian Ubuntu guide. So I chose to just use the php artisan serve command. So please explain the apache configuration instead if you don’t recomment php artisan serve

I looked into the code and found out that SplashController is trying to call the createFirstAdmin function on a Registrar object at line number 51. The Registrar class doesn’t have that function. The createFirstAdmin function is only found in the User model inside vendor/dreamfactory/df-core/src/Models/User.php. And it is a static function. I tried replacing $registrar-> with User::createFirstAdmin to no success.

Code changes have been made recently in these areas. Are you on the latest build? Master or develop branch?

Thank you @jeffreystables
I pulled in the changes and faced yet another problem.
It successfully create the new user. It attempts to go to /dreamfactory/dist, shows an empty page and throws a RestException - Could not find a service for dreamfactory. Looking for issues on github, I learned that running composer install before setting up .env was the problem. So I did exactly the reverse. I setup .env before running composer install. But that didn’t solve the problem. It still throws the Rest Exception.

I checked with our engineers on this one. There shouldn’t be a need to edit the code or deviate from the install process to get this working. @aislam helped me review and reiterate the following steps. We tested this several times this morning.

  1. git clone https://github.com/dreamfactorysoftware/dreamfactory.git newInstall
  2. composer install --no-dev ( Run this inside newInstall/ directory. This will also copy .env-dist to .env and will run php artisan app:generate to generate the application key used for data encryption/decryption)
  3. Edit .env file to enter your database information. (Make sure an empty database exists with proper credentials )
  4. Make sure web server can write/read to/from storage/ and bootstrap/cache/ directories recursively.
  5. Launch the instance from the browser. It should greet you with a welcome and then run the migration/seeder to setup the database, followed by prompting you to create the first admin user.

Or if the first launch from browser not running the migrate and/or seeder properly then start the process again from beginning and after step 03 do the following…

…
4. run php artisan migrate
5. run php artisan db:seed
6. Make sure web server can write/read to/from storage/ and bootstrap/cache/ directories recursively.
7. Launch the instance from the browser. It will skip the welcome page and will prompt you to create the first admin user.

Setting the directory permissions right on both storage/ and bootstrap/cache/ is critical. This should be done after all command line setup actions and before launching the instance in the browser. Running command-line php artisan generates log files owned by the current user (not Apache) and therefore can prevent Apache from being able to write there.

Thanks @jeffreystables
I followed the exact same steps. But I am getting the same error.
The thing is I am using php artisan serve to serve the webpage. Can you test it with this development server and tell me what you found.
Thank you

Thank you @jeffreystables. I was finally able to get everything working using apache. May be there is a problem with the php artisan serve command.

Thank you for the continued support

We haven’t worked with php artisan serve before, but we’ll look into it. Glad you were able to get it working the same way we do.

php artisan serve works now. See the README here https://github.com/dreamfactorysoftware/dreamfactory/tree/develop (develop branch)

1 Like