Closed vagile-cn closed 2 years ago
Any errors/details in server/audit logs?
I think that mean the CopyObject method is removed in MinIO, can any other method replace this method?
MinIO code says that it supports CopyObject. Without additional information from your logs (that shows what and where was being copied, and what was the exact reason), there is no way to know what's going on.
See MinIO documentation for how to get the logs.
I can't find how to turn on the audit logs I watch the bucket file and get the result then I trace the request
this is the result in mediawiki
Please add the following to LocalSettings.php:
$wgDebugLogGroups['FileOperation'] = '/path/to/logfile.txt';
(change /path/to/logfile.txt
to whatever, this file should be writable by webserver)
This log will at least tell us what is being copied from where to where. Screenshots above don't tell us anything.
Also note that CopyObject
is only used when deleting/renaming/reuploading files. It's not used when uploading a new file.
let me get log.... are you sure minio support CopyObject?
2021-11-01 08:05:10 vz-wiki3d wiki3d: S3FileBackend: found backend with S3 buckets: minio/wiki3d/update, minio/wiki3d/update/thumb, minio/wiki3d/update/deleted, minio/wiki3d/update/temp.
2021-11-01 08:05:10 vz-wiki3d wiki3d: S3FileBackend: doPrepareInternal: S3 bucket minio, dir=wiki3d/update/temp/, params=noAccess, noListing, dir
2021-11-01 08:05:10 vz-wiki3d wiki3d: S3FileBackend: doCreateInternal(): saving wiki3d/update/temp/20211101080510!phpqoiAFA.png in S3 bucket minio (sha1 of the original file: gkqx7kbwlhf87k66o4x42m4opa07bl6, Content-Type: image/png)
2021-11-01 08:05:10 vz-wiki3d wiki3d: S3FileBackend: Performance: 0.099 second spent on: uploading wiki3d/update/temp/20211101080510!phpqoiAFA.png to S3
2021-11-01 08:05:10 vz-wiki3d wiki3d: S3FileBackend: doGetFileStat(): obtaining information about wiki3d/update/temp/20211101080510!phpqoiAFA.png in S3 bucket minio
2021-11-01 08:05:10 vz-wiki3d wiki3d: S3FileBackend: doPrepareInternal: S3 bucket minio, dir=wiki3d/update/temp/, params=noAccess, noListing, dir
2021-11-01 08:05:10 vz-wiki3d wiki3d: S3FileBackend: doCopyInternal(): copying wiki3d/update/temp/20211101080510!phpqoiAFA.png from S3 bucket minio to wiki3d/update/temp/18qmmx8rbo44.1dmztw.1.png.0 from S3 bucket minio.
2021-11-01 08:05:10 vz-wiki3d wiki3d: S3FileBackend: exception NoSuchBucket in doCopyInternal from CopyObject ({"ACL":"private","Bucket":"minio","CopySource":"minio/wiki3d/update/temp/20211101080510%21phpqoiAFA.png","Key":"wiki3d/update/temp/18qmmx8rbo44.1dmztw.1.png.0","MetadataDirective":"COPY","@http":[],"@context":[]}): Error executing "CopyObject" on "http://minio.vz-minio:9000/wiki3d/update/temp/18qmmx8rbo44.1dmztw.1.png.0"; AWS HTTP error: Client error: PUT http://minio.vz-minio:9000/wiki3d/update/temp/18qmmx8rbo44.1dmztw.1.png.0
resulted in a 404 Not Found
response:
<?xml version="1.0" encoding="UTF-8"?>
NoSuchBucket
NoSuchBucket
BadRequest
BadRequest
are you sure minio support CopyObject?
are you sure minio support CopyObject?
=_= okkkkk but why I got the not found result = = sorry for the inconvenience = =~~~
NoSuchBucket in doCopyInternal from CopyObject ({"ACL":"private","Bucket":"minio","CopySource":"minio/wiki3d/update/temp/20211101080510%21phpqoiAFA.png","Key":"wiki3d/update/temp/18qmmx8rbo44.1dmztw.1.png.0",
Returns NoSuchBucket
for some reason.
Per the log, both Bucket
and CopySource
parameters use the correct bucket name (minio
), as the same bucket name worked in doCreateInternal()
earlier (which does PutObject
).
The reason is unknown, but the error is not on the side of Extension:AWS (it calls the method with correct parameters). Must be a misconfiguration of minio or something.
I have another question that I use my minio server that url is http://vz-minio:9000 when I set the bucketName to wiki3d the url will change to http://wiki3d.vz-minio:9000 how can I use minio with http://vz-minio:9000? I think the question whth CopyObject may be is because that I set the bucketName to minio to use the url http://minio.vz-minio:9000 thanks so much
Probably needs $wgAWSBucketDomain = 'vz-minio:9000';
I was set $wgAWSBucketDomain to the url to visit MinIO's file but the log mean mediawiki still upload file to http://wiki3d.vz-minio:9000
Ok, these are two different things entirely. $wgAWSBucketDomain affects public URLs (from which the visitors download images), nothing more.
When doing internal API requests, AWS client always prepends bucket name to endpoint. This is intended behavior.
So you should have wiki3d.vz-minio, minio.vz-minio, etc. pointed to the same IP address as vz-minio (e.g. in /etc/hosts).
I change the para that set $wgFileBackends['s3']['endpoint'] = 'http://vz-minio:9000/wiki3d/'; $wgAWSBucketName = "wiki3d"; $wgAWSBucketTopSubdirectory="/update";
and public url is $wgAWSBucketDomain = 'https://my_url/wiki3d';
but I get upload file url is https://https//my_url/wiki3d/update/Image2.png
what's happend = =
Remove the protocol from $wgAWSBucketDomain
. Domain name (and port if needed) only.
Remove the protocol from
$wgAWSBucketDomain
. Domain name (and port if needed) only.
but..... how can I use it with http?
Not supported.
Not supported.
ok~~~ thanks u very much
MinIO CopyObject look like Not Found