Page MenuHomePhabricator

Unable to create source "v3"self._closeAsync is not a function error
Closed, ResolvedPublic

Description

When starting tilerator on maps-test2004 I get the error

[2018-05-24T11:38:45.087Z] ERROR: tilerator/14 on maps-test2004: Unable to create source "v3"self._closeAsync is not a function (levelPath=error)
    moduleUri: {"maxzoom":15,"keyspace":"v3","cp":["10.192.16.35"],"username":"tilerator","setLastModified":true}

I'm also getting font errors in genview source, but that source should depend on v3, not the other way around

Event Timeline

Pnorman created this task.May 24 2018, 11:45 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 24 2018, 11:45 AM

The only mention of _closeAsync in the code is https://github.com/kartotherian/cassandra/blob/bd4243f9578bfeae7c0210ab67924b4903b458b9/CassandraStore.js#L138 which is catching an error. This means is possible we haven't executed this code before.

@SBisson, could you have a look at this and https://github.com/kartotherian/cassandra/commit/9061b6afd1620f4918ca306ebb38777765f0b624?

I've fixed all the font errors and now the only error left is this one

[2018-05-31T02:09:45.210Z] ERROR: tilerator/14 on maps-test2004: Unable to create source "v3"self._closeAsync is not a function (levelPath=error)
    moduleUri: {"maxzoom":15,"keyspace":"v3","cp":["10.192.16.35"],"username":"tilerator","setLastModified":true}
[2018-05-31T02:09:45.221Z] ERROR: tilerator/14 on maps-test2004: Unable to create source "v3view"Source "v3" is disabled, possibly due to loading errors (levelPath=error)
    message: Unable to create source "v3view"Source "v3" is disabled, possibly due to loading errors
[2018-05-31T02:09:45.222Z] ERROR: tilerator/14 on maps-test2004: Unable to create source "osm-localized"Source "v3" is disabled, possibly due to loading errors (levelPath=error)
    message: Unable to create source "osm-localized"Source "v3" is disabled, possibly due to loading errors
[2018-05-31T02:09:45.223Z] ERROR: tilerator/14 on maps-test2004: Unable to create source "osm-pbf"Source "osm-localized" is disabled, possibly due to loading errors (levelPath=error)
    message: Unable to create source "osm-pbf"Source "osm-localized" is disabled, possibly due to loading errors
[2018-05-31T02:09:45.227Z] ERROR: tilerator/14 on maps-test2004: Unable to create source "osm-intl"Source "osm-pbf" is disabled, possibly due to loading errors (levelPath=error)
    message: Unable to create source "osm-intl"Source "osm-pbf" is disabled, possibly due to loading errors
[2018-05-31T02:09:45.230Z] ERROR: tilerator/14 on maps-test2004: Unable to create source "osm"Source "osm-pbf" is disabled, possibly due to loading errors (levelPath=error)
    message: Unable to create source "osm"Source "osm-pbf" is disabled, possibly due to loading errors

When Cassandra is running, this error goes away. It doesn't change the need to fix it, and a more meaningful error message would also be a good idea.

SBisson claimed this task.Jun 4 2018, 3:36 PM

I have renamed close() to _close() so it doesn't get called by timelive-tmsource but I didn't know Promise.promisifyAll would skip it. I've renamed it to closeConnection() in https://github.com/kartotherian/cassandra/pull/8

Cassandra needs to be running for this component to initialize correctly. When it's not, you should now get the actual error instead of the error-handling-code-erroring-out error.

Mholloway added a comment.EditedJun 4 2018, 3:44 PM

I didn't know Promise.promisifyAll would skip it.

It looked like this was happening but I didn't see anything in the Bluebird docs to support that theory. Why exactly was it skipped?

I didn't know Promise.promisifyAll would skip it.

It looked like this was happening but I didn't see anything in the docs to support that theory. Why exactly was it skipped?

The leading underscore is sometimes used to indicate something is private in javascript. Maybe that's why they skip those, I dunno. I just confirmed it experimentally.

> const Promise = require('bluebird');
> Promise.PromisifyAll({foo: function() {}, _bar: function() {}});
{ foo: [Function: foo],
  _bar: [Function: _bar],
  fooAsync: [Function: ret] }
Pnorman closed this task as Resolved.Jun 26 2018, 5:19 PM

We figured this out. On Cassandra keyspace creation time the metadata for the layer is saved in Cassandra, so testing anything here needs keyspace deletion and creation. This bedeviled debugging the problem.

If the map style contains the description and fields for each layer that is used and that information is correctly put into Cassandra this works.

Vvjjkkii renamed this task from Unable to create source "v3"self._closeAsync is not a function error to fdcaaaaaaa.Jul 1 2018, 1:08 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed SBisson as the assignee of this task.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from fdcaaaaaaa to Unable to create source "v3"self._closeAsync is not a function error.Jul 2 2018, 3:52 PM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to SBisson.
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.