N
Neon3w ago
exotic-emerald

apiClient.createProjectBranchDatabase works but prints 404 unhandled exception

I'm running this code and it works, the database is created. While it works and return 201, it still logs an error all the time: Unhandled Rejection: AxiosError: Request failed with status code 404
const response = await neonClient.createProjectBranchDatabase(project.id, branch.id, {
database: {
name: databaseName,
owner_name: 'neondb_owner',
}
});
const response = await neonClient.createProjectBranchDatabase(project.id, branch.id, {
database: {
name: databaseName,
owner_name: 'neondb_owner',
}
});
It looks like internally it fails somehow but ends up creating the database. Is there any explanation to this behavior ?
2 Replies
foreign-sapphire
foreign-sapphire3w ago
Hey! I tried replicating but I can't. I'm getting 201 success, but never seeing a 404. Are you still getting this error?
exotic-emerald
exotic-emeraldOP3w ago
Yes, actually I hooked an axios interceptor to the neon client to get more log on this error. Here the output
[Neon SDK 404 Error] {
url: '/projects/twilight-glade-xxxxxxxxx/branches//databases',
method: 'get',
status: 404,
statusText: 'Not Found',
headers: Object [AxiosHeaders] {
date: 'Wed, 29 Oct 2025 13:36:33 GMT',
'content-type': 'application/json; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'keep-alive',
'referrer-policy': 'strict-origin-when-cross-origin',
'strict-transport-security': 'max-age=63072000; includeSubDomains; preload',
vary: 'Origin',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-neon-ret-request-id': 'xxxxxx',
'cf-cache-status': 'DYNAMIC',
server: 'cloudflare',
'cf-ray': 'xxxxx-IAD'
},
data: {
request_id: 'xxxxx',
code: '',
message: 'FetchProjectBranch'
},
requestData: undefined
}
[Neon SDK 404 Error] {
url: '/projects/twilight-glade-xxxxxxxxx/branches//databases',
method: 'get',
status: 404,
statusText: 'Not Found',
headers: Object [AxiosHeaders] {
date: 'Wed, 29 Oct 2025 13:36:33 GMT',
'content-type': 'application/json; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'keep-alive',
'referrer-policy': 'strict-origin-when-cross-origin',
'strict-transport-security': 'max-age=63072000; includeSubDomains; preload',
vary: 'Origin',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-neon-ret-request-id': 'xxxxxx',
'cf-cache-status': 'DYNAMIC',
server: 'cloudflare',
'cf-ray': 'xxxxx-IAD'
},
data: {
request_id: 'xxxxx',
code: '',
message: 'FetchProjectBranch'
},
requestData: undefined
}
So, it looks like AFTER creating a DB, the neon TS lib does a get databases and for some reason calls branches//databases which is incorrect Update on this, it was my bad, thanks @Sam

Did you find this page helpful?