Skip to content

NOFOLLOW_LINKS causes issues on Z/OS #3721

@Mekebra

Description

@Mekebra

Long short is that this line

try (FileChannel channel = FileChannel.open(tempFile, READ, NOFOLLOW_LINKS)) {

When run on IBM Z/OS a Second time, causes this:

Caused by: java.lang.UnsupportedOperationException: NOFOLLOW_LINKS not supported at java.base/sun.nio.fs.UnixChannelFactory$Flags.toFlags(UnixChannelFactory.java:100) at java.base/sun.nio.fs.UnixChannelFactory.newFileChannel(UnixChannelFactory.java:126) at java.base/sun.nio.fs.UnixChannelFactory.newFileChannel(UnixChannelFactory.java:156) at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:185) at java.base/java.nio.channels.FileChannel.open(FileChannel.java:292) at java.base/java.nio.channels.FileChannel.open(FileChannel.java:345) at co.elastic.apm.agent.common.util.ResourceExtractionUtil.extractResourceToDirectory(ResourceExtractionUtil.java:102) at co.elastic.apm.agent.common.util.ResourceExtractionUtil.extractResourceToTempDirectory(ResourceExtractionUtil.java:58) at co.elastic.apm.attach.ElasticApmAttacher$AgentJarFileHolder.getAgentJarFile(ElasticApmAttacher.java:213) at co.elastic.apm.attach.ElasticApmAttacher$AgentJarFileHolder.<init>(ElasticApmAttacher.java:208) at co.elastic.apm.attach.ElasticApmAttacher$AgentJarFileHolder.<clinit>(ElasticApmAttacher.java:205)

It'd be nice if that could be caught, and resolved. At worst, deleting the file and retrying.
Or at least provide a public method that returns the filename with the added hash, so it can be handled by us...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions