Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's a couple of errors of NullReferenceException, Lock obtain timed out in custom setup recipe in oc version 1.8.3 #16458

Closed
effapp opened this issue Jul 19, 2024 · 7 comments

Comments

@effapp
Copy link

effapp commented Jul 19, 2024

Describe the bug

There's a couple of errors of NullReferenceException, Lock obtain timed out in custom setup recipe in oc version 1.8.3
error 1:

2024-07-18 23:12:13.1521|Default|https://localhost/|00-123cf40ac0adf48632862f0926e96e09-67367046f6298c6a-00||OrchardCore.ContentManagement.DefaultContentManager|ERROR|IContentHandler thrown from OrchardCore.Alias.Indexes.AliasPartIndexProvider by NullReferenceException System.NullReferenceException: Object reference not set to an instance of an object.
   at OrchardCore.Alias.Indexes.AliasPartIndexProvider.UpdatedAsync(UpdateContentContext context)
   at OrchardCore.Modules.InvokeExtensions.InvokeAsync[TEvents,T1](IEnumerable`1 events, Func`3 dispatch, T1 arg1, ILogger logger)    at OrchardCore.Alias.Indexes.AliasPartIndexProvider.UpdatedAsync(UpdateContentContext context)
   at OrchardCore.Modules.InvokeExtensions.InvokeAsync[TEvents,T1](IEnumerable`1 events, Func`3 dispatch, T1 arg1, ILogger logger)

error 2:

2024-07-18 23:12:22.0340|Default|https://localhost/|00-123cf40ac0adf48632862f0926e96e09-67367046f6298c6a-00||OrchardCore.Environment.Shell.Scope.ShellScope|ERROR|Error while executing the background job 'lucene-index-rebuild' after the end of the request on tenant 'Default'. Lucene.Net.Store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@L:\App_Data\Sites\Default\Lucene\ArticleItemIndex\write.lock
   at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout)
   at Lucene.Net.Index.IndexWriter..ctor(Directory d, IndexWriterConfig conf)
   at OrchardCore.Search.Lucene.IndexWriterWrapper..ctor(Directory directory, IndexWriterConfig config)
   at OrchardCore.Search.Lucene.LuceneIndexManager.WriteAsync(String indexName, Action`1 action, Boolean close)
   at OrchardCore.Search.Lucene.LuceneIndexManager.CreateIndexAsync(String indexName)
   at OrchardCore.Search.Lucene.LuceneIndexingService.RebuildIndexAsync(String indexName)
   at OrchardCore.Search.Lucene.Recipes.LuceneIndexRebuildStep.<>c__DisplayClass0_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at OrchardCore.BackgroundJobs.HttpBackgroundJob.<>c__DisplayClass0_0.<<ExecuteAfterEndOfRequestAsync>b__1>d.MoveNext()    at Lucene.Net.Store.Lock.Obtain(Int64 lockWaitTimeout)
   at Lucene.Net.Index.IndexWriter..ctor(Directory d, IndexWriterConfig conf)
   at OrchardCore.Search.Lucene.IndexWriterWrapper..ctor(Directory directory, IndexWriterConfig config)
   at OrchardCore.Search.Lucene.LuceneIndexManager.WriteAsync(String indexName, Action`1 action, Boolean close)
   at OrchardCore.Search.Lucene.LuceneIndexManager.CreateIndexAsync(String indexName)
   at OrchardCore.Search.Lucene.LuceneIndexingService.RebuildIndexAsync(String indexName)
   at OrchardCore.Search.Lucene.Recipes.LuceneIndexRebuildStep.<>c__DisplayClass0_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at OrchardCore.BackgroundJobs.HttpBackgroundJob.<>c__DisplayClass0_0.<<ExecuteAfterEndOfRequestAsync>b__1>d.MoveNext()

It's successfully when Lucene index rebuild in OrchardCore admin UI.

Orchard Core version

version 1.8.3

@Piedone
Copy link
Member

Piedone commented Jul 19, 2024

Please fill out the issue template, and provide reproduction steps, because we can't hope to help you otherwise.

@effapp
Copy link
Author

effapp commented Jul 20, 2024

To Reproduce

Steps to reproduce the behavior:

  1. Create a new OrchardCore web site
  2. Referrence custom theme with custom recipe
  3. Debug web site
  4. Fill out auto setup form and select custom recipe, then submit form
  5. See error in log file

@Piedone
Copy link
Member

Piedone commented Jul 22, 2024

I can't reproduce, please be more specific: what do you do in those custom extensions and the custom recipe?

@effapp
Copy link
Author

effapp commented Jul 23, 2024

Because the error appeared in the log, I did not see the program throw an exception and could not locate the location where the error occurred.

The web site is running normally.

the custom recipe that based on OrchardCore agency recipe only enable custom features.

@Piedone
Copy link
Member

Piedone commented Jul 23, 2024

Sorry, but we won't be able to help you without you sharing some more details. Setting up the app with the Agency recipe with a vanilla 1.8.3 doesn't cause this issue (it doesn't enable Lucene anyway). So, there's something in your custom recipe, or your custom extensions, that causes this issue to surface. Without knowing what that is, we won't be able to reproduce and thus verify the issue, and then fix it.

You'll need to share precise reproduction steps that don't rely on any prior knowledge or custom code, or your source code.

Copy link
Contributor

github-actions bot commented Aug 7, 2024

It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply.

@github-actions github-actions bot added stale and removed stale labels Aug 7, 2024
Copy link
Contributor

It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply.

@github-actions github-actions bot added the stale label Aug 24, 2024
@effapp effapp closed this as completed Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants