Skip to content

Truncating log lines at 75 characters makes them useless. #7176

Description

@brutesque

Description

func truncError(errMsg string) string {
// Remove newlines from the error, which corrupt the output.
errMsg = strings.ReplaceAll(errMsg, "\n", " ")
// Limit the length to 75 characters, so that even on narrow terminals
// this will not overflow to the next line.
const maxWidth = 75
if len(errMsg) > maxWidth {
errMsg = errMsg[:maxWidth-1] + "…"
}
return errMsg
}

root@manager:/opt/comfyui# docker service scale comfyui_rtx=1
comfyui_rtx scaled to 1
overall progress: 0 out of 1 tasks 
1/1: invalid mount config for type "bind": bind source path does not exist: /mn… 

This log line has zero (0.0) value in debugging.

Reproduce

docker service scale my_service=1
my_service scaled to 1
overall progress: 0 out of 1 tasks
1/1: invalid mount config for type "bind": bind source path does not exist: /mn…

Expected behavior

Don't truncate a log line. log lines are for debuggin. Not for looking pretty on tiny terminals.

docker version

Client: Docker Engine - Community
 Version:           29.7.2
 API version:       1.55
 Go version:        go1.26.5
 Git commit:        a7dcaa6
 Built:             Wed Aug  5 18:28:53 2026
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          29.7.2
  API version:      1.55 (minimum version 1.40)
  Go version:       go1.26.5
  Git commit:       6a43e3d
  Built:            Wed Aug  5 18:28:53 2026
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v2.3.3
  GitCommit:        aad11006b869517fcd3009450b6f82da282e1a9b
 runc:
  Version:          1.4.3
  GitCommit:        v1.4.3-0-gbb14dabe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community                                                                                                                                                                                                                                                                          
 Version:    29.7.2                                                                                                                                                                                                                                                                                        
 Context:    default                                                                                                                                                                                                                                                                                       
 Debug Mode: false                                                                                                                                                                                                                                                                                         
 Plugins:                                                                                                                                                                                                                                                                                                  
  buildx: Docker Buildx (Docker Inc.)                                                                                                                                                                                                                                                                      
    Version:  v0.36.1                                                                                                                                                                                                                                                                                      
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx                                                                                                                                                                                                                                                
  compose: Docker Compose (Docker Inc.)                                                                                                                                                                                                                                                                    
    Version:  v5.4.0                                                                                                                                                                                                                                                                                       
    Path:     /usr/libexec/docker/cli-plugins/docker-compose                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                           
Server:                                                                                                                                                                                                                                                                                                    
 Containers: 5                                                                                                                                                                                                                                                                                             
  Running: 2                                                                                                                                                                                                                                                                                               
  Paused: 0                                                                                                                                                                                                                                                                                                
  Stopped: 3                                                                                                                                                                                                                                                                                               
 Images: 2                                                                                                                                                                                                                                                                                                 
 Server Version: 29.7.2                                                                                                                                                                                                                                                                                    
 Storage Driver: overlayfs                                                                                                                                                                                                                                                                                 
  driver-type: io.containerd.snapshotter.v1                                                                                                                                                                                                                                                                
 Logging Driver: json-file                                                                                                                                                                                                                                                                                 
 Cgroup Driver: systemd                                                                                                                                                                                                                                                                                    
 Cgroup Version: 2                                                                                                                                                                                                                                                                                         
 Plugins:                                                                                                                                                                                                                                                                                                  
  Volume: local                                                                                                                                                                                                                                                                                            
  Network: bridge host ipvlan macvlan null overlay                                                                                                                                                                                                                                                         
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog                                                                                                                                                                                                                                 
 CDI spec directories:                                                                                                                                                                                                                                                                                     
  /etc/cdi                                                                                                                                                                                                                                                                                                 
  /var/run/cdi                                                                                                                                                                                                                                                                                             
 Swarm: active                                                                                                                                                                                                                                                                                             
  NodeID: u5j5xu99521xbhzj1lqr1to2m                                                                                                                                                                                                                                                                        
  Is Manager: true                                                                                                                                                                                                                                                                                         
  ClusterID: jr6qtqdgij6vo1ksgrdu9l9by                                                                                                                                                                                                                                                                     
  Managers: 1                                                                                                                                                                                                                                                                                              
  Nodes: 6                                                                                                                                                                                                                                                                                                 
  Default Address Pool: 10.0.0.0/8                                                                                                                                                                                                                                                                         
  SubnetSize: 24                                                                                                                                                                                                                                                                                           
  Data Path Port: 4789                                                                                                                                                                                                                                                                                     
  Orchestration:                                                                                                                                                                                                                                                                                           
   Task History Retention Limit: 5                                                                                                                                                                                                                                                                         
  Raft:                                                                                                                                                                                                                                                                                                    
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 10.105.75.121
  Manager Addresses:
   10.105.75.121:2377
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: aad11006b869517fcd3009450b6f82da282e1a9b
 runc version: v1.4.3-0-gbb14dabe
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-137-generic
 Operating System: Ubuntu 24.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.759GiB
 Name: manager.workers.pro.virt.i.brutesque.com
 ID: 45bdfde0-2806-4c9c-9e51-51bf0eb2be7f
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Firewall Backend: iptables
  EnableUserlandProxy: true
  UserlandProxyPath: /usr/bin/docker-proxy

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions