I can provide you with more info. Please tell me what you need. I really hope someone here can help me somehow solve or workaround this, because I really need to migrate to v10 for its features.
Well as Tom Lane said a database will not have an OID of 0, so we need to know where that is coming from. On the oft chance it occurred in your 9.6 cluster can you see if:
select oid, datname from pg_database;
in the 9.6 cluster shows an OID of 0.
Also:
1) OS and version you are using?
2) Where are you getting you Postgres from?: a) Package Repo? b) Source File source?
3) Where there any issues with 9.6 cluster before you tried to upgrade from it?