Nc-init fails with SQLSTATE HY000 1045

[/details]

Nextcloud version the latest:
Operating system and version NextCloudPi_RPi_03-28-20/_:
Apache or nginx version Apache:
PHP version 7.3:

The issue you are facing:

The initialisation fails with this SQL statement 1045. i can’t get it to work after nc-init anymore

Is this the first time you’ve seen this error? (Y/N):No

Steps to replicate it:

  1. fresh install and try NC-INIT (NCP-CONFIG >> CONFIG >> NC-INIT)
  2. this will produce the same result and same error on my raspberry pi 4(multiple times tried with two different images (raspbian and nextcloudpi curl installation and the nextcloudpi installation from the image)

The output of your Nextcloud log in Admin > Logging:

Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'nextcloudu'@'localhost' (using password: YES) 

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = -1
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
disable_classes =
zend.enable_gc = On
expose_php = Off
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
sys_temp_dir = /var/www/nextcloud/data/tmp
enable_dl = Off
file_uploads = On
upload_tmp_dir = /var/www/nextcloud/data/tmp
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[CLI Server]
cli_server.color = On
[Date]
[filter]
[iconv]
[imap]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.default_socket=
[Phar]
[mail function]
smtp_port = 25
mail.add_x_header = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.cookie_samesite =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5
[Assertion]
zend.assertions = -1
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[dba]
[opcache]
[curl]
[openssl]

The output of your Apache/nginx/system log in /var/log/____:

[Sun May 03 07:02:42.415762 2020] [authz_host:error] [pid 1261:tid 2864677920] [client 192.168.1.6:49070] AH01753: access check of 'localhost' to /img/info.svg failed, reason: unable to get $
[Sun May 03 07:03:21.248294 2020] [authz_host:error] [pid 1261:tid 2864677920] [client 192.168.1.6:49070] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to $
[Sun May 03 07:03:46.281557 2020] [authz_host:error] [pid 1261:tid 2864677920] [client 192.168.1.6:49196] AH01753: access check of 'localhost' to /img/red-circle.svg failed, reason: unable t$
[Sun May 03 07:28:30.669440 2020] [mpm_event:notice] [pid 928:tid 3069633040] AH00493: SIGUSR1 received.  Doing graceful restart
[Sun May 03 07:28:30.693167 2020] [ssl:warn] [pid 928:tid 3069633040] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sun May 03 07:28:30.693337 2020] [ssl:error] [pid 928:tid 3069633040] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / ser$
[Sun May 03 07:28:30.693354 2020] [ssl:error] [pid 928:tid 3069633040] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sun May 03 07:28:30.694293 2020] [mpm_event:notice] [pid 928:tid 3069633040] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured -- resuming normal operations
[Sun May 03 07:28:30.694337 2020] [core:notice] [pid 928:tid 3069633040] AH00094: Command line: '/usr/sbin/apache2'

Is this such a hard question to answer? Am I missing info or anything to give in the post?

In my system, which is identical in structure, this error message keeps appearing. Despite searching the internet, I have not found a solution. :worried: :worried: :worried:

Maybe there is the possibility to give me / us a short solution.

Django43

Thanks for answering django43. It’s good to know I’m not the only one.

run and share output via pastebin or similar of

sudo ncp-report

My results

NextCloudPi diagnostics

NextCloudPi version  v1.25.0
NextCloudPi image    NextCloudPi_docker_04-05-20
distribution         Debian GNU/Linux 10 \n \l
automount            no
USB devices          none
datadir              /data/nextcloud/data
data in SD           no
data filesystem      ext2/ext3
data disk usage      3.6T/5.5T
rootfs usage         11G/95G
swapfile             /dev/sda5
dbdir                /data/database
Nextcloud check      ok
Nextcloud version    19.0.0.3
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               1day

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "11": "9...1...7...1..",
            "1": "1.....1....0.5.....",
            "5": "nextcloudpi.local",
            "7": "nextcloudpi",
            "8": "nextcloudpi.lan",
            "6": "1......1......1......3......",
            "22": "1.....1.....1......3.....",
            "12": "a.......s....s.de",
            "2": "nextcloud.local",
            "21": "a........spdns.d...."
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "19.0.0.3",
        "overwrite.cli.url": "https:\/\/a.......spdns.d....\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/var\/www\/nextcloud\/data\/tmp",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "updater.release.channel": "beta",
        "maintenance": false,
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": 2,
        "app_install_overwrite": [
            "previewgenerator",
            "nextcloudpi",
            "onlyoffice",
            "spreed",
            "fulltextsearch",
            "fulltextsearch_elasticsearch",
            "files_fulltextsearch",
            "files_fulltextsearch_tesseract",
            "documentserver_community",
            "documents",
            "ocr",
            "bookmarks_fulltextsearch"
        ],
        "onlyoffice": {
            "verify_peer_off": true
        },
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Image",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\SVG",
            "OC\\Preview\\Font",
            "OC\\Preview\\MP3",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MKV",
            "OC\\Preview\\MP4",
            "OC\\Preview\\AVI"
        ]
    }
}

HTTPd logs

[Sat May 09 15:01:44.216898 2020] [ssl:warn] [pid 91:tid 139816861783168] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sat May 09 15:01:44.229410 2020] [ssl:warn] [pid 92:tid 139816861783168] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sat May 09 15:01:44.231073 2020] [mpm_event:notice] [pid 92:tid 139816861783168] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Sat May 09 15:01:44.231136 2020] [core:notice] [pid 92:tid 139816861783168] AH00094: Command line: '/usr/sbin/apache2'
[Sun May 10 19:16:56.932191 2020] [authz_core:error] [pid 94:tid 139816301696768] [client 83.97.20.35:40113] AH01630: client denied by server configuration: /var/www/ncp-web/
[Mon May 11 07:58:39.615922 2020] [mpm_event:notice] [pid 92:tid 139816861783168] AH00492: caught SIGWINCH, shutting down gracefully
[Mon May 11 07:59:15.802583 2020] [ssl:warn] [pid 91:tid 140464659854464] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon May 11 07:59:15.811774 2020] [ssl:warn] [pid 92:tid 140464659854464] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon May 11 07:59:15.812744 2020] [mpm_event:notice] [pid 92:tid 140464659854464] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Mon May 11 07:59:15.812767 2020] [core:notice] [pid 92:tid 140464659854464] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 11 17:38:04.695144 2020] [authz_host:error] [pid 93:tid 140464204273408] [client 223.71.167.164:31356] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Mon May 11 17:38:04.695191 2020] [authz_core:error] [pid 93:tid 140464204273408] [client 223.71.167.164:31356] AH01630: client denied by server configuration: /var/www/ncp-web/
[Mon May 11 22:41:56.497774 2020] [authz_core:error] [pid 94:tid 140464212666112] [client 80.82.77.33:33912] AH01630: client denied by server configuration: /var/www/ncp-web/
[Mon May 11 22:42:01.280353 2020] [authz_core:error] [pid 94:tid 140464204273408] [client 80.82.77.33:37754] AH01630: client denied by server configuration: /var/www/ncp-web/favicon.ico
[Mon May 11 23:02:35.251266 2020] [authz_core:error] [pid 94:tid 140463608686336] [client 34.78.211.173:20238] AH01630: client denied by server configuration: /var/www/ncp-web/
[Tue May 12 08:17:02.840288 2020] [mpm_event:notice] [pid 92:tid 140464659854464] AH00492: caught SIGWINCH, shutting down gracefully
[Tue May 12 08:17:38.148901 2020] [ssl:warn] [pid 91:tid 140204972143744] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue May 12 08:17:38.159002 2020] [ssl:warn] [pid 92:tid 140204972143744] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue May 12 08:17:38.160065 2020] [mpm_event:notice] [pid 92:tid 140204972143744] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Tue May 12 08:17:38.160086 2020] [core:notice] [pid 92:tid 140204972143744] AH00094: Command line: '/usr/sbin/apache2'

Database logs

2020-05-12  8:17:38 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-05-12  8:17:38 0 [Note] InnoDB: 10.3.22 started; log sequence number 6339928827; transaction id 10671049
2020-05-12  8:17:38 0 [Note] InnoDB: Loading buffer pool(s) from /data/database/ib_buffer_pool
2020-05-12  8:17:38 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-05-12  8:17:39 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-05-12  8:17:39 0 [Note] Reading of all Master_info entries succeeded
2020-05-12  8:17:39 0 [Note] Added new Master_info '' to hash table
2020-05-12  8:17:39 0 [Note] mysqld: ready for connections.
Version: '10.3.22-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2020-05-12  8:17:44 0 [Note] InnoDB: Buffer pool(s) load completed at 200512  8:17:44
2020-05-12  8:17:49 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
2020-05-12  8:17:49 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-05-12  8:17:49 0 [Note] InnoDB: FTS optimize thread exiting.
2020-05-12  8:17:49 0 [Note] InnoDB: Starting shutdown...
2020-05-12  8:17:49 0 [Note] InnoDB: Dumping buffer pool(s) to /data/database/ib_buffer_pool
2020-05-12  8:17:49 0 [Note] InnoDB: Buffer pool(s) dump completed at 200512  8:17:49
2020-05-12  8:17:52 0 [Note] InnoDB: Shutdown completed; log sequence number 6339928836; transaction id 10671068
2020-05-12  8:17:52 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-05-12  8:17:52 0 [Note] mysqld: Shutdown complete


Nextcloud logs
{"reqId":"0fdQQjsJcqCHsG4mcFaA","level":2,"time":"2020-05-13T06:30:13+00:00","remoteAddr":"","user":"--","app":"appstoreFetcher","method":"","url":"--","message":"Could not connect to appstore: cURL error 28: Operation timed out after 10001 milliseconds with 2279435 out of 4857053 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)","userAgent":"--","version":"19.0.0.3"}

Thanks a lot

Django43

Looks like you are restoring from a docker instance?!

Latest stable version for NCP v1.24.0 is NC 18.0.4
So you are ahead of us there. Which tool did you use to upgrade, NC’s built in update tool or NCP’s nc-update-nc ?

I entered the data path during the installation.

I updated Nextcloud to 19.0.2 Beta via Nextcloud.

many Greetings

Django43

hoi,

sorry i dd’d my nextcloudpi SD card. i’m going to install it again. Let’s see what happens and if i can reproduce the error a third time.

I luckily found the NCP report although i dd’d it.

https://paste.rs/jB6

@OliverV

Maybe you have some solutions ?

Greetings

Django43

Better to use nc-update-nextcloud according ncp docs
Also, it creates a backup before proceeding , in case something goes wrong during the upgrade process.