Screwed up data/appdata_instanceid

Hi everyone,

I’m not in a real hurry as this is my own fault but i have removed the directory /NC_ROOT/data/appdata_instanceid/ this was not very wise :unamused:

Now images don’t show thumbs anymore. As this was a while back i have manually recreated the appdata_instanceid directory and there in created directories appstore, avatar, identityproof, preview, richdocuments, theming

I don’t know what more directories i have created but now new uploaded images do get thumbnails and by downloading existing images delete them from the cloud and reupload them they get the thumbnails as well.

However dumb this was to do is there a way that NC recreates these necessary directories. ?
This directory seems important to backup ?

This happend on NC (Stable) in the meantime upgraded to 11.0.1 RC1 (beta)

NC 11.0.1 RC1 (beta)
PHP 7.0.8
mySQL Ver 15.1 Distrib 10.0.28-MariaDB
Apache/2.4.18 (Ubuntu)

resulting error for each file in directory

Error	PHP	filesize(): stat failed for /cloud/appdata_xxxxxxxxxxxx/preview/2719/64-64-crop.png at /var/www/nextcloud/lib/private/Files/Storage/Local.php#211
Error	PHP	fopen(/cloud/appdata_xxxxxxxxxxxx/preview/2719/64-64-crop.png): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#216
Error	PHP	fread() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/lib/private/Files/Storage/Local.php#217
Error	PHP	fclose() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/lib/private/Files/Storage/Local.php#218

Same problem, any ideas how to solve this?

In case someone else stumbles across this thread - I’ve seemed to have found a solution. The ‘appdata’ directory is suffixed using the current instance id. If you remove the instance id from the database it will automatically generate a new one along side the respective ‘appdata’ directory!

# occ config:system:delete instanceid
System config value instanceid deleted



nice find there. thanks for sharing

Hi Vincent, i got the same issue, i deleted the appdata folder completely, now i got internal server error when i try to login from web. you mentioned that you solve it by “# occ config:system:delete instanceid”. Question, how to do that OCC thing? is it a database language or something else?

Hi Frank_Zhao

The occ is a php command line tool.
You find it inside your nextcloud web directory.
Example /var/www/nextcloud
You need your old instance id included in the command.

Run it as the user of the web server for example user www-data

sudo -u www-data php occ config:system:delete your-old-id-here

I would recommend searching and reading about occ it has many functions.
occ manual

cool, i got it! thanks mate

Vincent Stans via Nextcloud community 于2020年1月28日周二 上午1:28写道: