Docker Community Forums

Share and learn in the Docker community.

Swarm Stack Deploy doesn't error when adding a file that is to large


(Brian Wagner) #1

I am asking/reporting this in the forums to make sure I am not missing something in the documentation before I open up a github issue on it. Please let me know if this is not the proper way to do this. I am a newbie here on this type of thing…

We were receiving the following error when trying to deploy a simple URLRewrite application with a configuration file that is about ~524K and 11500 lines long. The error we received was this:

service redirector: config not found: <Stack Name>_urlrewrite

The stack name doesn’t matter. Removing the configs sections from the following compose file allows it to deploy fine.

version: '3.3'
services:
 redirector:
   image: 'internal.docker.registry.local/redirector/tomcat-redirector:latest'
   ports:
     - '8001:8080'
   deploy:
     replicas: 1
     placement:
       constraints:
         - node.role != manager
   configs:
     -
       source: urlrewrite
       target: /usr/local/tomcat/webapps/redirector/WEB-INF/urlrewrite.xml
configs:
 urlrewrite:
   file: ./urlrewrites.xml

If the configs section to define the file itself is placed above the service definition I receive the following output with the full 524K file:

docker stack deploy --prune --compose-file ./docker-compose-int.yml wags
Creating network wags_default
Creating config wags_urlrewrite_xml
service redirector-int: config not found: wags_urlrewrite_xml

If I drop the size of the file down to only a few lines I get the following:

docker stack deploy --prune --compose-file ./docker-compose-int.yml wags
Ignoring unsupported options: privileged

Creating network wags_default
Creating config wags_urlrewrite_xml
Creating service wags_redirector-int

I found the solution by accident when I tried to add the file via portainer’s web interface and it gave me the following error:

Failure
rpc error: code = InvalidArgument desc = config data must be larger than 0 and less than 512000 bytes

I have two issues with the way this is functioning:
First, no matter what the answer is to my second issue the code for Stack Deploy should error that the file size was exceeded not appear that the configuration was created. Then error that it couldn’t find that configuration it says it just created.

Second 512K seems like a really small configuration file size limit. The file is pretty long but my employer is a large multi-national paint manufacturer with a lot of brand names both new and old we need to redirect for SEO and other search related issues. Then there is also the need to move deep links from time to time as we have acquired companies, re-branded paint lines, etc. So in this case the size makes some sense. We would like to limit the number of images in our repo so separating the “data” in this case from the image makes sense.

So any suggestions on what to do?