UmbracoAzureSearch icon indicating copy to clipboard operation
UmbracoAzureSearch copied to clipboard

We are unable to drop and reindex in version 1.3.0

Open NicolaiJee opened this issue 6 years ago • 5 comments

We get the error: POST https://dev.forsikringogpension.dk/umbraco/backoffice/api/AzureSearchApi/ReIndex 500 (Internal Server Error) (anonymous) @ angular.min.js?cdv=1723721477:106 o @ angular.min.js?cdv=1723721477:102 g @ angular.min.js?cdv=1723721477:100 i @ angular.min.js?cdv=1723721477:79 (anonymous) @ angular.min.js?cdv=1723721477:80 $eval @ angular.min.js?cdv=1723721477:92 $digest @ angular.min.js?cdv=1723721477:90 $apply @ angular.min.js?cdv=1723721477:92 (anonymous) @ angular-mobile.js?cdv=1723721477:269 dispatch @ jquery.min.js?cdv=1723721477:3 r.handle @ jquery.min.js?cdv=1723721477:3

Indhold af svar 500:

  1. Message: "An error has occurred.",…}

  2. ExceptionMessage:"Could not find file 'C:\Git17\UmbracoCloud\forsikringogpension.web.cms.umbraco.web\App_Data\MoriyamaAzureSearch\00000006-0000-0000-0000-000000000000\content.json'."

  3. ExceptionType:"System.IO.FileNotFoundException"

  4. Message:"An error has occurred."

  5. StackTrace:" at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

  6. ↵ at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

  7. ↵ at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

  8. ↵ at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)

  9. ↵ at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)

  10. ↵ at Moriyama.AzureSearch.Umbraco.Application.AzureSearchIndexClient.GetIds(String sessionId, String filename)

  11. ↵ at Moriyama.AzureSearch.Umbraco.Application.AzureSearchIndexClient.ReIndex(String filename, String sessionId, Int32 page)

  12. ↵ at Moriyama.AzureSearch.Umbraco.Application.AzureSearchIndexClient.ReIndexContent(String sessionId, Int32 page)

  13. ↵ at Moriyama.AzureSearch.Umbraco.Application.Controllers.AzureSearchApiController.GetReIndexContent(String sessionId, Int32 page)

  14. ↵ at Moriyama.AzureSearch.Umbraco.Application.Controllers.AzureSearchApiController.ReIndex(ReIndexModel reIndexModel)

Any ideas ? 1.2.6 worked for us.

NicolaiJee avatar Sep 24 '18 12:09 NicolaiJee

Have you update via nuget? Have you update both the core and the UI project?

darrenferguson avatar Sep 25 '18 07:09 darrenferguson

Yes both versions are 1.3.0 and upgraded via nuget. Could the problem be that we are using authentication via azure ad ?

On Tue, Sep 25, 2018 at 9:23 AM darrenferguson [email protected] wrote:

Have you update via nuget? Have you update both the core and the UI project?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/darrenferguson/UmbracoAzureSearch/issues/36#issuecomment-424234971, or mute the thread https://github.com/notifications/unsubscribe-auth/ACLg_1ahqCzfwmE24EBlnhD9AnmqOiuWks5uedoHgaJpZM4W2jcD .

--

Med venlig hilsen / Kind regards

JEE CONSULT – Leverer til tiden og som forventet

Nicolai Hamilton Jee

Owner/Developer

Mobil (+45) 60 888 222

[email protected]

www.jeeconsult.dk

NicolaiJee avatar Sep 25 '18 08:09 NicolaiJee

It seems that it gets a session id and tries to find that folder but the folder does not exist. It tries to get a session id using var sessionKey = Security.CurrentUser.Key.ToString(); It does that in the GetStatus method in the AzureSearchApiController. This sessionid is passed on through the system to the GetIds in the AzureSearchIndexClient This is the line that fails: var ids = JsonConvert.DeserializeObject<int[]>(System.IO.File.ReadAllText(file)); private int[] GetIds(string sessionId, string filename) { var path = Path.Combine(_path, @"App_Data\MoriyamaAzureSearch" + sessionId); var file = Path.Combine(path, filename);

        var ids = JsonConvert.DeserializeObject<int[]>(System.IO.File.ReadAllText(file));
        return ids;
    }

It worked in version 1.2.6, but not any more. I can create the missing folder but it is empty so nothing gets indexed.

Should this folder exist or ? I hope you can help us.

NicolaiJee avatar Sep 27 '18 14:09 NicolaiJee

We've released a new version on nuget that deals with the issue that you are facing.

Please let us know if it resolves the problem!

darrenferguson avatar Sep 29 '18 09:09 darrenferguson

It works 👍

NicolaiJee avatar Sep 29 '18 12:09 NicolaiJee