For what I know the configuration files need to be already in the test/resource directory before runnin. I copy them to the directory using a maven maven-antrun-plugin in the generate-test-sources phase. And the framework can "create a collection” without the configfiles, but it will obviously fail when try to use it.
On the surface, this znode already exists: /solr/configs/collection2 So it looks like somehow you're > On Jun 4, 2019, at 12:29 PM, Pratik Patel <pra...@semandex.net > <mailto:pra...@semandex.net>> wrote: > > /solr/configs/collection2 > On Jun 4, 2019, at 14:29, Pratik Patel <pra...@semandex.net> wrote: > > Hello Everyone, > > I am trying to run a simple unit test using solr test framework. At this > point, all I am trying to achieve is to be able to upload some > configuration and create a collection using solr test framework. > > Following is the simple code which I am trying to run. > > private static final String COLLECTION = "collection2" ; > > private static final int numShards = 1; > private static final int numReplicas = 1; > private static final int maxShardsPerNode = 1; > private static final int nodeCount = (numShards*numReplicas + > (maxShardsPerNode-1))/maxShardsPerNode; > > private static final String id = "id"; > private static final String CONFIG_DIR = > "src/test/resources/testdata/solr/collection2"; > > @BeforeClass > public static void setupCluster() throws Exception { > > // create and configure cluster > configureCluster(nodeCount) > .addConfig("collection2", getFile(CONFIG_DIR).toPath()) > .configure(); > > // create an empty collection > CollectionAdminRequest.createCollection(COLLECTION, "collection2", > numShards, numReplicas) > .setMaxShardsPerNode(maxShardsPerNode) > .process(cluster.getSolrClient()); > > // add further document(s) here > // TODO > } > > > However, I see that solr fails to upload the configuration to zk. > Following method of ZooKeeper class fails with the "KeeperException" > > public String create(final String path, byte data[], List<ACL> acl, > CreateMode createMode) > throws KeeperException, InterruptedException > { > final String clientPath = path; > PathUtils.validatePath(clientPath, createMode.isSequential()); > > final String serverPath = prependChroot(clientPath); > > RequestHeader h = new RequestHeader(); > h.setType(ZooDefs.OpCode.create); > CreateRequest request = new CreateRequest(); > CreateResponse response = new CreateResponse(); > request.setData(data); > request.setFlags(createMode.toFlag()); > request.setPath(serverPath); > if (acl != null && acl.size() == 0) { > throw new KeeperException.InvalidACLException(); > } > request.setAcl(acl); > ReplyHeader r = cnxn.submitRequest(h, request, response, null); > if (r.getErr() != 0) { > throw KeeperException.create(KeeperException.Code.get(r.getErr()), > clientPath); > } > if (cnxn.chrootPath == null) { > return response.getPath(); > } else { > return response.getPath().substring(cnxn.chrootPath.length()); > } > } > > > And following are the Keeper exceptions thrown for each file of the > configuration. > > Basically, it says > Got user-level KeeperException when processing sessionid:.... Error > Path:/solr/configs Error:KeeperErrorCode = NodeExists for /solr/configs > > ************************************************************************************************************** > 2019-06-04T15:07:01,157 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0xe zxid:0x40 txntype:-1 reqpath:n/a Error Path:/solr/configs > Error:KeeperErrorCode = NodeExists for /solr/configs > 2019-06-04T15:07:01,158 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0xf zxid:0x41 txntype:-1 reqpath:n/a Error > Path:/solr/configs/collection2 Error:KeeperErrorCode = NodeExists for > /solr/configs/collection2 > 2019-06-04T15:07:01,158 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x10 zxid:0x42 txntype:-1 reqpath:n/a Error > Path:/solr/configs/collection2/conf Error:KeeperErrorCode = NodeExists for > /solr/configs/collection2/conf > 2019-06-04T15:07:01,160 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x12 zxid:0x44 txntype:-1 reqpath:n/a Error Path:/solr/configs > Error:KeeperErrorCode = NodeExists for /solr/configs > 2019-06-04T15:07:01,160 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x13 zxid:0x45 txntype:-1 reqpath:n/a Error > Path:/solr/configs/collection2 Error:KeeperErrorCode = NodeExists for > /solr/configs/collection2 > 2019-06-04T15:07:01,161 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x14 zxid:0x46 txntype:-1 reqpath:n/a Error > Path:/solr/configs/collection2/conf Error:KeeperErrorCode = NodeExists for > /solr/configs/collection2/conf > 2019-06-04T15:07:01,162 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x16 zxid:0x48 txntype:-1 reqpath:n/a Error Path:/solr/configs > Error:KeeperErrorCode = NodeExists for /solr/configs > 2019-06-04T15:07:01,163 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x17 zxid:0x49 txntype:-1 reqpath:n/a Error > Path:/solr/configs/collection2 Error:KeeperErrorCode = NodeExists for > /solr/configs/collection2 > 2019-06-04T15:07:01,163 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x18 zxid:0x4a txntype:-1 reqpath:n/a Error > Path:/solr/configs/collection2/conf Error:KeeperErrorCode = NodeExists for > /solr/configs/collection2/conf > 2019-06-04T15:07:01,165 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x1b zxid:0x4d txntype:-1 reqpath:n/a Error Path:/solr/configs > Error:KeeperErrorCode = NodeExists for /solr/configs > 2019-06-04T15:07:01,166 [ProcessThread(sid:0 cport:50192):] INFO > org.apache.zookeeper.server.PrepRequestProcessor - Got user-level > KeeperException when processing sessionid:0x1003ec815f30007 type:create > cxid:0x1c zxid:0x4e txntype:-1 reqpath:n/a Error > Path:/solr/configs/collection2 Error:KeeperErrorCode = NodeExists for > /solr/configs/collection2 > ************************************************************************************************************** > > I have searched through the mailing list and related areas. Also, I have > tried various ways of creating MiniSolrCloudCluster but I get the same > exception. > > I have made sure that a new directory is always used as BASE_DIR to > MiniSolrCloudCluster. > > Can anyone please throw some light on whats wrong here? Am I hitting any > solr test framework issue? I am using solr test framework version 7.7.1 > > Thanks a lot, > Pratik