Error "pi is not in the sudoers file." when trying to use sudo

im trying to set up a custom script to use a dlsr and when trying to access the sudoers file i run into a where pi is not in the sudoers file.

octoprint ver: Version 1.7.2
octopi ver: Version 0.18.0, running on Raspberry Pi 4 Model B Rev 1.4

Can you still run sudo commands or did you set a root password?

as pi no sudo commands work and when i try and execute su it asks me for a password even though i never set one. raspberry is the password for pi but it does not work for su

I think the only options for you are either to try accessing the sudoers file via another linux device with card reader (like a pc or with that pi and a new image on a second sd card) or to flash a fresh image and to start over.

You can also wait some time - maybe somebody got another idea.

would it be possible for me to modify the file with only a windows pc?

You could try it with wsl2