Camera auto-upload constantly resync files

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.0.4
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.10
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 8.1.16
Nextcloud Android app version: 3.24.1

The issue you are facing:

Nextcloud constantly re-sync files from camera auto upload directory on Android phones, even after all files were uploaded to server and no new photos were taken.

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

Steps to replicate it:

  1. Enable auto upload for some directory on Android app
  2. Wait for files to upload
  3. After some time and no new files added check the logs

The output of your Nextcloud log in Admin > Logging:

![image|690x362](upload://rXDjDmFwh7hRkPEnKCxmn8BpwQQ.png)

https://ibb.co/TgH1p6P

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'nc-redis',
    'password' => '',
    'port' => 6379,
  ),
  'trusted_proxies' =>
  array (
    0 => '192.168.1.0/24',
  ),
  'instanceid' => '***********',
  'passwordsalt' => '***********',
  'secret' => '***********',
  'trusted_domains' =>
  array (
    0 => '***********',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '25.0.4.1',
  'overwrite.cli.url' => '***********',
  'dbname' => 'nextcloud',
  'dbhost' => 'nc-db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '***********',
  'installed' => true,
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'loglevel' => 2,
);

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

PASTE HERE

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

https://pastebin.com/h0UZyXLQ

Nextcloud container logs:

****** - ****** [15/Mar/2023:22:02:00 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/Screenshot_20200306-185634.jpg HTTP/1.1" 200 38520 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:00 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/20221006_195138.jpg HTTP/1.1" 200 1474863 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:00 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20220526_210039.jpg HTTP/1.1" 200 932863 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:01 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/Screenshot_20200315-231553.jpg HTTP/1.1" 200 41411 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:01 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20210226_153632.jpg HTTP/1.1" 200 1188687 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:01 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/Snapchat-1974378367.jpg HTTP/1.1" 200 246845 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:01 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20210426_115439.jpg HTTP/1.1" 200 951119 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:01 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/20220924_143429.jpg HTTP/1.1" 200 819911 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:01 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/20210517_073211_0.jpg HTTP/1.1" 200 788059 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:02 +0100] "HEAD /remote.php/dav/files/******/InstantUpload/Camera/20220922_135201.heic HTTP/1.1" 200 901 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:02 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20190703_133341_2.jpg HTTP/1.1" 200 479864 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:02 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20210731_115638.jpg HTTP/1.1" 200 604167 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:02 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20210523_154219.jpg HTTP/1.1" 200 717111 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:02 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20220519_191649.jpg HTTP/1.1" 200 995127 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:02 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20210529_164950.jpg HTTP/1.1" 200 1554055 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:03 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/20230110_203904.jpg HTTP/1.1" 200 1005255 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:03 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/20170802_181603.jpg HTTP/1.1" 200 711311 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:03 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/20170514_170914.jpg HTTP/1.1" 200 992223 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:03 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20220814_162455.jpg HTTP/1.1" 200 973407 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:03 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/received_2301471450087287.jpeg HTTP/1.1" 200 296226 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:04 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20190512_203246_034.jpg HTTP/1.1" 200 34340 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:04 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20190225_231501_245.jpg HTTP/1.1" 200 54992 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:04 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20220910_155645.jpg HTTP/1.1" 200 983007 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:04 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/Snapchat-1876568802.jpg HTTP/1.1" 200 25888 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:04 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/image-0-02-01-08af787125075873fd9e0fdfe95d510cd.jpg HTTP/1.1" 200 103328 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:05 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20220806_163329.jpg HTTP/1.1" 200 898527 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:05 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20190925_170249.jpg HTTP/1.1" 200 716975 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:05 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20210730_190746.jpg HTTP/1.1" 200 1003815 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:05 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20210912_104510.jpg HTTP/1.1" 200 1147167 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:06 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20220708_224938.jpg HTTP/1.1" 200 1221015 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:06 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/received_369878067246914.jpeg HTTP/1.1" 200 528416 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:06 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/20170903_152525.jpg HTTP/1.1" 200 206280 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:06 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20211113_235255.jpg HTTP/1.1" 200 1381743 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:06 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20210506_115429.jpg HTTP/1.1" 200 885079 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:07 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/IMG_20220708_170537.jpg HTTP/1.1" 200 982095 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"
****** - ****** [15/Mar/2023:22:02:07 +0100] "GET /remote.php/dav/files/******/InstantUpload/Camera/20220919_141431.jpg HTTP/1.1" 200 433295 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.24.1"

You can see this issue clearly looking at names of upladed files which include timestamp. Nextcloud is uploading some old files form last or even 4 years ago and these files were already uploaded to server.

Nextcloud docker-compose:

nextcloud:
    image: nextcloud:25
    container_name: nextcloud
    hostname: nextcloud

    networks:
      - nextcloud
    restart: unless-stopped

    ports:
      - 80:80
    volumes:
      - $DOCKER_APPS_DIR/nextcloud/nc:/var/www/html
      - $HDD_RAID/nextcloud:/var/www/html/data

    environment:
      TZ: $TZ
      REDIS_HOST: nc-redis
      TRUSTED_PROXIES: 192.168.1.0/24
      NEXTCLOUD_TRUSTED_DOMAINS: $CF_DOMAIN_NAME
      OVERWRITEPROTOCOL: https

    depends_on:
      - nextcloud-db
      - nc-redis

  nextcloud-db:
    image: mariadb:10.10
    container_name: nc-db
    hostname: nc-db

    networks:
      - nextcloud
    restart: unless-stopped

    command: --transaction-isolation=READ-COMMITTED --log-bin=msqyld-bin --binlog-format=ROW

    volumes:
      - $DOCKER_APPS_DIR/nextcloud/db:/var/lib/mysql
    secrets:
      - nextcloud_db_root_password
      - nextcloud_db_password
    environment:
      MYSQL_USER: nextcloud
      MYSQL_DATABASE: nextcloud
      MYSQL_ROOT_PASSWORD_FILE: /run/secrets/nextcloud_db_root_password
      MYSQL_PASSWORD_FILE: /run/secrets/nextcloud_db_password

  nc-redis:
    image: redis:7.0.5-alpine
    container_name: nc-redis
    hostname: nc-redis

    networks:
      - nextcloud
    restart: unless-stopped

    volumes:
      - $DOCKER_APPS_DIR/nextcloud/redis:/data

  nc-cron:
    image: rcdailey/nextcloud-cronjob
    container_name: nc-cron

    restart: always
    network_mode: none
    depends_on:
      - nextcloud
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/localtime:/etc/localtime:ro
    environment:
      - NEXTCLOUD_CONTAINER_NAME=nextcloud
      - NEXTCLOUD_CRON_MINUTE_INTERVAL=5

Hi, is anyone having the same issue?

hi @MorganMLG welcome to the forum :handshake:

I’m using similar config and don’t see such issue. I remember problem in the past but I can’t recall the root cause/solution.
I would start reinstalling Android app - maybe it became damaged for some reason…

your log is full of

"message":"Failed sending activity email to user \"{user}\"","CustomMessage":"Failed sending activity email to user \"******\""}

maybe the server is busy trying to send an email and doesn’t react in a right way for this reason… try disabling mail notifications (or setup mail server)

@wwe I tried reinstalling Android app, I also tried installing Nextcloud app from f-droid, but the issue was still occurring.

I noticed that my logs are full of this “Failed sending activity email to user” while I was creating initial post and I disabled this email notification then, but unfortunately this didn’t resolve the issue.

I don’t have any clue what the issue can be. My android app settings for automatic upload are to skip / don’t upload already existing files.

after you stopped the server from creating notification mails do you see more meaningful entries?

Maybe you need client logs

I had maybe a similar issue.
for 1 user there was one file that kept uploading/error while the file a photo seem okay and I was able to view it. it kept erroring on the timestamp. I tried delete the file and recover it from the nc-trashbin without success. what I ultimately did was download the file delete it and reuploaded. this stopped the error but I only had this with one file.

the issue exsisted from a few versions back but since I do not access other user accounts without there presence It stayed for some time.

These are the logs that I get from NC android app.

--------- beginning of main03-21 10:13:49.709 21619 21763 D UploadsStorageMana - Pastebin.com

As you can see there is A LOT of activity and this is only the last 30 minutes and about 1/20 of whole log file. I cannot paste everything because of pastebin limit.

From NC server side there is still a lot of this “failed to send email” in logs even after I disabled every email notification in admin settings.

Imgur

I set up mailtrap as a temporary solution. Don’t mind last few lines with mailtrap, it is working now. And errors with “failed to send email” don’t appear any more.