Unable to export from web

i’m unable to export a base (or a single table) from web interface.
looking into logs i see:

dtable_events_io.log

2022-02-02 13:58:57,720 [INFO] Run task: 1643806737719 <function get_dtable_export_content at 0x7ff129c07c20>
2022-02-02 13:58:57,720 [INFO] Start prepare /tmp/dtable-io/335d007a-a80f-42a0-9f6e-f44b9174414a/zip_file.zip for export DTable.
2022-02-02 13:58:57,721 [INFO] Clear tmp dirs and files before prepare.
2022-02-02 13:58:57,722 [INFO] Create content.json file.
2022-02-02 13:58:57,756 [ERROR] prepare dtable json failed. ERROR: HTTPSConnectionPool(host='{MY-HOST}', port=443): Max retries exceeded with url: /dtable-server/dtables/335d007a-a80f-42a0-9f6e-f44b9174414a/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))
2022-02-02 13:58:57,756 [ERROR] Failed to handle task 1643806737719, error: prepare dtable json failed. ERROR: HTTPSConnectionPool(host='{MY-HOST}', port=443): Max retries exceeded with url: /dtable-server/dtables/335d007a-a80f-42a0-9f6e-f44b9174414a/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))

dtable-events.log

[2022-02-02 14:01:52,424] task_manager.py[line:260] [INFO] Run task: 1643806912423 <function convert_view_to_execl at 0x7ff1290abc20>
[2022-02-02 14:01:52,439] __init__.py[line:520] [ERROR] get nicknames. ERROR: HTTPSConnectionPool(host='{MY-HOST}', port=443): Max retries exceeded with url: /api/v2.1/dtables/335d007a-a80f-42a0-9f6e-f44b9174414a/related-users/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))
[2022-02-02 14:01:52,440] task_manager.py[line:268] [INFO] Run task success: 1643806912423 <function convert_view_to_execl at 0x7ff1290abc20> cost 0s

dtable_web.log

2022-02-02 12:58:57,780 [ERROR] django.request:230 log_response Internal Server Error: /api/v2.1/dtable-io-status/
2022-02-02 13:01:53,689 [ERROR] django.request:230 log_response Internal Server Error: /api/v2.1/workspace/2/dtable/{MY-TABLE}/export-excel/

why the SSLCertVerificationError? my seatable is deployed on 127.0.0.1:8080 then proxied through nginx (cert with letsencrypt)

I would say your config files (especially dtable_web_settings.py) do not reflect this.

This won’t be your only problem, I guess. Can you upload/download files in a file/image column?

every _URL in dtable_web_settings.py uses the right address of the public proxy, with https://

uploading/downloading files works fine. as every other feature. is only the export to misbehave.

thanks!

Can you post the output of docker ps and your nginx conf here?

docker-compose ps

       Name                     Command               State                  Ports                
--------------------------------------------------------------------------------------------------
seatable             /sbin/my_init -- /template ...   Up      0.0.0.0:8080->80/tcp,:::8080->80/tcp
seatable-memcached   memcached -m 256                 Up      11211/tcp                           
seatable-mysql       docker-entrypoint.sh mysqld      Up      3306/tcp                            
seatable-redis       docker-entrypoint.sh redis ...   Up      6379/tcp

cat /etc/nginx/sites-enabled/seatable

server {
    root /var/www/seatable;
    index index.html;

    server_name {MY-HOST};

    location / {
        if ($request_method = 'OPTIONS') {
            add_header Access-Control-Allow-Origin *;
            add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
            add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type";
            return 204;
        }

        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-For $remote_addr;
        client_max_body_size 100m;
    }

    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/{MY-HOST}/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/{MY-HOST}/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

Got it! You use nginx as a proxy before the docker proxy. So the requests goes nginx (on host) → Docker proxy → nginx (in SeaTable container) → SeaTable.

I’ll try to wrap my head around it and get back to you.

1 Like

I could not reproduce your error. With a setup equivalent to yours, I had no problems exporting tables into XSLX files.

Below the configuration of a test system. Why don’t you compare your configuration with mine? Try to spot the discrepancy to yours!

Last comment: You did not mention which SeaTable edition and version you used. I used SeaTable EE and a very recent version. The configuration should also work with SeaTable DE and other versions, but the devil is in the detail. If my advice does not help you succeed, please try with a different version.

/etc/nginx/sites-available/seatable.conf

server {
server_name example.com;

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.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

location / {
proxy_pass http://127.0.0.1:8080;
}
}

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

listen 80;
listen [::]:80;
server_name example.com;
return 404; # managed by Certbot
}

/opt/seatable/docker-compose.yml

version: ‘2.0’
services:
db:
image: mariadb:10.5
container_name: seatable-mysql
environment:
- MYSQL_ROOT_PASSWORD=secret # Root password of MySQL – must be changed
- MYSQL_LOG_CONSOLE=true
volumes:
- /opt/seatable/mysql-data:/var/lib/mysql # Volume of MySQL (directory for persistent storage) and mount point in container – can be changed (not advise>
networks:
- seatable-net

memcached:
image: memcached:1.5.6
container_name: seatable-memcached
entrypoint: memcached -m 256
networks:
- seatable-net

redis:
image: redis:5.0.7
container_name: seatable-redis
networks:
- seatable-net

seatable:
image: seatable/seatable-enterprise-testing:2.7.6
container_name: seatable
ports:
- “8080:80” # HTTP port on the Docker host and the port in the container – must be changed if port 80 is already in use on>
- “4443:443” # HTTPS port on the Docker host and the port in the container – must be changed if port 443 is already in use >
volumes:
- /opt/seatable/seatable-data:/shared # Volume of SeaTable (directory for persistent storage) and mount point in container – can be changed (not adv>
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=secret # Root password of MySQL – must be changed to the value set above
- SEATABLE_SERVER_LETSENCRYPT=False # Decision on whether or not to use Let’s Encrypt for HTTPS, default is False – must be changed to True if a L>
- SEATABLE_SERVER_HOSTNAME=example.com # Host name – must be changed
- TIME_ZONE=Etc/UTC # Optional, default is UTC. Example: Europe/Berlin. Choices can be found here: http://en.wikipedia.org/wiki/Lis>
depends_on:
- db
- memcached
- redis
networks:
- seatable-net

networks:
seatable-net:

/shared/seatable/conf/dtable_web_settings.py (in Docker container)

IS_PRO_VERSION = True

DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘HOST’: ‘db’,
‘PORT’: ‘3306’,
‘USER’: ‘root’,
‘PASSWORD’: ‘secret’,
‘NAME’: ‘dtable_db’,
‘OPTIONS’: {
‘charset’: ‘utf8mb4’,
},
}
}

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

SECRET_KEY = ‘*something-secret’

#for dtable-server
DTABLE_PRIVATE_KEY = ‘something-alphanumeric’
DTABLE_SERVER_URL = ‘https://example.com/dtable-server/
DTABLE_SOCKET_URL = ‘https://example.com/

#for dtable-web
DTABLE_WEB_SERVICE_URL = ‘https://example.com/

#for dtable-db
DTABLE_DB_URL = ‘https://example.com/dtable-db/

#for seaf-server
FILE_SERVER_ROOT = ‘https://example.com/seafhttp/

ENABLE_USER_TO_SET_NUMBER_SEPARATOR = True

PLUGINS_REPO_ID=‘9b84034d-d764-471e-8f69-073a8c2bbdc3’

Running Docker containers and listening ports

i’m using image: seatable/seatable-developer:latest
i just pulled the image.
i’ll try to investigate deeply, thanks for your time.

anyway i’m using the API to pull off data from bases and saving into CSV, so i’m not concerned by the safety and backup of the data.
the xlsx export was useful to non tech people.

seatable is a good piece of software, thanks.

If you find out the root cause of the problem, would you be so kind and post it here?

1 Like

Have you been successful in spotting the problem?

not yet. I haven’t investigated further, i’m doing a daily backup through APIs.
but is on my todo list.

I’ve finally understood the problem, and is not related to Seatable, sorry if i wasted your time.

in short: the problem was the firewall of the cloud where I’ve installed seatable, PFSense in Vmware Cloud. It needs an override in DNS configuration, that was the cause of failed call to HTTPS.

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'

Cloud (managed by others) are making our life miserable :slight_smile:

1 Like

Hi all,
I just wanted to add my experience on this, in case this offers another possible solution for others.
I was unable to export and was also seeing the following message in the logs:
SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate.
I am using the developer edition 2.7.0 with my own supplied SSL certificate.
I was able to resolve this by combining my secure certificate and CA bundle into one file.
The CA bundle is the file that contains root and intermediate certificates.
After adding the contents of the CA bundle to the end of the .crt file and restarting SeaTable, I was once again able to export.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.