Returncode > 0! Check your code

  • An issue was encountered while running your assessment:
    Something went wrong!
    Try contacting a mentor for help

On submitting code
cpu and os server file is failing with error returncode > 0! Check your code.

use this to get clear idea

Any specific source to refer?

I am able to execute script in my terminal correctly

have you read that as i have mentioned?

yes but I am able to execute script in my terminal correctly so don’t know what syntax error in bash

ok ok got it make sure you are executing and following instructions as those are mentioned clearly and not executing bash scripts in any relative directory and then make sure you are getting right output and also i am looking into your code

I am not able to find any issue as of now

found your issue make sure you are getting value according to parameter mentioned in TODO’s Like KB or MB

Still no improvement error is something else according to me, script is not able to run properly is there relative directory issue?

hey i have found your mistake in cpu file just look into this you are printing something which is unnecessary try to find out looking into other one and also share screenshot of your build failure log file

It’s giving same error as shared in screenshot

share the output of your bash script which are getting test case failure

why there is parameter /etc/os-release and /proc/cpuinfo while execution of your script

It’s mention as in the execution script by default that it should be executed in this way.Although it’s of no use to me as of now

ok ok got it forgot that

Hey @Kiran Please look into this error

Hi Rishab, I see that you have used the bc command in your script. That command may not be available by default on the machine where the assessment is being run. Could you please replace bc with another way to do this.

Overall, nothing wrong with your submission. However, this is currently not supported in our system.

I am also getting the same error…
I suppose I am not populating the correct value in the cpuspeedInMHz variable…

I am confused as to what exactly should be the value that is supposed to be populated…

I’ve tried two approaches so far:

  1. Stored the speeds from each processor in /proc/cpuinfo in an array, calculated the idle percentage of each processor from /proc/stat and then populated the maximum of (idle %age * speed) in the cpuspeedInMHz variable.

  2. Populated the maximum of the speeds given in /proc/cpuinfo in the cpuspeedInMHz variable directly

Both of these approaches seem to show the same error as the topic above.

Now, I am trying to populate the variable with the max of the idle column in /proc/stat. But I am facing problem in converting the value given in the /proc/stat file to MHz

Help me out, I seem to be lost