Self-Hosting aspose/pdf-cloud License Error (Authentication failed)

When I try to run the following command:

docker run \
  --publish 5000:5000 \
  --volume /data/convert:/data \
  --env ASPNETCORE_ENVIRONMENT='Development' \
  --env ASPOSE_PDF_CLOUD_SELFHOST_PUBLIC_KEY="{OEM_LICENSE_PUBLIC_KEY}" \
  --env ASPOSE_PDF_CLOUD_SELFHOST_PRIVATE_KEY="{OEM_LICENSE_PRIVATE_KEY}" \
  aspose/pdf-cloud:25.9

I encounter the following error:

Unhandled exception. System.InvalidOperationException: Authentication failed.
   at Dynabic.Metered.Metered.SetMeteredKey(String publicKey, String privateKey) in C:\GitlabRunner\builds\t1_rq-3sB\0\cloud1\aspose.pdf.cloud\src\Aspose.PDF.Cloud.SelfHost.Extensions\Metered\Metered\Metered.cs:line 127
   at Aspose.Pdf.Cloud.Config.PdfCloudConfigExtention.EnableMeteredPdfCloud() in C:\GitlabRunner\builds\t1_rq-3sB\0\cloud1\aspose.pdf.cloud\src\Aspose.PDF.Cloud.SelfHost.Extensions\PdfCloudExtensions.cs:line 26
   at Aspose.Pdf.Cloud.Config.PdfCloudConfigExtention.AddBilling(IServiceCollection services) in C:\GitlabRunner\builds\t1_rq-3sB\0\cloud1\aspose.pdf.cloud\src\Aspose.PDF.Cloud.SelfHost.Extensions\PdfCloudExtensions.cs:line 30
   at Aspose.Pdf.Cloud.Web.Configure.BuilderServices(WebApplicationBuilder builder) in C:\GitlabRunner\builds\t1_rq-3sB\0\cloud1\aspose.pdf.cloud\src\Aspose.PDF.Cloud.Web\Configure.cs:line 111
   at Aspose.Pdf.Cloud.Web.Program.Main(String[] args) in C:\GitlabRunner\builds\t1_rq-3sB\0\cloud1\aspose.pdf.cloud\src\Aspose.PDF.Cloud.Web\Program.cs:line 18
Aborted (core dumped)

I have tried several different versions (including but not limited to 25.9 to 25.6, and also 24.9.0, 24.12.0, etc.), and I have also tried to reapply for a Metered OEM, but the error still persists.

@aizpy

The “Authentication failed” error you are encountering when trying to run the Aspose PDF Cloud self-hosted service typically indicates an issue with the public and private keys you are using. Here are some steps you can take to troubleshoot this issue:

  1. Verify Keys: Ensure that the {OEM_LICENSE_PUBLIC_KEY} and {OEM_LICENSE_PRIVATE_KEY} you are using are correct. Double-check for any extra spaces or incorrect characters.

  2. Reapply for Keys: If you suspect that the keys might be invalid, consider reapplying for a Metered OEM license through the Aspose website to obtain new keys.

  3. Environment Variables: Make sure that the environment variables are being set correctly in your Docker command. You can check the logs to see if the keys are being read properly.

  4. Docker Image Version: Ensure that the version of the Docker image you are using is compatible with the keys you have. If you have tried different versions, confirm that the current version is supported.

  5. Network Issues: Sometimes, network issues can prevent the service from authenticating properly. Ensure that your Docker container has internet access.

If the problem persists after these checks, consider reaching out to Aspose support for further assistance.

Feel free to ask if you have any more questions!

I got it. It was the proxy I used in Docker that caused the connection issue.