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

cant use existing index with uppercase letters alias using NEST 5.0 #2516

Closed
ran729 opened this issue Dec 26, 2016 · 4 comments
Closed

cant use existing index with uppercase letters alias using NEST 5.0 #2516

ran729 opened this issue Dec 26, 2016 · 4 comments

Comments

@ran729
Copy link

ran729 commented Dec 26, 2016

i just migrated from NEST 1 to NEST 5 (along with elasticsearch 1.7 to 5.1.1) and stambled upon an annoying bug

NEST/Elasticsearch.Net version: 5.0.0

Elasticsearch version:5.1.1

Description of the problem including expected versus actual behavior:
cant use existing index with uppercase letters alias using NEST 5.0

Steps to reproduce:
1.create an index
2.add alias with uppercase letters
3. get the index using NEST with the alias name - ERROR (validating alias name as if it was index name)
error is - Index names cannot contain uppercase characters

DebugInformation:
"System.ArgumentException: Index names cannot contain uppercase characters: UpperCaseAliasName .\r\n at Nest.IndexNameResolver.ValidateIndexName(String indexName) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\Infer\IndexName\IndexNameResolver.cs:line 49\r\n at Nest.IndexNameResolver.Resolve(IndexName i) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\Infer\IndexName\IndexNameResolver.cs:line 20\r\n at Nest.IndexName.GetString(IConnectionConfigurationValues settings) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\Infer\IndexName\IndexName.cs:line 76\r\n at Nest.RouteValues.Resolve(IConnectionSettingsValues settings) in C:\Users\russ\source\elasticsearch-net-5.x\src\Nest\CommonAbstractions\Request\RouteValues.cs:line 60\r\n at Nest.ElasticClient.d__2534.MoveNext() in C:\\Users\\russ\\source\\elasticsearch-net-5.x\\src\\Nest\\ElasticClient.cs:line 75\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at Hoard.ElasticSearch.Wrapper.Implementations.RepositoryImplementation.d__11.MoveNext() in D:\Projects\Hoard\src\HOARD.ElasticSearchWrapper\Implementations\RepositoryImplementation.cs:line 120\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at Hoard.ElasticSearch.Wrapper.Implementations.RepositoryImplementation.d__9.MoveNext() in D:\Projects\Hoard\src\HOARD.ElasticSearchWrapper\Implementations\RepositoryImplementation.cs:line 90\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at Hoard.Web.Controllers.HoardController.d__3.MoveNext() in D:\Projects\Hoard\src\HOARD.Web\Controllers\HoardController.cs:line 42\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.HttpServer.d__0.MoveNext()"
}

@Mpdreamz
Copy link
Member

Can confirm as per:

nik9000/elasticsearch@d23b8a6

Indexnames and alias names are validated the same way except for uppercase names.

Will try to create a workaround for an 5.0.1 release.

Are you using UPPERCASE as a way to differentiate between index names and their aliases?

@ran729
Copy link
Author

ran729 commented Dec 28, 2016

I am using the alias as an easy and accessible name to hide the long and unique index name which is much more complicated.
Our old indexes uses uppercase letters in their alias names, which is why we want to make the upgrade easier not having to change all of the alias names to lower case,
Especially because ElasticSearch does not require it, only the NEST 5 name validation.

we will be very happy to find a fix in release 5.0.1, thanks!

@gmarz gmarz added Bug labels Jan 9, 2017
@gmarz
Copy link
Contributor

gmarz commented Jan 9, 2017

Closed via #2520

@gmarz gmarz closed this as completed Jan 9, 2017
@ran729
Copy link
Author

ran729 commented Jan 11, 2017

so its going to be fixed in release 5.0.1? when is it by the way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants