Closed chenluhe closed 5 months ago
I also met a similar error. I just created the app, but when I ran it, a Handling response error occurred.
I also met a similar error. I just created the app, but when I ran it, a Handling response error occurred.
Latest progress: I found that the reason is that there is no data in the Session table. Why is there no data? Ignore this reason for now. I manually added a record to the Session table, similar to this:
Then after reopening the app, this error no longer occurred, and the app page could be displayed normally.
Hi there, I'd like to clarify that the log messages No valid session found
and Requesting offline access token
are not errors. They're just INFO
messages to let you know that the app doesn't have an access token for the store that's accessing the app and that it will fetch one. We do expect the Session
table to be empty the first time you run an app, since it hasn't been installed yet.
I do see in your logs this line 20:47:18 │ remix │ GET /app?embedded=1&hmac=[...] 500 - - 15474.066 ms
indicating the request resulted in an unhandled error with HTTP status 500. But I wasn't able to reproduce this issue following your steps.
If you're able to add a try/catch
to share the details of that error we might be able to reproduce it.
@rachel-carvalho this project is created by Shopify Cli, I haven't done any changes, run it directly, but it gets 500 error, cannot save the Session data into database. I created a project before, it could run normally, after some updates by them, newly created projects are not running properly.
Hi there, I'd like to clarify that the log messages
No valid session found
andRequesting offline access token
are not errors. They're justINFO
messages to let you know that the app doesn't have an access token for the store that's accessing the app and that it will fetch one. We do expect theSession
table to be empty the first time you run an app, since it hasn't been installed yet.I do see in your logs this line
20:47:18 │ remix │ GET /app?embedded=1&hmac=[...] 500 - - 15474.066 ms
indicating the request resulted in an unhandled error with HTTP status 500. But I wasn't able to reproduce this issue following your steps.If you're able to add a
try/catch
to share the details of that error we might be able to reproduce it.
This is an exception message: ...... ...... ...... 00:27:07 │ remix │ [shopify-app/INFO] No valid session found 00:27:07 │ remix │ [shopify-app/INFO] Requesting offline access token 00:27:07 │ remix │ [shopify-app/INFO] No valid session found 00:27:07 │ remix │ [shopify-app/INFO] Requesting offline access token 00:27:23 │ remix │ request error 00:27:23 │ remix │ Response { 00:27:23 │ remix │ size: 0, 00:27:23 │ remix │ [Symbol(Body internals)]: { 00:27:23 │ remix │ body: null, 00:27:23 │ remix │ type: null, 00:27:23 │ remix │ size: 0, 00:27:23 │ remix │ boundary: null, 00:27:23 │ remix │ disturbed: false, 00:27:23 │ remix │ error: null 00:27:23 │ remix │ }, 00:27:23 │ remix │ [Symbol(Response internals)]: { 00:27:23 │ remix │ url: undefined, 00:27:23 │ remix │ status: 500, 00:27:23 │ remix │ statusText: 'Internal Server Error', 00:27:23 │ remix │ headers: {}, 00:27:23 │ remix │ counter: 0, 00:27:23 │ remix │ highWaterMark: undefined 00:27:23 │ remix │ } 00:27:23 │ remix │ } 00:27:23 │ remix │ end request ...... ...... ......
I also met a similar error. I just created the app, but when I ran it, a Handling response error occurred.
Latest progress: I found that the reason is that there is no data in the Session table. Why is there no data? Ignore this reason for now. I manually added a record to the Session table, similar to this:
Then after reopening the app, this error no longer occurred, and the app page could be displayed normally.
你好,我有类似问题,你这手动添加的数据 是如何得到的?
我是用“ pnpm create @shopify/app”直接创建了一个 项目 运行然后 出现这问题 我什么都还没做,,,,,
@koaqiu 我也是这样, 好像都是国内的, 可能触发的webhook事件没有添加店铺的session数据. 添加数据去数据库手动加, 运行app的payload里面有session数据
I am also getting this error, my http://localhost:3457/graphiql is not responding. But when accessing other paths, I can get 404
Here's my error,At first it is http 500, when I modify the file to trigger the HMR, then it will pop up http 401. hope you can make a comeback. @rachel-carvalho
16:38:57 │ remix │ ---ERROR--- _Response [Response] {
16:38:57 │ remix │ [Symbol(realm)]: { settingsObject: {} },
16:38:57 │ remix │ [Symbol(state)]: {
16:38:57 │ remix │ aborted: false,
16:38:57 │ remix │ rangeRequested: false,
16:38:57 │ remix │ timingAllowPassed: false,
16:38:57 │ remix │ requestIncludesCredentials: false,
16:38:57 │ remix │ type: 'default',
16:38:57 │ remix │ status: 500,
16:38:57 │ remix │ timingInfo: null,
16:38:57 │ remix │ cacheState: '',
16:38:57 │ remix │ statusText: 'Internal Server Error',
16:38:57 │ remix │ headersList: _HeadersList {
16:38:57 │ remix │ cookies: null,
16:38:57 │ remix │ [Symbol(headers map)]: Map(0) {},
16:38:57 │ remix │ [Symbol(headers map sorted)]: null
16:38:57 │ remix │ },
16:38:57 │ remix │ urlList: []
16:38:57 │ remix │ },
16:38:57 │ remix │ [Symbol(headers)]: _HeadersList {
16:38:57 │ remix │ cookies: null,
16:38:57 │ remix │ [Symbol(headers map)]: Map(0) {},
16:38:57 │ remix │ [Symbol(headers map sorted)]: null
16:38:57 │ remix │ }
16:38:57 │ remix │ }
16:40:13 │ remix │ ---ERROR--- _Response [Response] {
16:40:13 │ remix │ [Symbol(realm)]: { settingsObject: {} },
16:40:13 │ remix │ [Symbol(state)]: {
16:40:13 │ remix │ aborted: false,
16:40:13 │ remix │ rangeRequested: false,
16:40:13 │ remix │ timingAllowPassed: false,
16:40:13 │ remix │ requestIncludesCredentials: false,
16:40:13 │ remix │ type: 'default',
16:40:13 │ remix │ status: 401,
16:40:13 │ remix │ timingInfo: null,
16:40:13 │ remix │ cacheState: '',
16:40:13 │ remix │ statusText: 'Unauthorized',
16:40:13 │ remix │ headersList: _HeadersList {
16:40:13 │ remix │ cookies: null,
16:40:13 │ remix │ [Symbol(headers map)]: Map(0) {},
16:40:13 │ remix │ [Symbol(headers map sorted)]: null
16:40:13 │ remix │ },
16:40:13 │ remix │ urlList: []
16:40:13 │ remix │ },
16:40:13 │ remix │ [Symbol(headers)]: _HeadersList {
16:40:13 │ remix │ cookies: null,
16:40:13 │ remix │ [Symbol(headers map)]: Map(0) {},
16:40:13 │ remix │ [Symbol(headers map sorted)]: null
16:40:13 │ remix │ }
16:40:13 │ remix │ }
@koaqiu 我也是这样, 好像都是国内的, 可能触发的webhook事件没有添加店铺的session数据. 添加数据去数据库手动加, 运行app的payload里面有session数据
我试了一下,是有用。不过有没有最终解决方案啊
@koaqiu 我也是这样, 好像都是国内的, 可能触发的webhook事件没有添加店铺的session数据. 添加数据去数据库手动加, 运行app的payload里面有session数据
我发现 手动添加进去以后,还会有后续问题,能不能加个wx请教一下
哈哈, 我也是刚开始学习这个, 之前的版本都是正常的, 新版本遇到了问题, 来这找答案, 但是他们一直没解决
应该就是国内网络问题,我这边时好时坏。。。
@koaqiu 我也是这样, 好像都是国内的, 可能触发的webhook事件没有添加店铺的session数据. 添加数据去数据库手动加, 运行app的payload里面有session数据
@Zardw 我没找到session数据? 如何执行? 谢谢!
随便填吧, 也没啥数据, state和token乱写的, 不知道对后续有什么影响.
@Zardw 可以了,感谢!
When no valid session found happened, the system will call token exchange url to get the token. Due to the gfw, the node fetch function could not connect the https://xxxx.myshopify.com/admin/oauth/access_token
, and will be got the Timeout error.
me too.
same to me
@paulomarg @lizkenyon It's been a long time already. So many devs met this problem, why not nobody solve it?
When no valid session found happened, the system will call token exchange url to get the token. Due to the gfw, the node fetch function could not connect the https://xxxx.myshopify.com/admin/oauth/access_token, and will be got the Timeout error.
Unfortunately, since this is a network problem, there's not much we can do about this. The app needs to be able to connect to the Shopify to work.
I assume this isn't strictly a token exchange problem, but could you try setting unstable_newEmbeddedAuthStrategy: false
in shopify.server.js
? This will disable the token exchange strategy and revert back to redirecting the user to the install flow to get a token.
This works for me by adding a proxy to the native fetch
.
import { setGlobalDispatcher, ProxyAgent } from "undici";
import { env } from "process";
if (import.meta.env.DEV && env.https_proxy ) {
// Corporate proxy uses CA not in undici's certificate store
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
const dispatcher = new ProxyAgen({uri: new URL(env.https_proxy).toString() });
setGlobalDispatcher(dispatcher);
}
@faner11 it works for me
还没有解决办法吗
还没有解决办法吗
参考这个翻墙就可以了 https://doc.boccc.co/zh/article/clash-for-windows-tun-a8cexo/
This works for me by adding a proxy to the native
fetch
.import { setGlobalDispatcher, ProxyAgent } from "undici"; import { env } from "process"; if (import.meta.env.DEV && env.https_proxy ) { // Corporate proxy uses CA not in undici's certificate store process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; const dispatcher = new ProxyAgen({uri: new URL(env.https_proxy).toString() }); setGlobalDispatcher(dispatcher); }
Could you tell me what's the content of https_proxy ?
@xigongdaEricyang 你这个问题太基础了,去google吧,如果嫌麻烦,可以付费问问题。wx: ZmhoaDIw (这是base 64,你需要先解码)
我curl 谷歌都是通的,但仍然遇到这个问题。
@xigongdaEricyang @772265646 最终解决方案就是 搞个速度快的VPN梯子,直接全局代理过去。然后就清爽了。 记住一定要用VPN模式的,什么http socket代理的 配置起来很麻烦--你无法保证某个组件访问网络的时候能一定是通过代理走!
@chenluhe 这问题其实可以结案了,网络问题导致。
@xigongdaEricyang @772265646 最终解决方案就是 搞个速度快的VPN梯子,直接全局代理过去。然后就清爽了。 记住一定要用VPN模式的,什么http socket代理的 配置起来很麻烦--你无法保证某个组件访问网络的时候能一定是通过代理走!
@chenluhe 这问题其实可以结案了,网络问题导致。
确实!我现在一键全代了,就好了,汗
done! 上面的都试过了, 就是梯子问题,实在不行就换梯子
why this issue is closed ? still getting this error │ [shopify-app/INFO] Authenticating admin request 16:27:15 │ remix │ [shopify-app/INFO] Authenticating admin request 16:27:15 │ remix │ [shopify-app/INFO] No valid session found 16:27:15 │ remix │ [shopify-app/INFO] Requesting offline access token 16:27:15 │ remix │ [shopify-app/INFO] No valid session found 16:27:15 │ remix │ [shopify-app/INFO] Requesting offline access token 16:27:15 │ remix │ error Response { 16:27:15 │ remix │ size: 0, 16:27:15 │ remix │ [Symbol(Body internals)]: { 16:27:15 │ remix │ body: null, 16:27:15 │ remix │ type: null, 16:27:15 │ remix │ size: 0, 16:27:15 │ remix │ boundary: null, 16:27:15 │ remix │ disturbed: false, 16:27:15 │ remix │ error: null 16:27:15 │ remix │ }, 16:27:15 │ remix │ [Symbol(Response internals)]: { 16:27:15 │ remix │ url: undefined, 16:27:15 │ remix │ status: 500, 16:27:15 │ remix │ statusText: 'Internal Server Error', 16:27:15 │ remix │ headers: {}, 16:27:15 │ remix │ counter: 0, 16:27:15 │ remix │ highWaterMark: undefined 16:27:15 │ remix │ } 16:27:15 │ remix │ }
@xigongdaEricyang @772265646 最终解决方案就是 搞个速度快的VPN梯子,直接全局代理过去。然后就清爽了。 记住一定要用VPN模式的,什么http socket代理的 配置起来很麻烦--你无法保证某个组件访问网络的时候能一定是通过代理走! @chenluhe 这问题其实可以结案了,网络问题导致。
确实!我现在一键全代了,就好了,汗
你用的哪个梯子?
Steps:
The error log is as follows:
chenluhedeMacBook-Pro:shopify-app-template-remix chenluhe$ npm run dev