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

Something went wrong when trying to save credentials. Contact support. #807

Closed
Gribbs opened this issue May 2, 2024 · 2 comments
Closed

Comments

@Gribbs
Copy link

Gribbs commented May 2, 2024

Select the SuiteCloud tool where you encountered the issue

SuiteCloud CLI

Version of the SuiteCloud Tool

SuiteCloud CLI for Node.js 1.9.0

Operating system

Locally - macOS 14.4.1 (23E224), Docker: Amazon Linux 2023

Node Version / VSCode Version

v18.14.2

JAVA Version

openjdk version "17.0.11" 2024-04-16 LTS

Bug description

Trying to run suitecloud account:savetoken on a Bitbucket pipeline step which is running a docker image based on amazonlinux:2023 but getting the error:

"Something went wrong when trying to save credentials. Contact support."

I am running this command:

suitecloud account:savetoken --account ${NS_ACCOUNT_ID_SANDBOX} --authid BitbucketPipelines-sandbox --tokenid ${NS_TOKEN_ID_SANDBOX} --tokensecret ${NS_TOKEN_SECRET_SANDBOX}

The command works fine locally on mac using the exact same credentials and suitecloud-cli version.

Essentially I'm trying to perform CICD deployment on a bitbucket pipeline, following the methods recommended in these blog posts:

Steps To Reproduce

  1. Create a ClientScript project with the nodejs netsuite-cli.
  2. Create a bitbucket-pipelines.yml file with the following contents:
#  Template NodeJS build

image: <yourpublicimage>/netsuite-docker:latest

pipelines:
  branches:
    main:
    - step:
            name: Build and Test
            caches:
              - node
            script:
              - npm install
              - npm test
    - step:
            name: Code linting
            caches:
              - node
            script:
              - npm install eslint
              - npx eslint .
    - step:
            name: Deploy to Netsuite Sandbox account
            caches:
              - node
            deployment: staging
            script: # These are the commands to deploy your to netsuite
              - suitecloud account:savetoken --account $NS_ACCOUNT_ID_SANDBOX --authid BitbucketPipelines-sandbox --tokenid $NS_TOKEN_ID_SANDBOX --tokensecret $NS_TOKEN_SECRET_SANDBOX
              - suitecloud project:deploy
  1. Create a Dockerfile with the following contents:
USER root
# Install wget, tar, and gzip
RUN dnf update -y && \
    dnf install -y wget tar gzip xz dbus which findutils && \
    dnf clean all

# Download and extract Amazon Corretto 17
RUN yum install -y java-17-amazon-corretto-headless && \
yum install -y java-17-amazon-corretto-devel && \
yum install -y java-17-amazon-corretto-jmods && \
export JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto && \
export PATH=$JAVA_HOME/bin:$PATH

# Install Node.js and netsuite CLI
RUN curl -fsSL https://nodejs.org/dist/v18.14.2/node-v18.14.2-linux-x64.tar.xz | tar -xJv -C /usr/local --strip-components=1 && \
npm install -g --acceptSuiteCloudSDKLicense @oracle/suitecloud-cli

WORKDIR /app
  1. Build the docker image:
    docker buildx build --platform linux/amd64 -t <yourpublicimage>/netsuite-docker --load .
  2. Deploy the docker image to Docker Hub:
    docker buildx build --platform linux/amd64 -t <yourpublicimage>/netsuite-docker --push .
  3. Push to your bitbucket repository to trigger the pipeline steps.
    git push

Actual Output

Something went wrong when trying to save credentials. Contact support.

Expected Output

The TBA token has been saved for the following company and role: . This project will use the authentication ID "BitbucketPipelines-sandbox" as default.
The account has been successfully set up.

Anything else?

  • Based on the recommendations in this issue I've tried to add steps to install dbus and run dbus-uuidgen --ensure on both the pipeline step scripts section - it didn't work - still getting the error Something went wrong ....
  • Based on the recommendations in issue I've tried to add steps to install dbus and run dbus-uuidgen --ensure on the image itself - it didn't work - still getting the error Something went wrong ....

This only occurs on the Docker image. It works fine locally on my Mac.

Thank you.

@karl-anthony-ng
Copy link
Member

Try adding...
RUN yum install dbus-daemon -y

@Gribbs
Copy link
Author

Gribbs commented May 8, 2024

Try adding... RUN yum install dbus-daemon -y

Thanks @karl-anthony-ng that has worked!

This is my (now working) Docker file:

FROM public.ecr.aws/amazonlinux/amazonlinux:2023

USER root
# Install wget, tar, and gzip
RUN dnf update -y && \
    dnf install -y wget tar gzip xz dbus-daemon which findutils && \
    dnf clean all
# Download and extract Amazon Corretto 17
RUN yum install -y java-17-amazon-corretto-headless && \
yum install -y java-17-amazon-corretto-devel && \
yum install -y java-17-amazon-corretto-jmods && \
export JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto && \
export PATH=$JAVA_HOME/bin:$PATH

RUN dbus-uuidgen --ensure

# Install Node.js, dbus and netsuite CLI
RUN curl -fsSL https://nodejs.org/dist/v18.14.2/node-v18.14.2-linux-x64.tar.xz | tar -xJv -C /usr/local --strip-components=1 && \
npm install -g --acceptSuiteCloudSDKLicense @oracle/suitecloud-cli

WORKDIR /app

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

2 participants