gpt4 book ai didi

mysql - SO Prisma GraphQL 错误 : Whoops. 看起来像内部服务器错误

转载 作者:行者123 更新时间:2023-11-29 15:34:21 27 4
gpt4 key购买 nike

进行查询以引入相关表不起作用并显示内部服务器错误。

我多次尝试更改 datamodel.prisma 架构,但没有成功。

当我执行此查询时:

{
videos {
id
title
sources {
id
quality
}
}
}

它返回此错误:

{
"data": {
"videos": [
{
"id": "1",
"title": "La peatonal del Vino",
"sources": null
},
{
"id": "2",
"title": "Bodega Diamandes Exterior",
"sources": null
},
{
"id": "3",
"title": "Con Boca",
"sources": null
},
{
"id": "4",
"title": "Rep y el vino",
"sources": null
},
{
"id": "5",
"title": "Pastel de chivo y ciruelas al bonarda acompañado con zapallos en manteca",
"sources": null
},
{
"id": "6",
"title": "Séptimo Clericó",
"sources": null
},
{
"id": "7",
"title": "Las ovejas de Kaiken",
"sources": null
},
{
"id": "8",
"title": "Bodega Diamandes Exterior",
"sources": null
},
{
"id": "9",
"title": "Capítulo Piloto",
"sources": null
}
]
},
"errors": [
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
0,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
},
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
1,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
},
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
2,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
},
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
3,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
},
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
4,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
},
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
5,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
},
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
6,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
},
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
7,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
},
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ck1s1nl7d001y0723idytrl5r",
"path": [
"videos",
8,
"sources"
],
"locations": [
{
"line": 5,
"column": 5
}
],
"requestId": "local:ck1s1nl7d001y0723idytrl5r"
}
]
}

这是我的 datamodel.prisma 文件:

"""This is a custom built-in Scalar type from LightHouse. It handles Carbon dates"""
scalar DateTime @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime")

type Channel {
id: ID! @id
title: String! @isUnique
description: String!
legend: String
shownOnPremieres: Boolean!
shownOnTheMostSeen: Boolean!
shownOnExploreEverything: Boolean!
videos: [Video!]!
banner: Banner @relation(link: INLINE)
}

type Subtitle {
id: ID! @id
code: String!
description: String!
url: String!
video: Video! @relation(link: INLINE)
}

type Source {
id: ID! @id
quality: String!
url: String!
video: Video! @relation(link: INLINE)
}

type Video {
id: ID! @id
title: String! @isUnique
sources: [Source!]!
thumb: String!
duration: Int!
description: String!
legend: String!
shownOnPremieres: Boolean!
shownOnTheMostSeen: Boolean!
shownOnExploreEverything: Boolean!
channel: Channel! @relation(link: INLINE)
subtitles: [Subtitle!]!
}

type Banner {
id: ID! @id
img: String! @isUnique
duration: String!
backgroundColor: String!
buttonColor: String!
textColor: String!
channel: Channel!
}

type User {
id: ID! @id
name: String!
email: String! @isUnique
email_verified_at: DateTime
password: String!
remember_token: String!
created_at: DateTime @created_at
updated_at: DateTime @updated_at
}

这是 Prisma 容器日志的输出:

mmagni@mmagni-lenovo:/var/www/masvino/Server$ sudo docker-compose logs | grep ck1rxkct500rq072706my60la
[sudo] password for mmagni:
prisma_1 | {"key":"error/unhandled","requestId":"local:ck1rxkct500rq072706my60la","clientId":"default@default","payload":{"exception":"java.sql.SQLSyntaxErrorException: (conn=397) Unknown column 'RelationTable.channel' in 'field list'","query":"{\n channels {\n id\n title\n videos {\n id\n title\n }\n }\n}\n","variables":"{}","code":"0","stack_trace":"org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:163)\\n org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:106)\\n org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:235)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:224)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:173)\\n com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)\\n com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$queryToDBIO$1(SharedSlickExtensions.scala:17)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$jooqToDBIO$1(SharedSlickExtensions.scala:56)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:70)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:69)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.liftedTree1$1(BasicBackend.scala:276)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.run(BasicBackend.scala:276)\\n java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\\n java.lang.Thread.run(Thread.java:748)","message":"(conn=397) Unknown column 'RelationTable.channel' in 'field list'"}}
prisma_1 | {"key":"error/unhandled","requestId":"local:ck1rxkct500rq072706my60la","clientId":"default@default","payload":{"exception":"java.sql.SQLSyntaxErrorException: (conn=397) Unknown column 'RelationTable.channel' in 'field list'","query":"{\n channels {\n id\n title\n videos {\n id\n title\n }\n }\n}\n","variables":"{}","code":"0","stack_trace":"org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:163)\\n org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:106)\\n org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:235)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:224)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:173)\\n com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)\\n com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$queryToDBIO$1(SharedSlickExtensions.scala:17)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$jooqToDBIO$1(SharedSlickExtensions.scala:56)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:70)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:69)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.liftedTree1$1(BasicBackend.scala:276)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.run(BasicBackend.scala:276)\\n java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\\n java.lang.Thread.run(Thread.java:748)","message":"(conn=397) Unknown column 'RelationTable.channel' in 'field list'"}}
prisma_1 | {"key":"error/unhandled","requestId":"local:ck1rxkct500rq072706my60la","clientId":"default@default","payload":{"exception":"java.sql.SQLSyntaxErrorException: (conn=397) Unknown column 'RelationTable.channel' in 'field list'","query":"{\n channels {\n id\n title\n videos {\n id\n title\n }\n }\n}\n","variables":"{}","code":"0","stack_trace":"org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:163)\\n org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:106)\\n org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:235)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:224)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:173)\\n com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)\\n com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$queryToDBIO$1(SharedSlickExtensions.scala:17)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$jooqToDBIO$1(SharedSlickExtensions.scala:56)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:70)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:69)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.liftedTree1$1(BasicBackend.scala:276)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.run(BasicBackend.scala:276)\\n java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\\n java.lang.Thread.run(Thread.java:748)","message":"(conn=397) Unknown column 'RelationTable.channel' in 'field list'"}}
prisma_1 | {"key":"error/unhandled","requestId":"local:ck1rxkct500rq072706my60la","clientId":"default@default","payload":{"exception":"java.sql.SQLSyntaxErrorException: (conn=397) Unknown column 'RelationTable.channel' in 'field list'","query":"{\n channels {\n id\n title\n videos {\n id\n title\n }\n }\n}\n","variables":"{}","code":"0","stack_trace":"org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:163)\\n org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:106)\\n org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:235)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:224)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:173)\\n com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)\\n com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$queryToDBIO$1(SharedSlickExtensions.scala:17)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$jooqToDBIO$1(SharedSlickExtensions.scala:56)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:70)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:69)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.liftedTree1$1(BasicBackend.scala:276)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.run(BasicBackend.scala:276)\\n java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\\n java.lang.Thread.run(Thread.java:748)","message":"(conn=397) Unknown column 'RelationTable.channel' in 'field list'"}}
prisma_1 | {"key":"error/unhandled","requestId":"local:ck1rxkct500rq072706my60la","clientId":"default@default","payload":{"exception":"java.sql.SQLSyntaxErrorException: (conn=397) Unknown column 'RelationTable.channel' in 'field list'","query":"{\n channels {\n id\n title\n videos {\n id\n title\n }\n }\n}\n","variables":"{}","code":"0","stack_trace":"org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:163)\\n org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:106)\\n org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:235)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:224)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:173)\\n com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)\\n com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$queryToDBIO$1(SharedSlickExtensions.scala:17)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$jooqToDBIO$1(SharedSlickExtensions.scala:56)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:70)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:69)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.liftedTree1$1(BasicBackend.scala:276)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.run(BasicBackend.scala:276)\\n java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\\n java.lang.Thread.run(Thread.java:748)","message":"(conn=397) Unknown column 'RelationTable.channel' in 'field list'"}}
prisma_1 | {"key":"error/unhandled","requestId":"local:ck1rxkct500rq072706my60la","clientId":"default@default","payload":{"exception":"java.sql.SQLSyntaxErrorException: (conn=397) Unknown column 'RelationTable.channel' in 'field list'","query":"{\n channels {\n id\n title\n videos {\n id\n title\n }\n }\n}\n","variables":"{}","code":"0","stack_trace":"org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:163)\\n org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:106)\\n org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:235)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:224)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)\\n org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:173)\\n com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)\\n com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$queryToDBIO$1(SharedSlickExtensions.scala:17)\\n com.prisma.connector.shared.jdbc.SharedSlickExtensions.$anonfun$jooqToDBIO$1(SharedSlickExtensions.scala:56)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:70)\\n slick.jdbc.SimpleJdbcAction.run(StreamingInvokerAction.scala:69)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.liftedTree1$1(BasicBackend.scala:276)\\n slick.basic.BasicBackend$DatabaseDef$$anon$3.run(BasicBackend.scala:276)\\n java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\\n java.lang.Thread.run(Thread.java:748)","message":"(conn=397) Unknown column 'RelationTable.channel' in 'field list'"}}

我该怎么做才能得到这个回复?

{
"data": {
"videos": [
{
"id": "1",
"title": "La peatonal del Vino",
"sources": [
{
"id": "1",
"quality": "320p"
},
{
"id": "2",
"quality": "480p"
},
{
"id": "3",
"quality": "1080p"
}
]
},

...

]
}
}

我尝试了很多方法都没有成功。 sources 字段不断出现 null

最佳答案

解决方案是将数据库内容转储到备份文件,删除数据库上的所有表,重新部署 prisma 应用程序并将备份文件导入回数据库。

关于mysql - SO Prisma GraphQL 错误 : Whoops. 看起来像内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58398962/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com