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

[BUG] Publisher errors out when deleting an API #150

Closed
aristosvo opened this issue Nov 16, 2022 · 0 comments · Fixed by #151
Closed

[BUG] Publisher errors out when deleting an API #150

aristosvo opened this issue Nov 16, 2022 · 0 comments · Fixed by #151
Assignees
Labels
bug Something isn't working

Comments

@aristosvo
Copy link
Contributor

Release version

2.0.2

Describe the bug

When creating an API + version set in a first run (with overrides) and deleting the API afterwards (still overrides present in overrides file, COMMIT_ID set), the deletion errors out:

2022-11-16T09:14:58.1372573Z info: Publisher[0]
2022-11-16T09:14:58.1373340Z       Beginning execution...
2022-11-16T09:14:58.1472594Z info: Publisher[0]
2022-11-16T09:14:58.1473431Z       Getting files from commit ID 4d80f4161076fc8261355c2178e5026a140abba6...
2022-11-16T09:14:58.1878195Z info: Microsoft.Hosting.Lifetime[0]
2022-11-16T09:14:58.1879089Z       Application started. Press Ctrl+C to shut down.
2022-11-16T09:14:58.1883433Z info: Microsoft.Hosting.Lifetime[0]
2022-11-16T09:14:58.1884045Z       Hosting environment: Production
2022-11-16T09:14:58.1887265Z info: Microsoft.Hosting.Lifetime[0]
2022-11-16T09:14:58.1887861Z       Content root path: /home/vsts/work/1/s
2022-11-16T09:14:58.2464781Z info: Publisher[0]
2022-11-16T09:14:58.2465553Z       Processing files deleted in commit ID...
2022-11-16T09:14:58.2966042Z info: Publisher[0]
2022-11-16T09:14:58.2967552Z       Deleting policy policy in API petstore-v7...
2022-11-16T09:15:01.3385909Z crit: Publisher[0]
2022-11-16T09:15:01.3387690Z       System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/vsts/work/1/s/Team-XXXX/apis/petstore-v7'.
2022-11-16T09:15:01.3390232Z          at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
2022-11-16T09:15:01.3391240Z          at System.IO.Enumeration.FileSystemEnumerator`1.Init()
2022-11-16T09:15:01.3391998Z          at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
2022-11-16T09:15:01.3392929Z          at System.IO.Enumeration.FileSystemEnumerableFactory.FileInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
2022-11-16T09:15:01.3393839Z          at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
2022-11-16T09:15:01.3394589Z          at System.IO.DirectoryInfo.EnumerateFiles()
2022-11-16T09:15:01.3395686Z          at publisher.Api.TryGetExistingSpecificationFile(ApiDirectory apiDirectory, ServiceDirectory serviceDirectory) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 256
2022-11-16T09:15:01.3397153Z          at publisher.Api.ProcessDeletedApi(ApiName apiName, ApiInformationFile deletedApiInformationFile, ApiSpecificationFile deletedSpecificationFile, JsonObject configurationApiJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 216
2022-11-16T09:15:01.3398546Z          at publisher.Api.<>c__DisplayClass0_0.<<ProcessDeletedArtifacts>b__4>d.MoveNext() in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 29
2022-11-16T09:15:01.3399621Z       --- End of stack trace from previous location ---
2022-11-16T09:15:01.3400269Z          at System.Threading.Tasks.Parallel.<>c__50`1.<<ForEachAsync>b__50_0>d.MoveNext()
2022-11-16T09:15:01.3401072Z       --- End of stack trace from previous location ---
2022-11-16T09:15:01.3401926Z          at common.IEnumerableExtensions.ForEachParallel[T](IEnumerable`1 enumerable, Func`2 action, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/common/Functional.cs:line 45
2022-11-16T09:15:01.3403274Z          at publisher.Api.ProcessDeletedArtifacts(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 23
2022-11-16T09:15:01.3404956Z          at publisher.Service.ProcessDeletedArtifacts(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, ListRestResources listRestResources, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Service.cs:line 21
2022-11-16T09:15:01.3406543Z          at publisher.Publisher.ProcessDeletedCommitIdFiles(IReadOnlyCollection`1 deletedCommitIdFiles, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 131
2022-11-16T09:15:01.3407609Z          at publisher.Publisher.RunWithCommitId(CommitId commitId, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 105
2022-11-16T09:15:01.3408539Z          at publisher.Publisher.Run(CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 69
2022-11-16T09:15:01.3409443Z          at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 47
2022-11-16T09:15:01.3411313Z info: Microsoft.Hosting.Lifetime[0]
2022-11-16T09:15:01.3414894Z       Application is shutting down...
2022-11-16T09:15:01.3415546Z fail: Microsoft.Extensions.Hosting.Internal.Host[9]
2022-11-16T09:15:01.3416021Z       BackgroundService failed
2022-11-16T09:15:01.3417004Z       System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/vsts/work/1/s/Team-XXXX/apis/petstore-v7'.
2022-11-16T09:15:01.3417769Z          at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
2022-11-16T09:15:01.3418399Z          at System.IO.Enumeration.FileSystemEnumerator`1.Init()
2022-11-16T09:15:01.3419078Z          at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
2022-11-16T09:15:01.3419930Z          at System.IO.Enumeration.FileSystemEnumerableFactory.FileInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
2022-11-16T09:15:01.3420784Z          at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
2022-11-16T09:15:01.3421609Z          at System.IO.DirectoryInfo.EnumerateFiles()
2022-11-16T09:15:01.3422333Z          at publisher.Api.TryGetExistingSpecificationFile(ApiDirectory apiDirectory, ServiceDirectory serviceDirectory) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 256
2022-11-16T09:15:01.3423743Z          at publisher.Api.ProcessDeletedApi(ApiName apiName, ApiInformationFile deletedApiInformationFile, ApiSpecificationFile deletedSpecificationFile, JsonObject configurationApiJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 216
2022-11-16T09:15:01.3425073Z          at publisher.Api.<>c__DisplayClass0_0.<<ProcessDeletedArtifacts>b__4>d.MoveNext() in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 29
2022-11-16T09:15:01.3427750Z       --- End of stack trace from previous location ---
2022-11-16T09:15:01.3428372Z          at System.Threading.Tasks.Parallel.<>c__50`1.<<ForEachAsync>b__50_0>d.MoveNext()
2022-11-16T09:15:01.3429094Z       --- End of stack trace from previous location ---
2022-11-16T09:15:01.3429878Z          at common.IEnumerableExtensions.ForEachParallel[T](IEnumerable`1 enumerable, Func`2 action, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/common/Functional.cs:line 45
2022-11-16T09:15:01.3431295Z          at publisher.Api.ProcessDeletedArtifacts(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 23
2022-11-16T09:15:01.3433097Z          at publisher.Service.ProcessDeletedArtifacts(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, ListRestResources listRestResources, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Service.cs:line 21
2022-11-16T09:15:01.3434484Z          at publisher.Publisher.ProcessDeletedCommitIdFiles(IReadOnlyCollection`1 deletedCommitIdFiles, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 131
2022-11-16T09:15:01.3435472Z          at publisher.Publisher.RunWithCommitId(CommitId commitId, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 105
2022-11-16T09:15:01.3436333Z          at publisher.Publisher.Run(CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 69
2022-11-16T09:15:01.3437161Z          at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 47
2022-11-16T09:15:01.3437959Z          at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
2022-11-16T09:15:01.3438638Z crit: Microsoft.Extensions.Hosting.Internal.Host[10]
2022-11-16T09:15:01.3439522Z       The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.
2022-11-16T09:15:01.3440783Z       System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/vsts/work/1/s/Team-XXXX/apis/petstore-v7'.
2022-11-16T09:15:01.3442010Z          at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
2022-11-16T09:15:01.3442792Z          at System.IO.Enumeration.FileSystemEnumerator`1.Init()
2022-11-16T09:15:01.3444095Z          at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
2022-11-16T09:15:01.3444839Z          at System.IO.Enumeration.FileSystemEnumerableFactory.FileInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
2022-11-16T09:15:01.3445564Z          at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
2022-11-16T09:15:01.3446093Z          at System.IO.DirectoryInfo.EnumerateFiles()
2022-11-16T09:15:01.3446693Z          at publisher.Api.TryGetExistingSpecificationFile(ApiDirectory apiDirectory, ServiceDirectory serviceDirectory) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 256
2022-11-16T09:15:01.3447956Z          at publisher.Api.ProcessDeletedApi(ApiName apiName, ApiInformationFile deletedApiInformationFile, ApiSpecificationFile deletedSpecificationFile, JsonObject configurationApiJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 216
2022-11-16T09:15:01.3449162Z          at publisher.Api.<>c__DisplayClass0_0.<<ProcessDeletedArtifacts>b__4>d.MoveNext() in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 29
2022-11-16T09:15:01.3449923Z       --- End of stack trace from previous location ---
2022-11-16T09:15:01.3450371Z          at System.Threading.Tasks.Parallel.<>c__50`1.<<ForEachAsync>b__50_0>d.MoveNext()
2022-11-16T09:15:01.3450944Z       --- End of stack trace from previous location ---
2022-11-16T09:15:01.3451590Z          at common.IEnumerableExtensions.ForEachParallel[T](IEnumerable`1 enumerable, Func`2 action, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/common/Functional.cs:line 45
2022-11-16T09:15:01.3452862Z          at publisher.Api.ProcessDeletedArtifacts(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Api.cs:line 23
2022-11-16T09:15:01.3454348Z          at publisher.Service.ProcessDeletedArtifacts(IReadOnlyCollection`1 files, JsonObject configurationJson, ServiceDirectory serviceDirectory, ServiceUri serviceUri, ListRestResources listRestResources, PutRestResource putRestResource, DeleteRestResource deleteRestResource, ILogger logger, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Service.cs:line 21
2022-11-16T09:15:01.3455605Z          at publisher.Publisher.ProcessDeletedCommitIdFiles(IReadOnlyCollection`1 deletedCommitIdFiles, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 131
2022-11-16T09:15:01.3456478Z          at publisher.Publisher.RunWithCommitId(CommitId commitId, CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 105
2022-11-16T09:15:01.3457225Z          at publisher.Publisher.Run(CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 69
2022-11-16T09:15:01.3458194Z          at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken) in /home/vsts/work/1/s/apiops/tools/code/publisher/Publisher.cs:line 47
2022-11-16T09:15:01.3458876Z          at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
2022-11-16T09:15:01.3812637Z Exit code is 255

Expected behavior

Deleting an API, even if Version Set override ID is present in override file

Actual behavior

Errorring out when deleting an API if Version Set override ID is present in override file

Reproduction Steps

Create a Pet Store API, give it a version set, override the version set id in an override file and deploy. Delete the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants