oracle / netsuite-suitecloud-sdk

SuiteCloud Software Development Kit (SuiteCloud SDK) are the set of tools that allow you to customize accounts and create SuiteApps through SuiteCloud Development Framework (SDF).
https://www.netsuite.com/
Universal Permissive License v1.0
201 stars 62 forks source link

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

Closed Gribbs closed 4 months ago

Gribbs commented 5 months ago

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: /netsuite-docker:latest

pipelines: branches: main:

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


5. Build the docker image:
`docker buildx build --platform linux/amd64 -t <yourpublicimage>/netsuite-docker --load .`
6. Deploy the docker image to Docker Hub:
`docker buildx build --platform linux/amd64 -t <yourpublicimage>/netsuite-docker --push .`
7. 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: <company details>. 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](https://github.com/oracle/netsuite-suitecloud-sdk/issues/746#issuecomment-1683907712) 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](https://github.com/oracle/netsuite-suitecloud-sdk/issues/746#issuecomment-1683907712) 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 commented 4 months ago

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

Gribbs commented 4 months ago

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