Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoTransformationFoundException, server: cloudflare #26

Closed
MikogoIT opened this issue Mar 30, 2023 · 10 comments
Closed

NoTransformationFoundException, server: cloudflare #26

MikogoIT opened this issue Mar 30, 2023 · 10 comments

Comments

@MikogoIT
Copy link

MikogoIT commented Mar 30, 2023

2023-03-30 10:23:23 W/MiraiOpenAiListener: MiraiOpenAiListener with GroupMessageEvent(group=809508660, senderName=透透羽宝, sender=1065005382, permission=MEMBER, message=[mirai:source:ids=[825893], internalIds=[1323162258], from group 1065005382 to 809508660 at 1680142913]chat)
io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class xyz.cssxsh.openai.ErrorInfoWrapper
with response from https://api.openai.com/v1/chat/completions:
status: 421 
response headers: 
cf-ray: 7afce3e92cf09fa9-SIN
, content-length: 573
, content-type: text/html
, date: Thu, 30 Mar 2023 02:23:23 GMT
, server: cloudflare

	at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:93)
	at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invokeSuspend(OpenAiClient.kt:108)
	at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invoke(OpenAiClient.kt)
	at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invoke(OpenAiClient.kt)
	at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator.validateResponse(HttpCallValidator.kt:47)
	at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator.access$validateResponse(HttpCallValidator.kt:40)
	at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator$Companion$install$3.invokeSuspend(HttpCallValidator.kt:148)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
	at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
	at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
	at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

2023-03-30 10:23:23 V/Bot.2782268437: Group(809508660) <- [mirai:quote:[mirai:source:ids=[825893], internalIds=[1323162258], from group 1065005382 to 809508660 at 1680142913], content=chat]聊天已终止

更改API后问题仍然存在

@WJHXD1B
Copy link

WJHXD1B commented Mar 30, 2023

Me,too

@cssxsh
Copy link
Owner

cssxsh commented Mar 30, 2023

截图是坏文明

@MikogoIT
Copy link
Author

大佬需要哪些信息,我给您复制

@cssxsh
Copy link
Owner

cssxsh commented Mar 30, 2023

image

日志文件在 logs 下面

@MikogoIT
Copy link
Author

image
是这个log吗(

@cssxsh
Copy link
Owner

cssxsh commented Mar 30, 2023

我都说了不要截图了

@cssxsh cssxsh closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2023
@MikogoIT
Copy link
Author

我都说了不要截图了
2023-03-30 10:23:23 W/MiraiOpenAiListener: MiraiOpenAiListener with GroupMessageEvent(group=809508660, senderName=透透羽宝, sender=1065005382, permission=MEMBER, message=[mirai:source:ids=[825893], internalIds=[1323162258], from group 1065005382 to 809508660 at 1680142913]chat)
io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class xyz.cssxsh.openai.ErrorInfoWrapper
with response from https://api.openai.com/v1/chat/completions:
status: 421
response headers:
cf-ray: 7afce3e92cf09fa9-SIN
, content-length: 573
, content-type: text/html
, date: Thu, 30 Mar 2023 02:23:23 GMT
, server: cloudflare

at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:93)
at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invokeSuspend(OpenAiClient.kt:108)
at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invoke(OpenAiClient.kt)
at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invoke(OpenAiClient.kt)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator.validateResponse(HttpCallValidator.kt:47)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator.access$validateResponse(HttpCallValidator.kt:40)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator$Companion$install$3.invokeSuspend(HttpCallValidator.kt:148)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

2023-03-30 10:23:23 V/Bot.2782268437: Group(809508660) <- [mirai:quote:[mirai:source:ids=[825893], internalIds=[1323162258], from group 1065005382 to 809508660 at 1680142913], content=chat]聊天已终止

@cssxsh cssxsh changed the title 使用插件时返回了一个状态码为 403 的响应 server: cloudflare Mar 30, 2023
@cssxsh cssxsh pinned this issue Mar 30, 2023
@cssxsh cssxsh changed the title server: cloudflare NoTransformationFoundException, server: cloudflare Mar 30, 2023
@MikogoIT
Copy link
Author

大佬,“NoTransformationFoundException, server: cloudflare”这个是我的网络问题导致的吗?

@cssxsh
Copy link
Owner

cssxsh commented Mar 30, 2023

`api.openai.com` 已列入黑名单,你需要配置代理
如果没有配置,本插件会尝试做一些特殊处理,~~一般情况下也能正常使用~~
`api.openai.com` IP地址变更,套了一层 `cloudflare`, 特殊处理失效, 表现为 `403`-`text/html` 响应

看readme的更新

@MikogoIT
Copy link
Author

ok可以了,但是似乎预设语境无法使用了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants