Support Questions

Find answers, ask questions, and share your expertise

ExitCodeException exitCode=1: File "/etc/hadoop/conf/topology_script.py", line 63 print rack

Guru

Hello ,

We have installed new cluster with HDP2.6.1 and ambari 2.5.1 and for every jobs we are getting following warning message though jobs are completing successfully. But why are we getting this error , can someone please help me.

18/01/16 09:52:48 WARN ScriptBasedMapping: Exception running /etc/hadoop/conf/topology_script.py

ExitCodeException exitCode=1: File "/etc/hadoop/conf/topology_script.py", line 63

print rack

^

SyntaxError: Missing parentheses in call to 'print'

at org.apache.hadoop.util.Shell.runCommand(Shell.java:944)

at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:1142)

at org.apache.hadoop.net.ScriptBasedMapping$RawScriptBasedMapping.runResolveCommand(ScriptBasedMapping.java:251)

at org.apache.hadoop.net.ScriptBasedMapping$RawScriptBasedMapping.resolve(ScriptBasedMapping.java:188)

at org.apache.hadoop.net.CachedDNSToSwitchMapping.resolve(CachedDNSToSwitchMapping.java:119)

at org.apache.hadoop.yarn.util.RackResolver.coreResolve(RackResolver.java:101)

at org.apache.hadoop.yarn.util.RackResolver.resolve(RackResolver.java:81)

at org.apache.spark.deploy.yarn.SparkRackResolver.resolve(SparkRackResolver.scala:37)

at org.apache.spark.deploy.yarn.YarnAllocator$$anonfun$handleAllocatedContainers$2.apply(YarnAllocator.scala:420)

at org.apache.spark.deploy.yarn.YarnAllocator$$anonfun$handleAllocatedContainers$2.apply(YarnAllocator.scala:419)

at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)

at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)

at org.apache.spark.deploy.yarn.YarnAllocator.handleAllocatedContainers(YarnAllocator.scala:419)

2 REPLIES 2

@Saurabh Looks like you have python3 as default python. The print syntax has been changed in python3 and hence /etc/hadoop/conf/topology_script.py is complaining that.

Guru

no Sandeep,

We have 2.7 only by default.

-bash-4.2$ python --version

Python 2.7.5

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.