Comments (10)
That's odd, I have used it with mp3s/mp4s many times. Do you have a particular file you can upload somewhere so I can do a test?
from fake-s3.
This is one file I know causes the error. https://drive.google.com/file/d/0Bzgb9kfmxo16ZVM5bEtyTTBFVDA/view?usp=sharing
All my other music files do the same however.
from fake-s3.
I was able to repro this with a node.js buffer containing plain text. Here's what I did:
- Run
fakes3 -r /mnt/fakes3_root -p 4567
- Create a new node.js AWS S3 client like this:
var client = new AWS.S3({
accessKeyId: 'AWS_ACCESS_KEY',
secretAccessKey: 'SECRET_ACCESS_KEY',
Bucket: 'my-bucket',
region: 'us-standard',
s3ForcePathStyle: true,
endpoint: new AWS.Endpoint('http://localhost:4567')
});
- Call
putObject
:
client.putObject({
Bucket: 'my-bucket',
Key: 'test/test-file.txt',
Body: new Buffer('i am test file\n'),
ContentType: 'text/plain'
}, function (err, data) {
if (err) {
console.log('error!', err);
} else {
/* ... */
}
});
This logs:
error! { [XMLParserError: Unexpected close tag
Line: 11
Column: 9
Char: >]
message: 'Unexpected close tag\nLine: 11\nColumn: 9\nChar: >',
code: 'XMLParserError',
time: Tue May 19 2015 22:04:24 GMT-0700 (PDT),
statusCode: 500,
retryable: true }
Here is some more debugging info that may help?
$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-darwin14.1.0]
$ node -v
v0.10.32
Let me know if there's anything else I can do. Thanks!
from fake-s3.
Hi. I do have the same error, did you found what was going on? (or a workaround). In my case it happens while uploading a flac file, in multipart. using aws-sdk and s3-upload-stream (nodejs).
from fake-s3.
If it helps, here is the xml returned by fake-s3:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD><TITLE>Internal Server Error</TITLE></HEAD>
<BODY>
<H1>Internal Server Error</H1>
undefined method `Error' for #<FakeS3::FileStore:0x007fc63da56df0>
<HR>
<ADDRESS>
WEBrick/1.3.1 (Ruby/2.1.6/2015-04-13) OpenSSL/1.0.1k at
s3:80
</ADDRESS>
</BODY>
</HTML>
from fake-s3.
@gorghoa I got that error as well, but the message isn't very helpful because its actually an error while trying to throw the error. This was mentioned in #111 at the very end. I would submit a PR but the maintainer is not very responsive. Fixing that error will just cause you to get the "invalid file chunk" error, which I do not know how to fix.
from fake-s3.
#98 might be helpful here. It fixed the issue for me (mine was a .zip file though, not an mp3 or flac). I wasn't even using a Java client either, awscli in my case (which is a python client).
from fake-s3.
Hi,
Have the same error in here... Using [email protected], [email protected], i'm trying to upload a .jpg and i can't manage to do it... Debugging a little bit, i think i found the error that causes that message:
"<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body { text-align:center;font-family:helvetica,arial;font-size:22px;
color:#888;margin:20px}
#c {margin:0 auto;width:500px;text-align:left}
</style>
</head>
<body>
<h2>Sinatra doesn’t know this ditty.</h2>
<img src='http://localhost:4568/__sinatra__/404.png'>
<div id="c">
Try this:
<pre># in web_interface.rb
class FakeSQS::WebInterface
put '/073f02f5-f6e5-45aa-a89d-341b8687f125.png' do
"Hello World"
end
end
</pre>
</div>
</body>
</html>"
When NodeXMLParser wants to parse that string, throws XMLParserError, i really don't now what's going on...
NodeXmlParser.prototype.parse = function(xml, shape) {
shape = shape || {};
var result = null;
var error = null;
var parser = new xml2js.Parser(options);
parser.parseString(xml, function (e, r) {
error = e;
result = r;
});
}
I'm sure that the error it's not that... Something is causing it....
from fake-s3.
I am trying to upload a video i.e. mp4 file to S3 bucket. While doing that I got the below error. I read the above conversation. But I was not able to solve this issue. @JakeChampion do you have input (as you closed this issue.).
code:"XMLParserError"
message:"Non-whitespace before first tag.↵Line: 0↵Column: 1↵Char: {"
retryable:true
statusCode:400
time:"2017-01-25T22:57:07.289Z"
Any input is appreciated.
from fake-s3.
@JakeChampion Thanks for re-opening the issue.
After going through my code, I finally got it to work. Since I am using both DynamoDB and S3 in my Node Application, one of the controller had a declaration which looked like below:
AWS.config.update({ region: config.AWS.region, endpoint: config.AWS.dynamoEndpoint});
This was making my S3 code point to DynamoDB endpoint due to which I was getting XML Parse Error. So I removed the endpoint declaration and the config update looked like:
AWS.config.update({ region: config.AWS.region});
from fake-s3.
Related Issues (20)
- [Feature] Add support of payer option, to allow usage with ansible s3_bucket library
- fakes3 error
- [Bug] Error message "undefined method `gsub' for nil:NilClass" when attempting to store something.
- [Bug] Multipart Upload Fails for Large Files
- Incorrect behavior when using Prefix HOT 1
- [Other] LoadError: load error: jopenssl/load -- java.lang.IncompatibleClassChangeError: Implementing class
- [Bug] X-Amz-Content-Sha256 is not allowed for upload
- [Feature] Multipart upload more descriptive error message for uploading one part HOT 2
- License timebomb should be a major version HOT 3
- [Question] Next release? HOT 1
- [Feature] Support GET Bucket requestPayment
- [QUESTION] Where I can find the CI service? HOT 1
- [Bug] Deleting "fake" directories
- [Bug] Licensing does not work for certain valid email addresses HOT 5
- [Bug] Cannot upload files with size > 2GB
- [Question]: Are files actually created when uploading or is file creation simulated?
- [Bug] Prevent directory traversal
- "rake test_sever" not working in windows. is there any way to resolve this ? HOT 1
- Ruby 3.1 compatibility HOT 1
- [Feature] Support for AWS v3 SDK
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fake-s3.