It's not clear how you attempted the in-place upgrade repair.
Here are basic 'safe' steps:
a. Create a disk image of what you have now- just in case something goes badly wrong.
b. Check your disk(s) (e.g. Hard Disk Sentinel)
c. If ok, run
chkdsk c: /scan
from an admin command prompt
d. If ok, run
SFC /SCANNOW
similarly
Proceed if ok.
Uninstall any less common 3rd party security programs.
Check you have at least 30Gb free on C:
1. download the iso file (e.g. using the MS media creation tool if your build is 19044)
Tutorial available - includes how to get older builds.
2. right click the iso file
3. click Mount (available by default)
4. disconnect the internet (you're NOT going to get updates as part of this right now)
5. Open new drive letter created
6. Double click setup.exe
Now consider your error number. See e.g.
FIX 0xC1900101 - 0x40017: Installation failed in SECOND_BOOT phase in Windows 10 Update. (Solved) • Repair Windows™
Note: no guarantees of an easy solution here.