Error Writing to database

Error Writing to database

Woogon Chung -
回帖数:4

Hello everyone,

Can anyone give me a hint as to where I should look for a further help? 

I am using the Moodle v3.1+ 

The last error message log look as follows: -----------------

[Thu Dec 08 18:18:30.109326 2016] [mpm_prefork:notice] [pid 22048] AH00169: caught SIGTERM, shutting down

[Thu Dec 08 18:18:31.156523 2016] [ssl:warn] [pid 671] AH01909: RSA certificate configured for yustall.net:443 does NOT include an ID which matches the server name

[Thu Dec 08 18:18:31.199665 2016] [ssl:warn] [pid 672] AH01909: RSA certificate configured for yustall.net:443 does NOT include an ID which matches the server name

[Thu Dec 08 18:18:31.203172 2016] [mpm_prefork:notice] [pid 672] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.19 OpenSSL/1.0.1f configured -- resuming normal operations

[Thu Dec 08 18:18:31.203203 2016] [core:notice] [pid 672] AH00094: Command line: '/usr/sbin/apache2'

----------------------

Thank you all in advance.

Woogon


回复Woogon Chung

Re: Error Writing to database

Ken Task -
Particularly helpful Moodlers的头像

To fix check into how to set up a valid certificate for the server(s) involved.

One can generate a self-signed certificate, but users would have to add an exception to connect via https.   One needs to purchase a valid certificate from one of the Certificates of Authorities.

They all have directions on how to build a certificate request to file with them in order for them to build a valid certificate which they supply to you for installation on your server.

The following is a link to one CA ... as an example:

https://www.digicert.com/ssl-certificate-installation-ubuntu-server-with-apache2.htm

If you have a valid certificate, check into how to install properly via CA provider.

This:

RSA certificate configured for yustall.net:443 does NOT include an ID which matches the server name

Might indicate you are trying to use a localhost key with a CA cert - they need to be paired and match.  Part of creating a .pem is a process which one sets the host name for the cert ... localhost isn't the same as fqdn.com

A curl test for the URL you provided responds with:

curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.

If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).

''spirit of sharing', Ken

回复Ken Task

Re: Error Writing to database

Woogon Chung -

Hello Ken,

Thank you for your explanation. I am just letting you know that I have just renewed the expired Certificate and waiting for a renewed one.

Woogon

回复Ken Task

Re: Error Writing to database

Woogon Chung -

Hello Ken,

What do I understand incorrectly here? 

I thought the SSL Certificate is only used for https:// login page. But, the error I am getting is from creating a resource/activity as shown "Error Writing to database" as shown in the previous posting.

I will greatly appreciate it if you could provide me a clue on this my misunderstanding. 

Thank you, Ken.

Woogon Chung

回复Woogon Chung

Re: Error Writing to database

Ken Task -
Particularly helpful Moodlers的头像

Didn't see the previous posting ... it's not in this thread .... thus  was basing my response on the errors (really warnings) you found in your logs which said:

RSA certificate configured for yustall.net:443 does NOT include an ID which matches the server name

When I try to connect to site using Firefox and this url:
https://yustall.net
browser reports:
"An error occurred during a connection to yustall.net. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG"

When I try a command line test using curl:
curl -I https://yustall.net/
curl: (35) Unknown SSL protocol error in connection to yustall.net:-9847

In earlier versions of Moodle, there was an option to use 'secure login' which briefly flipped
the http:// urls of your site to https:// just for the login process.   In setting that up,
one had to make sure the web server would respond on port 443 - the default https port for most servers.   In a quick nmap scan of your server, that port is open ... but having issues responding.

Not sure that's offered as an option in Moodle any longer.

However, just tried something .... appears your Moodle is set up to respond to:
www.yustall.net/moodle/ ... or is that an older version? ... looks to be a 3.0 or a 2.9.

What is in the config.php file for the Moodle for $CFG->wwwroot?
That should have http://www.yustall.net/moodle for it to work.

If there is no issue with logging on but with something else when in Moodle, turn on debugging in the site and try whatever you were doing.    Then go back to the original posting linked below and include the text of the error (which is what the 'more info about this error' link said as one of the options to fix a 'error writing to the DB' error (which is pretty generic - thus the suggestion for Debugging output).

https://moodle.org/mod/forum/discuss.php?d=344100#p1387414

'spirit of sharing', Ken