How to fix Solr with write.lock? - solr

I'm trying to load a core, but i have this error:
Error CREATEing SolrCore 'core': Unable to create core [core]
Caused by: /path/to/core/data/index/write.lock.
Caused by: org.apache.solr.common.SolrException: Unable to create core Caused by: org.apache.solr.common.SolrException: Lock held elsewhere:
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock held elsewhere
Caused by: java.nio.file.AccessDeniedException:
I'm unable to load this core in solr 5.5.2
There isn't a write.lock file in the directory specified. I tried to create one, but its useless.

Related

Unable to create core [collection_shard1_replica_n1] Caused by: Can't find resource 'synonyms.txt'

I run a create_collection command like the following
create_collection [-c collectionName] [-n configName] [-d configDir] [-shards #] [-replicationFactor #] [-p port] [-V]
and I got the following error in the logs.
2021-07-20 12:33:53.672 ERROR (qtp232307208-14) [ ] o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: Error CREATEing SolrCore 'collection_shard1_replica_n1': Unable to create core [collection_shard1_replica_n1] Caused by: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1312)
at org.apache.solr.handler.admin.CoreAdminOperation.lambda$static$0(CoreAdminOperation.java:95)
at org.apache.solr.handler.admin.CoreAdminOperation.execute(CoreAdminOperation.java:367)
...
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Unable to create core [collection_shard1_replica_n1]
at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1408)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1273)
... 47 more
Caused by: org.apache.solr.common.SolrException: Could not load conf for core collection_shard1_replica_n1: Can't load schema managed-schema: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
at org.apache.solr.core.ConfigSetService.loadConfigSet(ConfigSetService.java:89)
at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1381)
... 48 more
Caused by: org.apache.solr.common.SolrException: Can't load schema managed-schema: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:610)
at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:181)
at org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:105)
at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:178)
at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:46)
at org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:146)
at org.apache.solr.core.ConfigSetService.loadConfigSet(ConfigSetService.java:84)
... 49 more
Caused by: org.apache.solr.common.SolrException: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
at org.apache.solr.schema.ManagedIndexSchema.informResourceLoaderAwareObjectsInChain(ManagedIndexSchema.java:1344)
at org.apache.solr.schema.ManagedIndexSchema.informResourceLoaderAwareObjectsForFieldType(ManagedIndexSchema.java:1204)
at org.apache.solr.schema.ManagedIndexSchema.postReadInform(ManagedIndexSchema.java:1180)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:606)
... 55 more
Caused by: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'synonyms.txt' in classpath or '/configs/<configname>', cwd=C:\solr-8.6.2\server
at org.apache.solr.cloud.ZkSolrResourceLoader.openResource(ZkSolrResourceLoader.java:122)
at org.apache.lucene.analysis.synonym.SynonymGraphFilterFactory.loadSynonyms(SynonymGraphFilterFactory.java:179)
at org.apache.lucene.analysis.synonym.SynonymGraphFilterFactory.inform(SynonymGraphFilterFactory.java:154)
at org.apache.solr.schema.ManagedIndexSchema.informResourceLoaderAwareObjectsInChain(ManagedIndexSchema.java:1342)
... 58 more
I am trying to create a standalone Solr with external zookeeper. I plan to replicate it later once I get this working. I used a custom config from a previous setup.
I solved the issue with this. The configs needed to be uploaded to Zookeeper using the following command
bin/solr zk upconfig -n <name for configset> -d <path to directory with configset>
After I did this it worked like a charm with no issues.

SolrCloud throw error while creating second collection "Underlying core creation failed while creating collection"

I was run 2 node in solr with single zookeeper to configure. I'll try to create a collection like location Its create successfully and then try to create second collection like contact. Its throw error.
Make API Call for create collection
curl -sS 'http://localhost:8983/solr/admin/collections?action=CREATE&name=contact&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=conf_contact'
Response for create collection
"responseHeader":{
"status":400,
"QTime":1154},
"failure":{
"192.168.1.121:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://192.168.1.121:8983/solr: Error CREATEing SolrCore 'contact_shard2_replica_n6': Unable to create core [contact_shard2_replica_n6] Caused by: org.opensextant.solrtexttagger.TaggerRequestHandler",
"192.168.1.121:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://192.168.1.121:8983/solr: Error CREATEing SolrCore 'contact_shard1_replica_n3': Unable to create core [contact_shard1_replica_n3] Caused by: org.opensextant.solrtexttagger.TaggerRequestHandler",
"192.168.1.157:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://192.168.1.157:8983/solr: Error CREATEing SolrCore 'contact_shard2_replica_n5': Unable to create core [contact_shard2_replica_n5] Caused by: org.opensextant.solrtexttagger.TaggerRequestHandler",
"192.168.1.157:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://192.168.1.157:8983/solr: Error CREATEing SolrCore 'contact_shard1_replica_n1': Unable to create core [contact_shard1_replica_n1] Caused by: org.opensextant.solrtexttagger.TaggerRequestHandler"},
"Operation create caused exception:":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Underlying core creation failed while creating collection: contact",
"exception":{
"msg":"Underlying core creation failed while creating collection: contact",
"rspCode":400},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"Underlying core creation failed while creating collection: contact",
"code":400}}```
**Note:** 1 GB for each node solr mem size

Could not find a file system implementation for scheme 'nfs' in Apache Flink

I am using Apache Flink(v1.10.0) to stream compute my RabbitMQ data, but when I config the check point data to store NFS file system like this:
env.setStateBackend(new FsStateBackend("nfs://28736435.boston.nas.amazonaws.com:/data/k8s/data/flink/checkpoint"));
give me this error:
Caused by: org.apache.flink.runtime.client.JobSubmissionException: Failed to submit job.
at org.apache.flink.runtime.dispatcher.Dispatcher.lambda$internalSubmitJob$3(Dispatcher.java:336)
at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:822)
at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:797)
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.RuntimeException: org.apache.flink.runtime.client.JobExecutionException: Could not set up JobManager
Caused by: java.lang.RuntimeException: org.apache.flink.runtime.client.JobExecutionException: Could not set up JobManager
at org.apache.flink.util.function.CheckedSupplier.lambda$unchecked$0(CheckedSupplier.java:36)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
... 6 more
Caused by: org.apache.flink.runtime.client.JobExecutionException: Could not set up JobManager
Caused by: org.apache.flink.runtime.client.JobExecutionException: Could not set up JobManager
at org.apache.flink.runtime.jobmaster.JobManagerRunnerImpl.<init>(JobManagerRunnerImpl.java:152)
at org.apache.flink.runtime.dispatcher.DefaultJobManagerRunnerFactory.createJobManagerRunner(DefaultJobManagerRunnerFactory.java:84)
at org.apache.flink.runtime.dispatcher.Dispatcher.lambda$createJobManagerRunner$6(Dispatcher.java:379)
at org.apache.flink.util.function.CheckedSupplier.lambda$unchecked$0(CheckedSupplier.java:34)
... 7 more
Caused by: org.apache.flink.util.FlinkRuntimeException: Failed to create checkpoint storage at checkpoint coordinator side.
Caused by: org.apache.flink.util.FlinkRuntimeException: Failed to create checkpoint storage at checkpoint coordinator side.
at org.apache.flink.runtime.checkpoint.CheckpointCoordinator.<init>(CheckpointCoordinator.java:282)
at org.apache.flink.runtime.checkpoint.CheckpointCoordinator.<init>(CheckpointCoordinator.java:205)
at org.apache.flink.runtime.executiongraph.ExecutionGraph.enableCheckpointing(ExecutionGraph.java:486)
at org.apache.flink.runtime.executiongraph.ExecutionGraphBuilder.buildGraph(ExecutionGraphBuilder.java:338)
at org.apache.flink.runtime.scheduler.SchedulerBase.createExecutionGraph(SchedulerBase.java:255)
at org.apache.flink.runtime.scheduler.SchedulerBase.createAndRestoreExecutionGraph(SchedulerBase.java:227)
at org.apache.flink.runtime.scheduler.SchedulerBase.<init>(SchedulerBase.java:215)
at org.apache.flink.runtime.scheduler.DefaultScheduler.<init>(DefaultScheduler.java:120)
at org.apache.flink.runtime.scheduler.DefaultSchedulerFactory.createInstance(DefaultSchedulerFactory.java:105)
at org.apache.flink.runtime.jobmaster.JobMaster.createScheduler(JobMaster.java:278)
at org.apache.flink.runtime.jobmaster.JobMaster.<init>(JobMaster.java:266)
at org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceFactory.createJobMasterService(DefaultJobMasterServiceFactory.java:98)
at org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceFactory.createJobMasterService(DefaultJobMasterServiceFactory.java:40)
at org.apache.flink.runtime.jobmaster.JobManagerRunnerImpl.<init>(JobManagerRunnerImpl.java:146)
... 10 more
Caused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Could not find a file system implementation for scheme 'nfs'. The scheme is not directly supported by Flink and no Hadoop file system to support this scheme could be loaded.
Caused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Could not find a file system implementation for scheme 'nfs'. The scheme is not directly supported by Flink and no Hadoop file system to support this scheme could be loaded.
at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:450)
at org.apache.flink.core.fs.FileSystem.get(FileSystem.java:362)
at org.apache.flink.core.fs.Path.getFileSystem(Path.java:298)
at org.apache.flink.runtime.state.filesystem.FsCheckpointStorage.<init>(FsCheckpointStorage.java:64)
at org.apache.flink.runtime.state.filesystem.FsStateBackend.createCheckpointStorage(FsStateBackend.java:490)
at org.apache.flink.runtime.checkpoint.CheckpointCoordinator.<init>(CheckpointCoordinator.java:279)
... 23 more
Caused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Hadoop is not in the classpath/dependencies.
Caused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Hadoop is not in the classpath/dependencies.
at org.apache.flink.core.fs.UnsupportedSchemeFactory.create(UnsupportedSchemeFactory.java:58)
at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:446)
... 28 more
The manual says it support NFS file system to store check points. where I am doing wrong with NFS file system config in Apache Flink?
You'll need to mount the NFS volume on every instance, and use the 'file' scheme, not 'nfs'.
Since you are running on AWS, it would be natural to use S3 for checkpointing. If you decide to do so, you should use flink-s3-fs-presto (s3p://) rather than flink-s3-fs-hadoop (s3a://), because the hadoop implementation has poor performance for checkpointing with Flink.

Strange Runtime Exception

I recently deleted my Netbeans Cache folder (/appdata/local/netbeans/cache/) and my codenameone apps that make use of the native google maps plugin have been acting up. I get a runtime exception at startup. Below is the stacktrace.
I have removed cn1 plugin from NB, downloaded new copy of the native maps cn1lib, cleaned and built and i still get the same error... please help.
[EDT] 0:0:4,404 - Exception: java.lang.NoClassDefFoundError - Could not initialize class com.codename1.impl.javase.StubLocationManager
at com.codename1.impl.javase.JavaSEPort.getLocationManager(JavaSEPort.java:8945)
at com.codename1.ui.Display.getLocationManager(Display.java:3573)
at com.labafrique.creporter.MyApplication.writeLocation(MyApplication.java:2544)
at com.labafrique.creporter.MyApplication.lambda$null$0(MyApplication.java:151)
at com.codename1.ui.Display.processSerialCalls(Display.java:1298)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1242)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1130)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:273)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:268)
at javafx.application.Platform.runLater(Platform.java:83)
at com.codename1.impl.javase.LocationSimulation.unitActionPerformed(LocationSimulation.java:609)
at com.codename1.impl.javase.LocationSimulation.access$1900(LocationSimulation.java:40)
at com.codename1.impl.javase.LocationSimulation$20.actionPerformed(LocationSimulation.java:446)
at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1258)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:586)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:622)
at com.codename1.impl.javase.LocationSimulation.setMeasUnit(LocationSimulation.java:729)
at com.codename1.impl.javase.StubLocationManager.<init>(StubLocationManager.java:78)
at com.codename1.impl.javase.StubLocationManager.<clinit>(StubLocationManager.java:58)
... 9 more
com.codename1.io.websocket.WebSocket$WebSocketException: Exception occurred while trying to connect.
at com.codename1.io.websocket.WebSocket.connect(WebSocket.java:416)
at com.codename1.io.websocket.WebSocket.access$400(WebSocket.java:39)
at com.codename1.io.websocket.WebSocket$4.run(WebSocket.java:393)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.RuntimeException: com.neovisionaries.ws.client.WebSocketException: Failed to connect to 'localhost:9494': Connection refused: connect
at com.codename1.io.websocket.WebSocketNativeImplImpl.connect(Unknown Source)
at com.codename1.io.websocket.WebSocket.connect(WebSocket.java:405)
... 3 more
Caused by: com.neovisionaries.ws.client.WebSocketException: Failed to connect to 'localhost:9494': Connection refused: connect
at com.neovisionaries.ws.client.SocketConnector.doConnect(Unknown Source)
at com.neovisionaries.ws.client.SocketConnector.connect(Unknown Source)
at com.neovisionaries.ws.client.WebSocket.connect(Unknown Source)
... 5 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
... 8 more
java.lang.NoClassDefFoundError: Could not initialize class com.codename1.impl.javase.StubLocationManager
at com.codename1.impl.javase.JavaSEPort.getLocationManager(JavaSEPort.java:8945)
at com.codename1.ui.Display.getLocationManager(Display.java:3573)
at com.labafrique.creporter.MyApplication.writeLocation(MyApplication.java:2544)
at com.labafrique.creporter.MyApplication.lambda$null$0(MyApplication.java:151)
at com.codename1.ui.Display.processSerialCalls(Display.java:1298)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1242)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1130)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.NoClassDefFoundError: Could not initialize class com.codename1.impl.javase.StubLocationManager
This started happening to one other user I'm aware of (but not to everyone surprisingly) as a result of the change to remove the maps in location manager. We had to remove them as Google became far too strict with maps key generation strategies.
We have a fix for this and will post it later on today or tomorrow morning.

upgrade to solr 6.1, exception ClassNotFoundException: solr.admin.AdminHandlers

I notice that after changing from solr 5.3 to 6.1, my code that creates an EmbeddedSolrServer (see below) will cause the following exception:
String solrHome = prop.getProperty(PROPERTY_FIELD_SOLR_HOME);
String solrCore = "anotherCore";
CoreContainer solrCores = new EmbeddedSolrServer(
Paths.get(solrHome), solrCore
).getCoreContainer();
EmbeddedSolrServer mycore=
new EmbeddedSolrServer(solrCores.getCore("mycore"));
The last line works ok with solr 5.3, but with 6.1, the following exception is generated. Any ideas please?
Exception in thread "main" org.apache.solr.common.SolrException: SolrCore 'mycore' is not available due to init failure: Error loading class 'solr.admin.AdminHandlers'
at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:1066)
at uk.ac.ntu.sac.sense.SenseProperty.getClassIndex(SenseProperty.java:91)
at uk.ac.ntu.sac.sense.kb.indexer.IndexMaster.<init>(IndexMaster.java:31)
at uk.ac.ntu.sac.sense.test.TestIndexer.main(TestIndexer.java:14)
Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.admin.AdminHandlers'
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:773)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:647)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:812)
at org.apache.solr.core.CoreContainer.lambda$load$0(CoreContainer.java:466)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$22(ExecutorUtil.java:229)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.admin.AdminHandlers'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:536)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:467)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:570)
at org.apache.solr.core.PluginBag.createPlugin(PluginBag.java:125)
at org.apache.solr.core.PluginBag.init(PluginBag.java:225)
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:130)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:732)
... 8 more
Caused by: java.lang.ClassNotFoundException: solr.admin.AdminHandlers
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:520)
... 14 more
I'm having the same issue, but I imagine its because they removed that class from 6.1 (or sometime after 5.3). Removing the element from solrconfig.xml in the problematic core worked for me and should hopefully do the trick for you as well.
<!-- find this line in your solrconfig.xml and comment/remove it -->
<requestHandler name="/admin/"
class="solr.admin.AdminHandlers"/>

Resources