You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Xuan Gong (JIRA)" <ji...@apache.org> on 2016/06/10 20:32:21 UTC

[jira] [Commented] (YARN-5231) obtaining app logs for last 'n' bytes using CLI gives 'java.io.IOException'

    [ https://issues.apache.org/jira/browse/YARN-5231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15325239#comment-15325239 ] 

Xuan Gong commented on YARN-5231:
---------------------------------

The exception might happen when there might not be that much data available to read (the other end of the pipe might not have sent that much data yet). 
Use org.apache.hadoop.io.IOUtils.skipFully(valueStream, toSkip) instead of valueStream.skip

> obtaining app logs for last 'n' bytes using CLI gives 'java.io.IOException'
> ---------------------------------------------------------------------------
>
>                 Key: YARN-5231
>                 URL: https://issues.apache.org/jira/browse/YARN-5231
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: yarn
>    Affects Versions: 2.9.0
>            Reporter: Sumana Sathish
>            Assignee: Xuan Gong
>            Priority: Blocker
>         Attachments: YARN-5231.1.patch
>
>
> Obtaining logs for last 'n' bytes gives the following exception
> {code}
> yarn logs -applicationId application_1465421211793_0004 -containerId container_e07_1465421211793_0004_01_000001 -logFiles syslog -size -1000
> Exception in thread "main" java.io.IOException: The bytes were skipped are different from the caller requested
> 	at org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat$LogReader.readContainerLogsForALogType(AggregatedLogFormat.java:838)
> 	at org.apache.hadoop.yarn.logaggregation.LogCLIHelpers.dumpAContainerLogsForALogType(LogCLIHelpers.java:300)
> 	at org.apache.hadoop.yarn.logaggregation.LogCLIHelpers.dumpAContainersLogsForALogTypeWithoutNodeId(LogCLIHelpers.java:224)
> 	at org.apache.hadoop.yarn.client.cli.LogsCLI.printContainerLogsForFinishedApplicationWithoutNodeId(LogsCLI.java:447)
> 	at org.apache.hadoop.yarn.client.cli.LogsCLI.fetchContainerLogs(LogsCLI.java:782)
> 	at org.apache.hadoop.yarn.client.cli.LogsCLI.run(LogsCLI.java:228)
> 	at org.apache.hadoop.yarn.client.cli.LogsCLI.main(LogsCLI.java:264)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org