Django request log full of warnings

Hi all,

my seahub_django_request.log is full of these Warnings:

2017-05-06 17:32:08,997 [WARNING] django.request:170 get_response Not Found: /seafile/api2/server-info/
2017-05-14 21:11:57,129 [WARNING] django.request:170 get_response Not Found: /seafile/api2/ping/

Any chance to fix this?

1 Like

Yes, fix your config. Either seahub settings or nginx / webserver, possibly both.

I’ve already tried to fix both config files, but I really can’t find any relevant settings

seafile.conf for nginx:

server {
    listen 443 ssl http2 default_server;
    gzip off;
    server_name www.domain.de domain.de;
    proxy_set_header X-Forwarded-For $remote_addr;
        if ($allowed_country = no) {
            return 444;
        }
    location / {
        fastcgi_pass    127.0.0.1:8000;
        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;
        fastcgi_param   HTTPS               on;
        fastcgi_param   HTTP_SCHEME         https;
        access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;
        fastcgi_read_timeout 36000;
    }
    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
        proxy_request_buffering off;
    }
}

seahub_settings.py (stripped Databases etc.)

FILE_SERVER_ROOT = ‘https://domain.de/seafhttp

CACHES = {
‘default’: {
‘BACKEND’: ‘django.core.cache.backends.memcached.MemcachedCache’,
‘LOCATION’: ‘127.0.0.1:11211’,
}

Check that you have https in ccnet.conf. Maybe you need a http to https redirection? Check with the manual for possible errors

Ok, you deployed Seafile on some domains root and the requests log that someone tried to access Seafile at non root domain. Thus it logged 404 (file not found).

I have a similar problem, every 5 minutes a message appears in the file seahub.log
2018-06-09 12:01:38,526 [WARNING] django.request:152 get_response Not Found: /api2/events/
2018-06-09 12:06:38,525 [WARNING] django.request:152 get_response Not Found: /api2/events/

After upgrade from 6.2.5 to 6.3.1 my seahub.log is also full of

2018-06-26 16:20:55,882 [WARNING] django.request:152 get_response Not Found: /api2/events/
2018-06-26 16:20:57,258 [WARNING] django.request:152 get_response Not Found: /api2/events/
2018-06-26 16:21:29,923 [WARNING] django.request:152 get_response Not Found: /api2/events/

How can I fix this ?

No fix needed. The api endpoint is only part of the pro edition as far as I know.

But why take this warning every 5 minutes? Maybe it should be removed for the community?

1 Like

I have the same situation and I am using the latest docker version.

Those warnings indicate that some clients are sending requests that seafile server is not able to process. Please check your nginx/apache access log, there should be some info like user-agent, etc… in the log file.

In order to suppress those warnings, you can simply modify web server config , for instance in nginx.conf:

        location /apple-touch-icon.png {
                 return 404;
        }
        location ~ ^/apple-touch-icon.*\.png$ {
                 return 404;
        }
        location /wp-login.php {
                return 404;
        }

There is a bug in seafile client prior to version 6.2.1 which will send /api2/events/ to seafile community server.

You can just ignore those warnings.