Topics

Tribe Support

Tribe Support's Topics

Scott Crawford

Scott Crawford

1 week ago

Database connect error when moving to new file server but same database

Encounter a new error for me personally, looking for advice where to start looking further.After successfully getting Anahita running on a shared server I am trying to set up a production server on Amazon EC2.  On the EC2 instance I have successfully installed Apache, PHP 7.0, Composer, and used Composer to pull down Anahita.  When I attempt the site:init I am presented with the process to enter the database credentials.  All good so far.But, when I point the database credentials to the existing, known good database that already had Anahita working, I receive an error stating "(HY000/1045): Access denied for user '[user]' (using password: YES) in /var/www/html/anahita/vendor/anahita/anahita/tasks/site.task.php on line 165"Would this be indicative of something in php not being configured correctly?  The database itself is known to be good from having already used if for Anahita from another server.Any advice much appreciated!
  • 12 Comments
  • Last Comment by Scott Crawford
That seems like a php to MySQL database connection error. Does the php user have the right privileges to connect to MySQL database?
Scott Crawford
Scott Crawford
1 week ago Permalink
Thanks, I will definitely look into that further but I've since installed mySQL on the Amazon EC2 instance locally. I can proceed fully through the setup and view Anahita on the front-end BUT now it will not let me create the Super Administrator account.

The site:init is creating the tables in the database, so it seems the ability to write is functional. Does the init task communicate differently with the database than the front-end?
Rastin Mehr liked this
What happens when you try to create the first account via the user interface? Do you get any connection error between php and mysql?
Scott Crawford
Scott Crawford
1 week ago Permalink
After I complete the form and click the Sign up button, the page is redirected to /index.php/people/person, but the page is blank - only the navbar with the search box and "Login" button is generated. No connection errors are reported.

I can then inspect the tables in the mysql and although the tables are there (from the site:init), there are no records in the people_people table.

I don't think it's an Apache configuration - I've modified the httpd.conf file to enable modrewrite, and on the front-end I'm including index.php in the URL.

Aside from the signup, everything else seems to be working... I can navigate to /pages/examples and everything appears as it should.
is there a way you can get an error message from the system or in the php logs?
Scott Crawford
Scott Crawford
1 week ago Permalink
I turned on error reporting in Anahita's configuration.php, and the "blank screen" described above generates this:

Fatal error: Uncaught Error: Call to undefined function mb_strlen() in /var/www/html/anahita/vendor/anahita/anahita/src/libraries/anahita/helper/string.php:169 Stack trace: #0 /var/www/html/anahita/vendor/anahita/anahita/src/libraries/anahita/domain/validator/abstract.php(454): AnHelperString::strlen('1') #1 /var/www/html/anahita/vendor/anahita/anahita/src/libraries/anahita/domain/validator/abstract.php(221): AnDomainValidatorAbstract->_validateRequired(Object(AnConfig)) #2 /var/www/html/anahita/vendor/anahita/anahita/src/libraries/anahita/domain/validator/abstract.php(173): AnDomainValidatorAbstract->validateData(Object(ComPeopleDomainEntityPerson), Object(AnDomainAttributeProperty), true) #3 /var/www/html/anahita/vendor/anahita/anahita/src/components/com_people/domains/validators/person.php(53): AnDomainValidatorAbstract->validateEntity(Object(ComPeopleDomainEntityPerson)) #4 /var/www/html/anahita/vendor/anahita/anahita/src/libraries/anahita/domain/behavior/validatable.php(261): ComPeopleDomainValidatorPerson->validateE in /var/www/html/anahita/vendor/anahita/anahita/src/libraries/anahita/helper/string.php on line 169
Rastin Mehr liked this
Scott Crawford
Scott Crawford
1 week ago Permalink
Bingo! Seems I hadn't installed PHP's mbstring module. Later today I'll aim to document the steps to get this running and post as an article.
Rastin Mehr liked this
Good job! Yes, I'd appreciate it if you could document it, please. Ideally, we would want to deploy to AWS using propper release engineering tools, but that's a whole project on its own after the Anahita React app is ready.
Scott Crawford
Scott Crawford
1 week ago Permalink
One more on this... permissions on configuration.php seem to prevent me from saving changes to site settings. Default install set permissions to 664 - is this correct? Or could it be a user/group access privilege that needs to be changed?
Usually, when you are saving using Anahita, it writes into the configuration.php file and then sets the permissions to 664. Are you trying to edit the file manually in a text editor? If Anahita is not able to save, then there is a user/group access privilege issue that you need to fix.
Scott Crawford
Scott Crawford
1 week ago Permalink
I ended up changing the permissions to 666 and allowed me to retain settings from the front-end. I checked my other Anahita installations that did not exhibit this issue and the file permissions were all set to 444. But, those were on different servers with different users/groups. I'll look into the EC2 group assignments further, thanks!

Powered by Anahita