Code Monkey home page Code Monkey logo

Comments (10)

jubos avatar jubos commented on September 23, 2024

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.

JakeChampion avatar JakeChampion commented on September 23, 2024

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.

joshuaconner avatar joshuaconner commented on September 23, 2024

I was able to repro this with a node.js buffer containing plain text. Here's what I did:

  1. Run fakes3 -r /mnt/fakes3_root -p 4567
  2. 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')
});
  1. 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.

gorghoa avatar gorghoa commented on September 23, 2024

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.

gorghoa avatar gorghoa commented on September 23, 2024

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 #&lt;FakeS3::FileStore:0x007fc63da56df0&gt;
    <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.

jchristi avatar jchristi commented on September 23, 2024

@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.

jchristi avatar jchristi commented on September 23, 2024

#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.

IvanHGuevara avatar IvanHGuevara commented on September 23, 2024

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&rsquo;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.

farhankhwaja avatar farhankhwaja commented on September 23, 2024

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.

farhankhwaja avatar farhankhwaja commented on September 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.