Upload fails via WEB UI

Hey guys, I just installed seafile server and im having a weird issue, I can’t upload via the webUI. I can download via the webUI and i can upload and download via the desktop app. Its just uploading via the webUI that fails.

Seafile.log has the following error when i try to upload:
Failed to read content from block temp file: Operation not permitted.

Config files are below. I’m using Seafile Server 7.0.5 on Centos 7.

ccnet.conf:

[General]
USER_NAME = seafile
ID = d4f272fc4ff755d60394412fb642846e2d4a9aaf
NAME = seafile
SERVICE_URL = https://www.URL.com

[Client]
PORT = 13419

[Database]
ENGINE = mysql
HOST = 127.0.0.1
PORT = 3306
USER = seafile
PASSWD = password
DB = ccnet_db
CONNECTION_CHARSET = utf8

Seahub_settings.py

# -*- coding: utf-8 -*-
SECRET_KEY = "k73p=z0h_yrhne8z9$-(k_=-40@h3xnu#bqhe)6nt_*uc2n9ht"

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub_db',
        'USER': 'seafile',
        'PASSWORD': 'password',
        'HOST': '127.0.0.1',
        'PORT': '3306'
    }
}


CACHES = {
    'default': {
        'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
        'LOCATION': '127.0.0.1:11211',
    },
    'locmem': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    },
}
COMPRESS_CACHE_BACKEND = 'locmem'

# EMAIL_USE_TLS                       = False
# EMAIL_HOST                          = 'localhost'
# EMAIL_HOST_USER                     = ''
# EMAIL_HOST_PASSWORD                 = ''
# EMAIL_PORT                          = '25'
# DEFAULT_FROM_EMAIL                  = EMAIL_HOST_USER
# SERVER_EMAIL                        = EMAIL_HOST_USER

TIME_ZONE                           = 'Europe/Berlin'
SITE_BASE                           = 'http://127.0.0.1'
SITE_NAME                           = 'Seafile Server'
SITE_TITLE                          = 'Seafile Server'
SITE_ROOT                           = '/'
ENABLE_SIGNUP                       = False
ACTIVATE_AFTER_REGISTRATION         = False
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER  = True
SEND_EMAIL_ON_RESETTING_USER_PASSWD = True
CLOUD_MODE                          = False
FILE_PREVIEW_MAX_SIZE               = 30 * 1024 * 1024
SESSION_COOKIE_AGE                  = 60 * 60 * 24 * 7 * 2
SESSION_SAVE_EVERY_REQUEST          = False
SESSION_EXPIRE_AT_BROWSER_CLOSE     = False

FILE_SERVER_ROOT                    = 'https://www.URL.com/seafhttp'

Seafile.conf (nginx)

log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time';

server {
    server_name www.URL.com URL.com;

    proxy_set_header X-Forwarded-For $remote_addr;

    location / {
         proxy_pass         http://127.0.0.1:8000;
         proxy_set_header   Host $host;
         proxy_set_header   X-Real-IP $remote_addr;
         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header   X-Forwarded-Host $server_name;
         proxy_set_header   X-Forwarded-Proto $scheme;
         proxy_read_timeout  1200s;

         # used for view/edit office file via Office Online Server
         client_max_body_size 0;

         access_log      /var/log/nginx/seahub.access.log seafileformat;
         error_log       /var/log/nginx/seahub.error.log;
    }

    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_request_buffering    off;

        access_log      /var/log/nginx/seafhttp.access.log seafileformat;
        error_log       /var/log/nginx/seafhttp.error.log;
    }
    location /media {
        root /opt/seafile/seafile-server-latest/seahub;
    }
    location /seafdav {
        fastcgi_pass    127.0.0.1:8080;
        fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        fastcgi_param   PATH_INFO           $fastcgi_script_name;
        fastcgi_param   SERVER_PROTOCOL     $server_protocol;
        fastcgi_param   QUERY_STRING        $query_string;
        fastcgi_param   REQUEST_METHOD      $request_method;
        fastcgi_param   CONTENT_TYPE        $content_type;
        fastcgi_param   CONTENT_LENGTH      $content_length;
        fastcgi_param   SERVER_ADDR         $server_addr;
        fastcgi_param   SERVER_PORT         $server_port;
        fastcgi_param   SERVER_NAME         $server_name;
        fastcgi_param   REMOTE_ADDR         $remote_addr;

 client_max_body_size 0;

        access_log      /var/log/nginx/seafdav.access.log seafileformat;
        error_log       /var/log/nginx/seafdav.error.log;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/www.URL.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/www.URL.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



}


server {
    if ($host = www.URL.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = URL.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name www.URL.com URL.com;
    return 404; # managed by Certbot


}

Hi,

did you disable SELinux (“setenforce permissive”)?
Does your data/tmpfiles directory have the correct owner/permissions?

Here is the output of SELinux. Do i need to make any modifications to it?

[root@li69-13 ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          permissive
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      31

The entire /opt/seafile/ folder is owned by the seafile user so seafile-data/tmpfiles is accessible by the user.

Thank you very much for your help!

looks like your tmp folder no permission to uplaod file
i never make it work by enable selinux :rofl:

I just disabled SELinux via the config file, rebooted and tried to upload the file again and it still failed.

I am using my phone to reply so maybe the formate is not good enough
I think u may need to edit your service URL in Ccnet.conf file


I am setting similar env as u use Ngnix and expose https for use to access.

In your nginx I see 127.0.0.1 listening on port 8000 8082 and 8080

So your real service URL should be the default one , I guess is 127.0.0.1:8000
Or u can also edit from portal setting …and also can try to add file_upload_root option
But all those two option will be overwrited if u edit it from portal admin setting —-I remember it is mentioned in Manual.

Later get my notes will update here hahah

I stopped Seafile and Seahub, changed the Service URL to https://127.0.0.1:8000, restarted Seafile and Seahub, and tried to upload the file via the WebUI and it failed.

I repeated the same process with 127.0.0.1:8000 (no https://) and tried to upload and it didn’t work either.

I should note that i had an instance of 7.0.4 server running and it was working properly. I basically made sure ccnet.conf, seahub_settings.py, and seafile.conf (in nginx) were the same (not literally the same but had all the same settings, same URLs, etc.). Thats why i am surprised that i am having this issue. Maybe its na issue with 7.0.5?

based on the seafile.log file, it looks like a permissions issue but i cant for the life of my find a file that the seafile user doesn’t have access to that it needs.

One other note, is that this issue was happening on this server before i implemented https.

There were a lot of UI fixes in 7.0.5 (see changelog). Did you clear your browser cache and memcache after upgrading the server?

I just cleared my browser cache and that did not fix it. How do i clear memcache? My seafile 7.0.5 server install was a clean install, unrelated to the instance of 7.0.4 i had running.

hmm If still same error “Failed to read content from block temp file: Operation not permitted.” then most likely some place permission u didnt set correctly.
or maybe u can share more configuration to here.

Can you give me a list of places that the Seafile user needs access to? I installed Seafile via the installation script in the manual.

I am happy to share any configs you need. Name them and ill provide them.

I think i said this in the OP but its weird because i can download via the WebUI and i can both upload and download from the desktop app.

I installed both docker version and pure tar package applicatin version never have such issue.
When I try to search your error message ddint get too much.
I dont think it is real application issue.
Or you may want to restart seafile and seahub service and share seafile.log seahub.log/

i think ccnet.conf use http:xxxxx:8000 should be fine.
Here is my conf

ccnet.conf

Blockquote[General]
USER_NAME = app03
ID = xxxxxxx
NAME = app03
SERVICE_URL = http://0.0.0.0:8000
[Client]
PORT = 13419

nginx.conf

Blockquote
server {
listen 443 ssl;
server_name seafiledemo;
set $appvip ; #set app vip by keepalived
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/nginx/ssl/seafile-selfsigned.crt;
ssl_certificate_key /etc/nginx/ssl/seafile-selfsigned.key;

You clear the memcache with the following command:

telnet 127.0.0.1 11211
flush_all
quit

I restarted both Seafile and Seahub.

Here is my seahub.log. I think these warnings are because I am not using the pro version.

2019-11-05 15:10:26,934 [WARNING] django.request:152 get_response Not Found: /api2/repos/0a593706-5d67-4323-9688-5d6062e468ff/
2019-11-05 15:15:26,934 [WARNING] django.request:152 get_response Not Found: /api2/repos/0a593706-5d67-4323-9688-5d6062e468ff/
2019-11-05 15:20:26,986 [WARNING] django.request:152 get_response Not Found: /api2/repos/0a593706-5d67-4323-9688-5d6062e468ff/
2019-11-05 15:25:27,812 [WARNING] django.request:152 get_response Not Found: /api2/repos/0a593706-5d67-4323-9688-5d6062e468ff/

Seafile.log:

[11/05/2019 02:25:55 PM] upload-file.c(1101): Failed to read content from block temp file: Operation not permitted.
[11/05/2019 02:31:46 PM] upload-file.c(1101): Failed to read content from block temp file: Operation not permitted.
[11/05/2019 02:32:11 PM] upload-file.c(1101): Failed to read content from block temp file: Operation not permitted.

seahub error looks ok… that not found i always get …
seafile error looks funny… i even can not google too much this kind of error.
can i know how many servers u are using?
all in one and with nginx?
if you disable nginux service are u able to reach the the web portal by http://localhost:8000

as the seafile code are all binary files… maybe u can try to download the installer pacakge again and install. Sorry just my idea… as i never see this kind of error after playing this app so many times…