Open Lostsite opened 1 month ago
👀 @Lostsite
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
Hello, @Lostsite! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this issue.
The error you're encountering, "Unsupported GET-request to mutation procedure at path 'file.parseFileToChunks'", indicates that a GET request is being made to a mutation endpoint, which only supports POST requests. Here are some steps to resolve this issue:
Ensure Correct Request Method:
Verify that the asyncParseFileToChunks
method in your code is correctly using the mutate
method to trigger the mutation. This should ensure that a POST request is made.
async asyncParseFileToChunks(fileId: string, payload: JWTPayload, skipExist?: boolean) {
const result = await this.fileModel.findById(fileId);
if (!result) return;
if (skipExist && result.chunkTaskId) return;
const asyncTaskId = await this.asyncTaskModel.create({
status: AsyncTaskStatus.Processing,
type: AsyncTaskType.Chunking,
});
await this.fileModel.update(fileId, { chunkTaskId: asyncTaskId });
const asyncCaller = await createAsyncServerClient(this.userId, payload);
asyncCaller.file.parseFileToChunks
.mutate({ fileId: fileId, taskId: asyncTaskId })
.catch(async (e) => {
console.error('[ParseFileToChunks] error:', e);
await this.asyncTaskModel.update(asyncTaskId, {
error: new AsyncTaskError(
AsyncTaskErrorType.TaskTriggerError,
'trigger file parse async task error. Please check your app is public available or check your proxy settings is set correctly.',
),
status: AsyncTaskStatus.Error,
});
});
return asyncTaskId;
}
Check Reverse Proxy Configuration: Ensure that your Apache reverse proxy configuration is correctly forwarding POST requests. The configuration you provided looks correct, but double-check for any potential issues.
<VirtualHost *:80>
ServerName my.domain.example.com
ProxyPreserveHost On
ProxyPass / http://localhost:3210/
ProxyPassReverse / http://localhost:3210/
ErrorLog ${APACHE_LOG_DIR}/my.domain.example.com.log
CustomLog ${APACHE_LOG_DIR}/my.domain.example.com-access.log combined
</VirtualHost>
Network and Firewall Rules:
Ensure that your Docker network and firewall rules are not interfering with the request methods. The nftables
configuration you provided should not affect the request methods, but it's worth double-checking.
table ip filter {
chain input {
type filter hook input priority 0; policy accept;
iifname != "lo" tcp dport 3210 counter drop
}
}
Docker Deployment Configuration: Verify that there are no specific configurations in your Docker deployment that might affect the HTTP request methods. Ensure that the network mode and port mappings are correctly set up.
network_mode: 'service:network-service'
By following these steps, you should be able to resolve the issue and ensure that the correct request method is used for the mutation procedure [1][2].
To continue talking to Dosu, mention @dosu.
If anyone can give me a hint? I just tried to deploy the newest docker image, the same issue happens once again. Still gives message: 'Unsupported GET-request to mutation procedure at path "file.parseFileToChunks"'
If anyone had successfully performed docker deploy with reverse proxy, could anyone give me a hint about how to correctly deploy this?
📦 Environment
Docker
📌 Version
v1.15.18
💻 Operating System
Ubuntu, Other Linux
🌐 Browser
Firefox
🐛 Bug Description
Upload a file, try to chunk, filed. The file can correctly preview and download, just can't chunk.
Here is the error log (confidential information been removed, include domain name and token):
📷 Recurrence Steps
Special steps during deploy: docker arguments:
docker run -it -d -p 127.0.0.1:3210:3210 --network="host" --------- (rest are same)
(Set --network="host" to connect to local pgsql)
Set nft tables to drop all traffic from outside to port 3210
Set Apache httpd to do reverse proxy
Last use certbot to get a CA, also let it auto config the https redirect.
🚦 Expected Behavior
No response
📝 Additional Information
Server Operating System: Debian 12, with local pgsql installation.