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

err: dd: invalid argument ''dsync'' to ''oflag'' exit status 1' #510

Closed
NishantG01 opened this issue Jun 11, 2021 · 3 comments
Closed

err: dd: invalid argument ''dsync'' to ''oflag'' exit status 1' #510

NishantG01 opened this issue Jun 11, 2021 · 3 comments
Labels
type/bug Something isn't working
Milestone

Comments

@NishantG01
Copy link

Issue Description

Type: bug report , feature request or question
bug report/feature request

Describe what happened (or what feature you want)

Running blade k8s disk experiment on container with Alpine image resulted in error
blade k8s disk experiment returned with error
err: dd: invalid argument ''dsync'' to ''oflag'' exit status 1'

Describe what you expected to happen

Irrespective of the os image - Alpine, Debian, Centos, Ubuntu,... chaosblade operator should be able to handle different experiment.
It should be agnostic of the underlying os, and if needed install the binaries which are pre requisite to run any experiment download at run time.

How to reproduce it (as minimally and precisely as possible)

  1. container with alpine image
  2. run blade k8s disk

Tell us your environment

container with Alpine image
there is no dsync in dd in a alpine container

dd /?
BusyBox v1.31.1 () multi-call binary.
Usage: dd [if=FILE] [of=FILE] [ibs=N obs=N/bs=N] [count=N] [skip=N] [seek=N]
	[conv=notrunc|noerror|sync|fsync]
	[iflag=skip_bytes|fullblock] [oflag=seek_bytes|append]
Copy a file with converting and formatting
	if=FILE		Read from FILE instead of stdin
	of=FILE		Write to FILE instead of stdout
	bs=N		Read and write N bytes at a time
	ibs=N		Read N bytes at a time
	obs=N		Write N bytes at a time
	count=N		Copy only N input blocks
	skip=N		Skip N input blocks
	seek=N		Skip N output blocks
	conv=notrunc	Don't truncate output file
	conv=noerror	Continue after read errors
	conv=sync	Pad blocks with zeros
	conv=fsync	Physically write data out before finishing
	conv=swab	Swap every pair of bytes
	iflag=skip_bytes	skip=N is in bytes
	iflag=fullblock	Read full blocks
	oflag=seek_bytes	seek=N is in bytes
	oflag=append	Open output file in append mode
	status=noxfer	Suppress rate output
	status=none	Suppress all output

The chaosblade operator code uses oflag=dsync

// write burn
func burnWrite(directory, size string) {
	tmpFileForWrite := path.Join(directory, writeFile)
	for {
		args := fmt.Sprintf(`if=/dev/zero of=%s bs=%sM count=%d oflag=dsync`, tmpFileForWrite, size, count)
		response := cl.Run(context.TODO(), "dd", args)
		if !response.Success {
			bin.PrintAndExitWithErrPrefix(response.Err)
			return
		}
	}
}

Anything else we need to know?

@tiny-x
Copy link
Member

tiny-x commented Jun 11, 2021

Only the Coreutils library is supported.

@NishantG01
Copy link
Author

is there any plan to support other libraries, making the tool generic?

@xcaspar
Copy link
Member

xcaspar commented Aug 9, 2021

@xcaspar xcaspar added the type/bug Something isn't working label Aug 9, 2021
@xcaspar xcaspar added this to the v1.3.0 milestone Aug 9, 2021
@xcaspar xcaspar closed this as completed Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants