Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--limit flag throws exception: invalid argument "" for "-m, --memory" flag: invalid size: '' #360

Closed
sar opened this issue May 25, 2021 · 3 comments
Labels

Comments

@sar
Copy link

sar commented May 25, 2021

Usage of the --limit and --limit=0.25 factor flag throws runtime exception.

$ x11docker --limit  {any container:tag here}

$ x11docker --version
6.6.2
x11docker note: Option --limit does not avoid possibly flooding the hard disk
  in docker's container partition or in shared folders.
  It only restricts memory and CPU usage.

awk: cmd. line:1: BEGIN {print int( * 0.5)}
awk: cmd. line:1:                   ^ syntax error
date: Unknown option 'Ihours' (see "date --help")

x11docker ERROR: Startup of docker failed. Did not receive a container ID. 
     
  Last lines of container log: 
invalid argument "" for "-m, --memory" flag: invalid size: '' 
See 'docker run --help'.

  Type 'x11docker --help' for usage information
  Debug options: '--verbose' (full log) or '--debug' (log excerpt).
  Please report issues at https://github.com/mviereck/x11docker

Related to #93 parsing of memory output on host system, message thrown above shows syntax error.

$ free -b
*see below

$ free -b | grep Mem:
Mem:      33493553152 29517516800  3976036352  1157283840  1214283776
@mviereck mviereck added the bug label May 25, 2021
@mviereck
Copy link
Owner

Thank you for the report!
I get an additional entry available that x11docker wants to parse:

$ LC_ALL=C free -b
               total        used        free      shared  buff/cache   available
Mem:      8272060416  2676961280  2929102848   271794176  2665996288  5240299520
Swap:     8821661696           0  8821661696

It seems your version of free does not provide this information.

Yet I am not sure how to solve this. Maybe x11docker should add free and buff/cache to guess available memory?

@sar
Copy link
Author

sar commented May 25, 2021

Thank you for the report!
I get an additional entry available that x11docker wants to parse:
It seems your version of free does not provide this information.

I truncated the swap, this is the actual output of the command:

$ free -b
		total        used        free      shared     buffers
Mem:      33493553152 29656408064  3837145088  1224491008  1216081920
-/+ buffers/cache:    28440326144  5053227008
Swap:      8589910016           0  8589910016

$ free --version
toybox 0.8.3

mviereck added a commit that referenced this issue May 25, 2021
--backend=nerdctl --pw=sudo: Do not use 'sudo -E'
Generalize some messages mentioning 'docker'
@mviereck
Copy link
Owner

I did not mean the swap line but a missing column. Your output does not show a column available.
I've uploaded a fix that adds the values of columns free and buffers in line mem:. That should approximately fit the available memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants