Code deploying but the driver station still says no code

I am having an odd problem where in the terminal it says:

  • at edu.wpi.first.wpilibj.RobotBase.startRobot(

  • at frc.robot.Main.main(

  • The startCompetition() method (or methods called by it) should have handled the exception above.

  • Warning at edu.wpi.first.wpilibj.RobotBase.runRobot( The robot program quit unexpectedly. This is usually due to a code error.

  • The above stacktrace can help determine where the error occurred.

  • See Reading Stacktraces — FIRST Robotics Competition documentation for more information.

  • Error at edu.wpi.first.wpilibj.RobotBase.runRobot( The startCompetition() method (or methods called by it) should have handled the exception above.


This happened when I started to do some autonomous work.
Can anyone help me out?
Thank you!
-Tres from team 7790.

Scroll up. There’s more to the message

Without seeing the whole stack trace I can’t know but the two most common causes of this is a CAN device that doesn’t really exist, or a null pointer where your either referencing something before it’s created or before a value is assigned

  • [CAN SPARK MAX] IDs: 5, WPILib or External HAL Error: CAN: Message not found Periodic Status 1

  • [CAN SPARK MAX] IDs: 5, Unable to retrieve SPARK MAX firmware version. Please verify the deviceID field matches the configured CAN ID of the controller, and that the controller is connected to the CAN Bus.

  • Unhandled exception: edu.wpi.first.hal.util.AllocationException: Channels 1 and 2 already allocated

Yes, we have came to the conclusion that our power distribution is not properly giving power to the motor controls in turn making out CAN very faulty.

1 Like

Can you open your Rio log data and see the power usage on each port to determine where exactly the issue is coming from and then check the connections for the ports?

Your code is crashing because you are trying to assign ports 1 and 2 to multiple devices. I’m assuming this is either a DoubleSolenoid or Encoder since it is printing 2 port numbers. Check to make sure all of your port numbers are unique per-device.

And that you aren’t instantiating a subsystem twice.

It was a double solenoid.