Couldn't start apache and other bitnami services

Keywords: WordPress - AWS - Technical issue - Services (Apache, MariaDB, MySQL…)

bnsupport ID: 835b3a1b-fe12-9ca5-a3ee-a80f79ea800a

bndiagnostic output:

? Apache: Found possible issues
? Connectivity: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/general/faq/administration/use-firewall/

bndiagnostic failure reason: The documentation did not make any significant change

Description:
Frontend shows database connection error
even the debug log shows there is some error with wp-db.php file
I have increased the AWS EBS Volume but it’s still the same

Hey
Please help me with this as I’m stuck with it.

Hi @vasireddybharatsai,

The php-fpm log shows the following error:

   [20-Dec-2021 17:51:13] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it 

Do you have any WordPress plugins installed that could slow down script execution? Is it a fresh installation?

Regards,
Michiel

It’s not a fresh installation. It has over 500 posts. I’m not sure which plugin is causing the issue. Can yiu let me know the command to increase the value

thanks

I have edited the file www.conf and changed pm=dynamic to pm=ondemand but still its the same

Hi @vasireddybharatsai,

I suggest disabling all plugins:

wp plugins deactivate --all

And then enable them one by one to check which one is causing the issue.

Best regards,
Michiel

Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /opt/bitnami/wordpress/wp-includes/wp-db.php on line 1653

Error: Error establishing a database connection.

Hello @vasireddybharatsai,

Checking your configuration, it seems you are experiencing some errors with ctlscript and it is not retrieving info on whether the database is running or not. Please first restart you machine and then check all the processes are running correctly inside the machine:

sudo /opt/bitnami/ctlscript.sh status
sudo /opt/bitnami/ctlscript.sh restart

Any issues with the daemon initialization should be solved with sudo gonit reload or sudo gonit. Please first restart the instance and then run execute these commands::

$ sudo gonit
daemon with PID 1558 awakened

If the database is unable to start, it may be caused by an error with MariaDB. Our bndiagnostic tool could not retrieve the database logs, could you please share with us the output of the following command:

sudo tail -n 30 /opt/bitnami/mariadb/logs/mysqld.log

Regards,
Francisco de Paz

This is what I got after running sudo gonit

daemon with PID 1178 awakened

I have got this log from the last command sudo tail -n 30 /opt/bitnami/mariadb/logs/mysqld.log

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on

The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.

We think the query pointer is invalid, but we will try to print it anyway. 
Query: 

Writing a core file...
Working directory at /bitnami/mariadb/data
Resource Limits:
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            8388608              unlimited            bytes     
Max core file size        0                    unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             7793                 7793                 processes 
Max open files            32184                32184                files     
Max locked memory         67108864             67108864             bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       7793                 7793                 signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        
Core pattern: core

I have got a new code from Bitnami Diagnostic tool

138c0b76-76a7-a030-8ab7-84ba48365b5d

Hello @vasireddybharatsai,

Checking you bndiagnostic, it is warning you that the mariadb process is not running, could you please start it and check whether that solves the issue?

[Processes]

One or more component's processes are not running:

mariadb not running

You can try to restart the process with the following command:

 $ sudo /opt/bitnami/ctlscript.sh start COMPONENT_NAME

If the issue persists, please share again the lines from running:

sudo tail -n 30 /opt/bitnami/mariadb/logs/mysqld.log

Regards,
Francisco de Paz

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on

The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.

We think the query pointer is invalid, but we will try to print it anyway.
Query:

Writing a core file…
Working directory at /bitnami/mariadb/data
Resource Limits:
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 7793 7793 processes
Max open files 32184 32184 files
Max locked memory 67108864 67108864 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 7793 7793 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Core pattern: core

This is what I got

Hello @vasireddybharatsai,

Did you restart the mariadb process before checking its logs? It seems strange that there was no change in them. Could you please share the console output of running it:

sudo /opt/bitnami/ctlscript.sh start mariadb

Regards,
Francisco de Paz

Hello @vasireddybharatsai,

We’ll need to review the database logs in detail for any more info. Could you run again our bndiagnostic tool for a new code and paste here the generated code?

As the database logs are too big for our tool to retrieve, please share with us the whole mysqld.log file. To do so, you’ll need to manually upload it to a file-sharing service and send me the download link as explained here:

https://docs.bitnami.com/general/how-to/understand-bndiagnostic/#manually-upload-the-bitnami-diagnostic-tool-bundle

Regards,
Francisco de Paz