Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Cannot query table storage against Docker image - what am I doing wrong? #162

Closed
tomasaschan opened this issue Mar 7, 2018 · 3 comments
Closed

Comments

@tomasaschan
Copy link

I've started the docker image using

docker run --rm --name azurite -d -t -p 10000:10000 -p 10001:10001 -p 10002:10002 -v "$(pwd):/opt/azurite/folder" -e executable=table arafato/azurite

and now I'm trying to connect to Table Storage using the Azure CLI:

az storage table list --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;'

but it crashes (returns 500 Internal Server Error) with the following message:

Internal Server Error
Cannot read property 'tableName' of undefined

Am I doing something wrong, or is there a bug in the emulator?

@tomasaschan
Copy link
Author

tomasaschan commented Mar 8, 2018

I've been able to verify this with a (somewhat) simple test; see the code snippet at the bottom. It boils down to req.azuriteRequest not being defined here, but I don't really know why it's undefined, or where its value should have been set even though it wasn't. I'll keep digging, but any advice would be much appreciated.

const chai = require("chai"),
  chaiHttp = require("chai-http"),
  should = chai.should(),
  expect = chai.expect,
  BbPromise = require("bluebird"),
  fs = BbPromise.promisifyAll(require("fs-extra")),
  Azurite = require("./../lib/AzuriteTable"),
  rp = require("request-promise"),
  path = require("path"),
  xml2js = require("xml2js");

chai.use(chaiHttp);

const containerName = "testcontainer";
const tableName = "testtable";

const url = "http://localhost:10002";
const urlPath = "/devstoreaccount1";

describe("Table HTTP API", () => {
  const azurite = new Azurite();

  before(() => {
    const location = path.join(process.env.AZURITE_LOCATION, "TABLE");
    return azurite.init({ l: location, silent: "true", overwrite: "true" });
  });

  after(() => {
    return azurite.close();
  });

  describe("List tables", () => {
    it("doesn't blow up when listing tables", () =>
      chai
        .request(url)
        .get(`${urlPath}/Tables`)
        .set("Accept", "application/json")
        .send()
        .then(res => {
          res.should.have.status(200);
        })
        // uncomment to see entire error with stacktrace etc:
        // .catch(err => {
        //   console.log(JSON.stringify(err, null, 2));
        // })
        );
  });
});

@arafato
Copy link
Owner

arafato commented Mar 8, 2018

Hi @tlycken ! The reason Azurite crashes is that QueryTables has not been implemented yet. I'm aiming for implementing QueryTables and QueryEntities until end of next week. Will update you here.

Current support of Table storage is really limited right now. See https://github.com/arafato/azurite/blob/master/release-notes.md and https://github.com/arafato/azurite#table-storage---api-implementation-status respectively, for more details.

I planning on having full support by the end of this month, so stay tuned!

@tomasaschan
Copy link
Author

Good news! I'm willing to help with this, if I can, in order to speed it up even further :)

I'm having some difficulties following request flow at the beginning of a request, though; would you mind pointing me to the extension point(s) where I need to register/modify stuff to initialize those properties on the request object?

@tomasaschan tomasaschan mentioned this issue Mar 8, 2018
4 tasks
@arafato arafato closed this as completed Mar 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants