Can't upload MP4 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, 12.0.2): 14.0.4
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18:04
Apache or nginx version (eg, Apache 2.4.25): Server version: Apache/2.4.29 (Ubuntu)
PHP version (eg, 7.1): PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02)

The issue you are facing:

My client gives error that files getting locked when trying to sync.

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

Steps to replicate it:

  1. Trying to upload a folder with the client, all MP4 files gets locked. Everything else (RAW Photo files) works just fine.

The output of your Nextcloud log in Admin > Logging:

Error	no app in context	OCP\Lock\LockedException: "files/9dd498772050533f10e9090e1284dac9" is locked, existing lock on file: 25 shared locks	2019-01-03T09:56:04+0100
Error	no app in context	OCP\Lock\LockedException: "files/9dd498772050533f10e9090e1284dac9" is locked, existing lock on file: 11 shared locks	2018-12-29T19:28:05+0100
Error	PHP	include(): Failed opening 'State token does not match' for inclusion (include_path='/home/cloud/public_html/3rdparty/pear/archive_tar:/home/cloud/public_html/3rdparty/pear/console_getopt:/home/cloud/public_html/3rdparty/pear/pear-core-minimal/src:/home/cloud/public_html/3rdparty/pear/pear_exception:/home/cloud/public_html/apps') at /home/cloud/public_html/lib/private/Template/Base.php#179	2018-12-28T21:07:36+0100
Error	PHP	include(State token does not match): failed to open stream: No such file or directory at /home/cloud/public_html/lib/private/Template/Base.php#179	2018-12-28T21:07:36+0100
Error	PHP	include(): Failed opening 'State token does not match' for inclusion (include_path='/home/cloud/public_html/3rdparty/pear/archive_tar:/home/cloud/public_html/3rdparty/pear/console_getopt:/home/cloud/public_html/3rdparty/pear/pear-core-minimal/src:/home/cloud/public_html/3rdparty/pear/pear_exception:/home/cloud/public_html/apps') at /home/cloud/public_html/lib/private/Template/Base.php#179	2018-12-28T21:07:36+0100
Error	PHP	include(State token does not match): failed to open stream: No such file or directory at /home/cloud/public_html/lib/private/Template/Base.php#179

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

<?php
$CONFIG = array (
  'instanceid' => '*****',
  'passwordsalt' => '*****',
  'secret' => '*****',
  'trusted_domains' => 
  array (
    0 => '*****',
  ),
  'datadirectory' => '/mnt/disk3/cloud',
  'dbtype' => 'mysql',
  'version' => '14.0.4.2',
  'overwrite.cli.url' => 'https://cloud.laddad.net',
  'dbname' => 'cloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '*****',
  'dbpassword' => '*****',
  'installed' => true,
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\OC\Memcache\APCu',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
      'host' => 'localhost',
      'port' => 6379,
      'password' => '*******',
       ),
);

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

[Fri Jan 04 06:25:07.056942 2019] [mpm_prefork:notice] [pid 57713] AH00163: Apa$
[Fri Jan 04 06:25:07.056986 2019] [core:notice] [pid 57713] AH00094: Command li$
PHP Warning:  Module 'curl' already loaded in Unknown on line 0
PHP Warning:  Module 'gd' already loaded in Unknown on line 0
PHP Warning:  Module 'curl' already loaded in Unknown on line 0
PHP Warning:  Module 'gd' already loaded in Unknown on line 0
PHP Warning:  Module 'curl' already loaded in Unknown on line 0
PHP Warning:  Module 'gd' already loaded in Unknown on line 0

Hi,

This occurs with every encounter to synch the folder? AFAIK file locks are removed/ freed after an hour.
Looks like you are using Redis for file locking. Redis works actually very well and fast for file locking and even resolved big issues with locked files for me. Are you sure it is really working?
To check that, you could have a look at journalctl -xe. Redis regularly informs in the journal about caching and write-backs. If there are no entries, it is either a log level setting or redis not fully working.

An attempt to solve this issue could be to free file locks in the DB:

  • check for locks with
    select * from oc_file_locks where 1;
  • remove locks with (better put NC in maintenance before executing SQL query)
    `delete from oc_file_locks where 1;

Check the upload again.

Thanks for the reply. I can’t see any entries from Redis in the journal.

This is what I’m getting from redis-server.

server@server:~$ redis-server
3523:C 04 Jan 09:42:38.828 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
3523:C 04 Jan 09:42:38.828 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=3523, just started
3523:C 04 Jan 09:42:38.828 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
3523:M 04 Jan 09:42:38.829 * Increased maximum number of open files to 10032 (it was originally set to 1024).
3523:M 04 Jan 09:42:38.829 # Creating Server TCP listening socket *:6379: bind: Address already in use
server@server:~$

Edit: Just noticed the journal is super longer, any way to search in here?

So something bound to that port already and redis can’t even run.
I suggest to fix your redis setup asap to improve the experience with NC.
Also

doesn’t sound good :wink:

Anything regarding my other questions or from the DB queries?

This is the guide I followed to setup Redis. I’ve double checked and it seems to be working when using the commands in the guide.

Gonna have a look at the DB now and see if I can manage. I’m a bit of a DB rookie. :stuck_out_tongue:

Very strange, the guide looks good and it is also containing configurations to a config file. I’m wondering why redis reports it couldn’t find a config.
What exactly does this command print?
sudo systemctl status redis

And in reference to my issue I had with redis: I had the service running successfully as well, however, because I was missing PHP modules, Nextcloud was not able to connect to redis and therefor the file locking was not done by redis.
With a working redis-usage of NC you should see some log entries in the journal as mentioned.

It says it’s running. As I see it, it reports that it can’t find a custom config file, so it’s using the default instead :stuck_out_tongue:

I had a closer look at the files, some MP4’s has been synced. Those who hasen’t, are the bigger files, around 4gb on those I just checked. Could it be something related to file size?

“It’s my understanding that key sizes are limited to 2 GiB. That means that the maximum amount of data you can store at a given key is 2 GiB. All String values are limited to 512 MiB.”

Or your upload file size limit is below the actual size of your files. You can increase the upload file size in the admin settings of your NC admin user (web GUI). I believe it was under “Additional Settings”.

It was set to 5GB and the files are 3.7GB. I tried increasing it to 16GB just in case.