I am experiencing a problem creating a new token f...
# suitecommerce
k
I am experiencing a problem creating a new token for a 2020.2.1 version of the theme developer tools.  When I get redirected to the browser, I receive error message “An unexpected error has occurred. Please go back and try again.” and the URL in the browser address bar is “https://system.netsuite.com/app/login/secure/authorizetoken.nl?oauth_token=undefined”.  Any ideas on why this is happening?
e
The only time I have gotten the oauth_token=undefined was because I was using the wrong node.js version. Check that and delete your deploy/local folders.
h
I had the same issue @Keith Fetterman - I tried deleting and re-downloading the extension management tools and running npm install. Still didn't work for me. Did you get it working Keith?
s
Please raise a case if you're still experiencing issues. One person I have spoke to about this has suggested editing SC_21.2\Commons\ns_npm_repository\oauth1\index.js and changing
Copy code
const hostnameStep1 = this.vm ? hostName : `rest${molecule}.<http://netsuite.com|netsuite.com>`;

to

const hostnameStep1 = this.vm ? hostName : `system${molecule}.<http://netsuite.com|netsuite.com>`;
1
🙌 2
But I can't verify at the moment whether this is the correct thing to do
k
@Harley, I have not gotten it to work. Yesterday, I tested fetching using a new token with several clients, no luck. I then asked another developer to run tests with a 2021.1 version of the developer tools. No luck. I haven’t tested it today. Thanks for downloading and testing a copy of the extension management tools. @Steve Goldberg, thanks for passing along this suggestion. I will give it a try.
k
I believe that this is a networking issue. I had this issue two weeks ago. I found that when I was on Google DNS that I would get this issue, but when I switched to a different DNS provider it would work. I would get completely different responses from the NetSuite rest server. Currently when I GET from https://rest.netsuite.com/rest/issuetoken Which issue is what the script hits to get a token, I get this response.
Copy code
{
  "type": "<https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>",
  "title": "Account-specific domain is not used",
  "detail": "In this account, you must use account-specific domains with REST web services endpoints. Go to Setup > Company > Company Information in the NetSuite UI. Your domains are listed on the Company URLs tab.",
  "status": 410,
  "o:errorCode": "USER_ERROR"
}
This was the error I got originally when, I was on Googles DNS. I do not have the response save that I should be getting. When I would NSLOOKUP that domain, it would return different IPs depending on what DNS provider I used. @Steve Goldberg
s
Interesting
k
I am unable to fetch again even with the DNS I had to switch to. When do "nslookup rest.netsuite.com" I am pointed to 23.54.33.216. I'd be interested to see if anyone that can issue tokens currently, what they get.
When I say Fetch, fetch for the first time to Issue a New Token.
k
Following, I am having the exact same issues...
l
Ran into this today as well, method suggested above by Steve worked
k
Ill Give it a shot and see what happens
Ill be damn, That worked
Copy code
system${molecule}.<http://netsuite.com|netsuite.com>
l
Nice. Thanks @Steve Goldberg
k
@Steve Goldberg, I can also confirm that the change in oauth1\index.js worked. Thank you!!!
e
Now I am getting the same issue as you guys but I am trying to deploy to a Site Builder Extensions Premium Elbrus. I tried changing the restlet for system string but it did not work. @Steve Goldberg I do not like to tag anybody but your previous suggestion worked for newer versions. Do you know if a different/extra change needs to be added for older versions?
s
I don't know. I suggest raising a case
👌 1
g
this suggestion of steve worked for me.
Copy code
const hostnameStep1 = this.vm ? hostName : `rest${molecule}.<http://netsuite.com|netsuite.com>`;

to

const hostnameStep1 = this.vm ? hostName : `system${molecule}.<http://netsuite.com|netsuite.com>`;
k
We have another client that is running SCA Kilimanjaro. The patch that Steve Goldberg suggested to resolve the Unexpected Error that occurs when attempting to deploy using a new token does not work with Kilimanjaro. I have submitted a NetSuite support case. Has anyone found a fix for earlier versions of SCA like Kilimanjaro?
e
I would expect to have patch instruction on the help center/suiteanswer for this issue, many developers have stated the issue and NetSuite already know that this is an issue for all versions of SCA.
d
@Steve Goldberg the index hack worked. thanks!
k
OK - having the same issue with SCS site - we dont have access to that file….or am I misunderstanding?
e
@kkennedydesign look for this file in your extension devs tool: ns_npm_repository\oauth1\index.js, the trick is the same.
k
ok - same for theme?
e
correct netsuite
k
@eminero thanks so much
👌 1
Worked like a charm - appreciate it.
🙌 1
m
@Keith Fetterman did your Kilimanjaro client ever receive an answer? I'm in the same boat.
k
@Mike Herrera, NetSuite has not fixed the defect yet. They did provide a workaround that I haven’t tried yet. Here are the instructions they sent me: Hi Keith, Good day! I hope you’re doing well Thank you for your response and for your confirmation. Apologies if it seems too long to resolve this issue on our end. However, would it be okay if we try another suggested workaround by our Advanced Solution team to fix the Token creation-related issue?  Create a Token in NetSuite UI:
1. Navigate to Setup > Users/Roles > Access Tokens > New
2. Select the Application Name
3. Select the User where the new token will be assigned
4. Select Role (Noticed that Administrator role cannot be selected in this dropdown)
5. Enter Token Name then Save
IMPORTANT: USer will be redirected to the Access Token Record. Make sure to take note of the TOKEN ID and TOKEN SECRET as this is the only time that the Token ID and Token Secret values are displayed. After you leave this page, they cannot be retrieved from the system.
6.Navigate to C:\Users\<Username> (e.g. C:\Users\AICARO)
7. Edit .nstba and enter the following information
*GeleenTstdrvNew2 — is the toke name that will display on the list of tokens when you run gulp theme:fetch
*token — TOKEN ID from step #7
*secret — TOKEN SECRET from step #7
*account — Target account number
8. Save .nstba
9. Run gulp theme:fetch or gulp deploy --to in the CLI
Expected Result: The New Token should be available on the list of tokens I replied to NetSuite support asking them what name I should select for “Select the Application Name”. I never received an answer. I also think this may be domain or datacenter related. One of my co-workers on the east coast of the US did not experience the problem. Myself and another co-worker experienced the problem, and we are both on the west coast of the US. If you try this and it works, let me know. Thanks Keith
m
Thank you @Keith Fetterman! I'll try this procedure and report back.
k
@Mike Herrera, I tried creating a new token and seeing what application names are in the dropdown list. I see one named “SC-TBA”. I wonder if that is it.
@Mike Herrera, I checked another account that has SCA related access tokens, and the ‘SC-TVA’ was the name of the tokens.
m
If I recall correctly, the application names are for the administrator's convenience. It does not need to be a specific string.
@Keith Fetterman , the manually created entry in
.nstba
worked for me! What was interesting is that it appears that the name of the entry in
.nstba
is arbitrary. I named my Sandbox, Staging, and that will be much more convenient than some nonsense hash.
k
@Mike Herrera, thank you for testing and verifying it works. I’ll let NetSuite Support know. By the way, which role did you use? I noticed that you can not select the Administrator role.
m
I have a custom role with permissions to manage and generate tokens.
k
Thanks
285 Views