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

Add more debug logging and error wrapping for running processes #2543

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

triarius
Copy link
Contributor

@triarius triarius commented Dec 6, 2023

A customer is seeing errors trying to start a process on an exotic platform that we currently don't support. They are getting an error from (*Process).Run. Let's add some debug logging and error wrapping to see what's going on.

A customer is seeing errors trying to start a process on an exotic platform that we currently don't support. Currently, they are getting an error from (*Process).Run. Lets add some debug logging and error wrapping to see what's going on.
@triarius triarius requested a review from a team December 6, 2023 03:17
err = nil
}
switch {
case errors.Is(err, syscall.EIO):
Copy link
Contributor Author

@triarius triarius Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess technically this catches errors that are not os.PathError that also happen to wrap syscall.EIO. I think it's unlikely that io.Copy will create such a thing, but I'm happy to do a more specific unwrap if we think otherwise.

@triarius triarius merged commit e32d495 into main Dec 6, 2023
@triarius triarius deleted the pdp-1972-add-more-debug-logging-for-process-running branch December 6, 2023 04:24
@v1gnesh
Copy link

v1gnesh commented Dec 8, 2023

@triarius Hey, I now see this in the log in the Pipelines page on the site.

2023-12-08 14:33:54 UTC	Error running job: error starting pty: unsupported

The build script I'm using is this
Looking at the above error, at the moment, it looks like I need to work out how to properly patch creack/pty for this platform first. Will email or report back here when ready to continue 👍

@triarius
Copy link
Contributor Author

triarius commented Dec 8, 2023

@v1gnesh pty is optional, we disable it on windows:

// Turn of PTY support if we're on Windows
runInPty := cfg.PTY
if runtime.GOOS == "windows" {
runInPty = false
}

Starting the agent with no-pty option will disable it. If getting creack/pty to work on z/OS is not a path you want to pursue, we can disable the PTY on z/OS like we do on windows. But that requires knowing what the value of runtime.GOOS is for z/OS, which you're going to have to fill us in on.

@v1gnesh
Copy link

v1gnesh commented Dec 9, 2023

Oh that's a nice option.
GOOS=zos and GOARCH=s390x.

Although the upstream Go compiler has these keywords reserved, the OS's bits haven't fully been upstreamed yet.
But when running the code/build on this platform, looking for these values, it'll work.

@v1gnesh
Copy link

v1gnesh commented Dec 10, 2023

@triarius I've successfully run the sample pipeline and all green on the BK site ❤️
Thank you! I'll continue investigating pty and try more BK stuff.

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

Successfully merging this pull request may close these issues.

3 participants