Azure File Storage connection Settings not persisting when passed through as docker e- arguments



  • Hi

    I hope you are well.

    I am having an issue with passing through the Azure File Storage connection settings as docker environment variables in version 4.7.0.

    I get the error message below:

    error: Error occurred during reporter init: RestError: request to https://undefined.blob.core.windows.net/jsreport?restype=container failed, reason: getaddrinfo ENOTFOUND undefined.blob.core.windows.net
    2024-10-30T10:00:49.915653790Z at NodeFetchHttpClient.sendRequest (/app/node_modules/@azure/core-http/dist/index.js:2676:23)
    2024-10-30T10:00:49.915656150Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    2024-10-30T10:00:49.915657690Z at async StorageBearerTokenChallengeAuthenticationPolicy.sendRequest (/app/node_modules/@azure/storage-blob/dist/index.js:14897:30)
    2024-10-30T10:00:49.915659310Z at async StorageRetryPolicy.attemptSendRequest (/app/node_modules/@azure/storage-blob/dist/index.js:14399:24)
    2024-10-30T10:00:49.915660680Z at async StorageClientContext.sendOperationRequest (/app/node_modules/@azure/core-http/dist/index.js:4858:31)
    2024-10-30T10:00:49.915662000Z at async ContainerClient.create (/app/node_modules/@azure/storage-blob/dist/index.js:22677:20)
    2024-10-30T10:00:49.915663350Z at async ContainerClient.createIfNotExists (/app/node_modules/@azure/storage-blob/dist/index.js:22702:25)
    2024-10-30T10:00:49.915664670Z at async MainReporter.init (/app/node_modules/@jsreport/jsreport-core/lib/main/reporter.js:229:7)
    2024-10-30T10:00:49.915665960Z at async executeCommand (/app/node_modules/@jsreport/jsreport-cli/lib/commander/executeCommand.js:22:20)
    2024-10-30T10:00:49.915671940Z at async Object.handler (/app/node_modules/@jsreport/jsreport-cli/lib/commander/registerCommand.js:76:9)
    2024-10-30T10:00:49.916491970Z An error ocurred while trying to execute "start" command (3)

    the url it is trying to send a request to is obviously not correct.

    When I go into the config.json in the docker container and add the settings manually it works.

    Below are the environment variables I am passing through when I run the container.

    blobStorage_provider=azure-storage
    extensions_azure-storage_accountName=
    extensions_azure-storage_accountKey=
    extensions_azure-storage_container=

    Any help would be greatly appreciated.



  • Try to change to the following. Some systems have problems with dash - in env key, but jsreport accepts also camel case.

    extensions_azureStorage_accountName=
    

    https://jsreport.net/learn/configuration#environment-variables



  • I changed to the above, unfortunately I am still getting the same error.

    I did also run docker inspect <container_id> | Select-String -Pattern '"Env"' -Context 0,20 to double check that the environment variables are being passed into the container correctly and they are all there.



  • Do you use a custom image or jsreport official one?

    I've tried the following and it works fine

    docker run -p 5488:5488 -e blobStorage_provider=azure-storage -e extensions_azureStorage_accountName=jsrtest -e extensions_azureStorage_accountKey=xxx== -e extensions_azureStorage_container=jsreport jsreport/jsreport:4.7.0-full
    

Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.