ERROR: String formatting error: a number is required

Godot Version

4.5

Question

Question.. I’m getting this error: ERROR: String formatting error: a number is required. but with no script name or line number or anything else to go on I can’t find it to correct it. I have over 70 scripts and 100k lines of code.
Question is, where does such an error normally reside? How can one go about finding such an error with this many lines of code and files.

Is this a runtime error? Post the exact error message.

Not runtime, just when i load and start a session,.

I faintly remember having that at one point and iirc what the complaint was, was found at the last edited line. So, I’d check your last edited script.

I’m sorry that’s not much to go on with…

It is more to go on then what the compiler tells me.. Oddly I can compile an exe and this error doesn’t halt the process like most do.. I’m wondering - could this be an internal engine bug ?

Are you using any string formatting anywhere is your code? Those would obviously be first places to check.

If you can’t locate it, start deleting script files one by one from your project until the thing disappears. The last file you deleted is likely the cause.

Here’s a funny idea: search for all “print(”… Or, any string formatting you can think of. There can’t be that many?

One thing is for sure. It has to be–hopefully–a recent edit.

I did mention not runtime, this error pops up when I Ioad the editor and my project. F5 runtime does not exhibit the error. Yes, I have tons of formatting in my code, the project has 71 scripts and about 100k lines of code ( mentioned above ) so commenting them out one by one isn’t really an option. I’m not going to worry much more with it, it’s not halting production so I’m going to run with it — i guess.

This could also be a printerr() from any plugin/add-on or tool script from the project itself.

1 Like

I didn’t meant commenting out. I meant deleting the script files. It’s faster.

Are you using any vcs? You can bisect.

Yah I may try bisect. Even though the error isn’t hurting anything, it’s bugging the **** out of me. I like to run a clean console. :slight_smile:

1 Like

Looks super annoying. I’d do anything to get rid of it.

Tool scripts are probably worthy of looking at first if you have any.

1 Like

grep.. I’m going in !

I’m the same, honestly.

What I’d do is go back and think from the moment where the error pointed its ugly nose at and go from there, trying to find where I might have edited something.

If you’re using a remote repo that might be a good place to compare code with.

You probably thought of all those, but… just in case.

Good luck.

1 Like

You can try running from command line with --recovery-mode. It’ll disable tool scripts and plugins, see if the thing persists there.

1 Like

Found it using ripgrep , and ‘normalized’ was right, it was buried in a @tool.

Thanks for all the advice and support guys. :slight_smile: clean console once again!

2 Likes

Yay! :smiley:
How did it look? If you don’t mind sharing.

I was sending %s to scaffold function but localized ‘s’ was a string and it required a number… really silly, but i never localize my formatters, don’t know why i did that time.. live and learn.

1 Like