Notes app unable to write to owncloud/data \\OC\\DB\\Connection method error

Steps to reproduce

  1. Create or modify Note using Owncloud/Nextcloud note app
    2.
    3.

Expected behaviour

Tell us what should happen
Note gets created or modified

Actual behaviour

Tell us what happens instead
Note doesn't get created or modified

Server configuration

Operating system:
Debian 9.3
Web server:
Apache 2.4.25
Database:
mysql 5.5.9999+default
PHP version:
PHP 7.0.19-1
ownCloud version: (see ownCloud admin page)
owncloud 10.0.4
Updated from an older ownCloud or fresh install:
Updated
Where did you install ownCloud from:
Owncloud repository
Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.
```{
    "system": {
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\APCu",
        "datadirectory": "\/owncloud\/data",
        "dbtype": "mysql",
        "version": "10.0.4.4",
        "dbname": "owncloud",
        "dbhost": "127.0.0.1",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "51fd43f569747",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "theme": "",
        "maintenance": false,
        "forcessl": true,
        "maxZipInputSize": 838860800,
        "allowZipDownload": true,
        "log_type": "syslog",
        "logfile": "",
        "loglevel": 2,
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "secret": "***REMOVED SENSITIVE VALUE***",
        "updatechecker": false,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "trashbin_retention_obligation": "auto",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "singleuser": false
    }
}


**List of activated apps:**

```
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.
```
Enabled:
  - activity: 2.3.6
  - calendar: 1.5.4
  - comments: 0.3.0
  - configreport: 0.1.1
  - contacts: 1.5.3
  - dav: 0.3.2
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.1
  - files_external: 0.7.1
  - files_sharing: 0.10.1
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 16.0.2
  - market: 0.2.3
  - notes: 2.3.2
  - notifications: 0.3.2
  - provisioning_api: 0.5.0
  - qownnotesapi: 17.7.0
  - systemtags: 0.3.0
  - templateeditor: 0.1
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - external
  - theme-example
  - user_external

**Are you using external storage, if yes which one:** local/smb/sftp/...
No
**Are you using encryption:** yes/no
No
**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...
No
#### LDAP configuration (delete this part if not used)

```
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.
```

### Client configuration
**Browser:**

**Operating system:**

### Logs
#### Web server error log
```
Insert your webserver log here
```

#### ownCloud log (data/owncloud.log)
```
Insert your ownCloud log here
```ownCloud[9620]: {index} Exception: {"Exception":"Error","Message":"Call to undefined method OC\\DB\\Connection::supports4ByteText()","Code":0,"Trace":"#0 \/var\/www\/owncloud\/apps\/notes\/service\/notesservice.php(245): OCA\\Notes\\Service\\NotesService->sanitisePath('Hello')\n#1 \/var\/www\/owncloud\/apps\/notes\/service\/notesservice.php(131): OCA\\Notes\\Service\\NotesService->getSafeTitleFromContent('Hello')\n#2 \/var\/www\/owncloud\/apps\/notes\/controller\/notescontroller.php(103): OCA\\Notes\\Service\\NotesService->update(112401, 'Hello', 'alan')\n#3 \/var\/www\/owncloud\/apps\/notes\/controller\/errors.php(31): OCA\\Notes\\Controller\\NotesController->OCA\\Notes\\Controller\\{closure}()\n#4 \/var\/www\/owncloud\/apps\/notes\/controller\/notescontroller.php(104): OCA\\Notes\\Controller\\NotesController->respond(Object(Closure))\n#5 [internal function]: OCA\\Notes\\Controller\\NotesController->update(112401, 'Hello')\n#6 \/var\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(159): call_user_func_array(Array, Array)\n#7 \/var\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(89): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Notes\\Controller\\NotesController), 'update')\n#8 \/var\/www\/owncloud\/lib\/private\/AppFramework\/App.php(98): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Notes\\Controller\\NotesController), 'update')\n#9 \/var\/www\/owncloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(46): OC\\AppFramework\\App::main('OCA\\\\Notes\\\\Contr...', 'update', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#10 [internal function]: OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#11 \/var\/www\/owncloud\/lib\/private\/Route\/Router.php(342): call_user_func(Object(OC\\AppFramework\\Routing\\RouteActionHandler), Array)\n#12 \/var\/www\/owncloud\/lib\/base.php(929): OC\\Route\\Router->match('\/apps\/notes\/not...')\n#13 \/var\/www\/owncloud\/index.php(56): OC::handleRequest()\n#14 {main}","File":"\/var\/www\/owncloud\/apps\/notes\/service\/notesservice.php","Line":224}

#### Browser log
```
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

The OC log is the key part. There appears to be a write issue that's blocking the Notes app (and its Android counterpart) from writing new note files. The physical files are accessible and writable manually, but not by the app.

Apache2 mods include
core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_filter mod_headers mod_mime prefork mod_negotiation mod_php7 mod_reqtimeout mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status

PHP mods include
apc
apcu
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
imagick
intl
json
libxml
mbstring
mcrypt
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

This has all worked for along time, and today in an effort to clean up the File locking and memcache warnings I cleaned out some old PHP5 modules - I don't see how this impacted the existing install as it has been on PHP 7 for a while, it may also be coincidence.

Reaching out for help as this is beyond me.

Thanks in advance

Alan

Looks like a bug in the notes app. Please can you point us to the notes app you installed?

This was once a supported OwnCloud app but is no longer. It is not signed any more.