josephnhtam / vsp-youtube-clone-microservices

A YouTube Clone microservices application built with .NET 7 and Angular 14.
Apache License 2.0
37 stars 6 forks source link

not able to upload video #16

Closed RahulKumar1119 closed 4 months ago

RahulKumar1119 commented 4 months ago

@josephnhtam @SorsOps Screenshot from 2024-04-13 17-11-16

docker logs -f backend_videomanager.api_1 --timestamps

2024-04-13T11:39:09.854331272Z [11:39:09 INF] Video (79b1ddf0-1127-459c-8f7b-2c5f2fe7ee8e) is created
2024-04-13T11:39:09.882016769Z [11:39:09 ERR] An internal server error occurred when responding to user
2024-04-13T11:39:09.882085899Z System.ArgumentOutOfRangeException: IDX10720: Unable to create KeyedHashAlgorithm for algorithm 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha256', the key size must be greater than: '256' bits, key has '128' bits. See https://aka.ms/IdentityModel/UnsafeRelaxHmacKeySizeValidation (Parameter 'keyBytes')
2024-04-13T11:39:09.882099356Z    at Microsoft.IdentityModel.Tokens.CryptoProviderFactory.ValidateKeySize(Byte[] keyBytes, String algorithm, Int32 expectedNumberOfBytes)
2024-04-13T11:39:09.882109398Z    at Microsoft.IdentityModel.Tokens.CryptoProviderFactory.CreateKeyedHashAlgorithm(Byte[] keyBytes, String algorithm)
2024-04-13T11:39:09.882118250Z    at Microsoft.IdentityModel.Tokens.SymmetricSignatureProvider.CreateKeyedHashAlgorithm()
2024-04-13T11:39:09.882149529Z    at Microsoft.IdentityModel.Tokens.DisposableObjectPool`1.CreateInstance()
2024-04-13T11:39:09.882158883Z    at Microsoft.IdentityModel.Tokens.DisposableObjectPool`1.Allocate()
2024-04-13T11:39:09.882167335Z    at Microsoft.IdentityModel.Tokens.SymmetricSignatureProvider.GetKeyedHashAlgorithm(Byte[] keyBytes, String algorithm)
2024-04-13T11:39:09.882175817Z    at Microsoft.IdentityModel.Tokens.SymmetricSignatureProvider.Sign(Byte[] input)
2024-04-13T11:39:09.882184514Z    at Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.CreateEncodedSignature(String input, SigningCredentials signingCredentials)
2024-04-13T11:39:09.882193396Z    at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.CreateJwtSecurityTokenPrivate(String issuer, String audience, ClaimsIdentity subject, Nullable`1 notBefore, Nullable`1 expires, Nullable`1 issuedAt, SigningCredentials signingCredentials, EncryptingCredentials encryptingCredentials, IDictionary`2 claimCollection, String tokenType, IDictionary`2 additionalHeaderClaims, IDictionary`2 additionalInnerHeaderClaims)
2024-04-13T11:39:09.882203492Z    at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.CreateToken(SecurityTokenDescriptor tokenDescriptor)
2024-04-13T11:39:09.882211778Z    at SharedKernel.Utilities.JwtHelper.GenerateJWT(Byte[] secretKey, String algorithm, Action`1 configureDescriptor) in /src/BuildingBlocks/SharedKernel/Utilities/JwtHelper.cs:line 26
2024-04-13T11:39:09.882222875Z    at SharedKernel.Utilities.JwtHelper.GenerateJWT(String secretKey, String algorithm, Action`1 configureDescriptor) in /src/BuildingBlocks/SharedKernel/Utilities/JwtHelper.cs:line 10
2024-04-13T11:39:09.882231603Z    at VideoManager.API.Application.Queries.Handlers.GetVideoUploadTokenQueryHandler.Handle(GetVideoUploadTokenQuery request, CancellationToken cancellationToken) in /src/Services/VideoManager/VideoManager.API/Application/Queries/Handlers/GetVideoUploadTokenQueryHandler.cs:line 38
2024-04-13T11:39:09.882240593Z    at Application.PipelineBehaviours.ValidatingPipelineBehaviour`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken) in /src/BuildingBlocks/Application/PipelineBehaviours/ValidatingPipelineBehaviour.cs:line 46
2024-04-13T11:39:09.882249366Z    at Application.PipelineBehaviours.ActivityPipelineBehaviour`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken) in /src/BuildingBlocks/Application/PipelineBehaviours/ActivityPipelineBehaviour.cs:line 22
2024-04-13T11:39:09.882258822Z    at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken)
2024-04-13T11:39:09.882267299Z    at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken)
2024-04-13T11:39:09.882275066Z    at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken)
2024-04-13T11:39:09.882283510Z    at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken)
2024-04-13T11:39:09.882293301Z    at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken)
2024-04-13T11:39:09.882310648Z    at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken)
2024-04-13T11:39:09.882319953Z    at VideoManager.API.Controllers.VideoManagerController.GetVideoUploadToken(Guid videoId, CancellationToken cancellationToken) in /src/Services/VideoManager/VideoManager.API/Controllers/VideoManagerController.cs:line 43
2024-04-13T11:39:09.882328541Z    at lambda_method594(Closure, Object)
2024-04-13T11:39:09.882338145Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
2024-04-13T11:39:09.882347497Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
2024-04-13T11:39:09.882357346Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
josephnhtam commented 4 months ago

@RahulKumar1119 Because of the security update, a longer secret key is required. I have pushed a commit to use a longer default secret key. Please check if this can fix your issue.

RahulKumar1119 commented 4 months ago

@josephnhtam Issue solved now.