The "P17" error on an APC Smart-UPS indicates a Bypass Relay Weld fault, meaning the internal transfer relay is stuck. To fix this, you should first attempt a brain dead reset by following the steps below.
State Reset - Brain Dead Methods Instructions:
Step 1: Safely Shutdown and disconnect all connected equipment
Step 2: Unplug from utility.
Step 3: Disconnect battery connector
Step 4: Hold down the power button to discharge the unit.
Step 5: Connect the battery connector and hold the power button to turn on.
Step 6: Reconnect to utility power.