Where and how to correct the "INVALID IDENTITY CREDENTIANLS " while running ./stack.sh? - devstack

I have written this in my envirn var file and sourced it...
export OS_USERNAME=admin
export OS_PASSWORD=passwrd
export OS_AUTH_URL=http://localhost:5000/v2.0/
its still giving me the same error... can anyone elaborate what to do with the token thing?

I think you shouldn't set any environ variables before running stack.sh.Devstack comes with its own identity credentials that creates admin and demo users.

Related

QFtp Warning QIODevice::read (QTcpSocket, QFtpDTP

QFtp Ftp;
When i have Ftp loggedIn and i try to get a file that does not exist on the server using
Ftp.get(RemoteFile, LocalFile.data()); i received a warning
I know it is because of writting direct to data of LocalFile.
This is the warning:
QIODevice::read (QTcpSocket, "QFtpDTP Passive state socket"): device not open
What is the best way to treat this warning?
I tried Try Catch(...) to fix the issue and still happenning.
Forget about. I use the list command before the get to check if file was there and avoid the issue.
I did a FTP.list(RemoteDirectory) and if the file is there i call FTP.get(RemoteDirectoy, localFile.data()), if is not there i do not call The FTP.

How to save a file to a folder in blazor with syncfushion?

I'm trying to save a file in the "sample/save" using the syncfusion SfUploader I think I'm defining the path wrong.
<SfUploader ID="UploadFiles">
<UploaderEvents></UploaderEvents>
<UploaderAsyncSettings SaveUrl="sample/save"></UploaderAsyncSettings>
</SfUploader>
It gives me this error on the browser console.
HTTP400: BAD REQUEST - The request could not be processed by the server due to invalid syntax.
(XHR)POST - https://localhost:33478/sample/save
(new to blazor)
Thanks in advance :)
Suspecting that the controller name and the name in SaveUrl are not identical. Please ensure that the API controller name and SaveUrl name are same. Also refer the below sample and UG.
Sample Link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Uploader449877060
UG Link : https://blazor.syncfusion.com/documentation/file-upload/getting-started/#with-server-side-api-endpoint

Default project id in BigQuery Java API

I am performing a query using the BigQuery Java API with the following code:
try (FileInputStream input = new FileInputStream(serviceAccountKeyFile)) {
GoogleCredentials credentials = GoogleCredentials.fromStream(input);
BigQuery bigQuery = BigQueryOptions.newBuilder()
.setCredentials(credentials)
.build()
.getService();
QueryRequest request = QueryRequest.of("SELECT * FROM foo.Bar");
QueryResponse response = bigQuery.query(request);
// Handle the response ...
}
Notice that I am using a specific service account whose key file is given by serviceAccountKeyFile.
I was expecting that the API would pick up the project_id from the key file. But it is actually picking up the project_id from the default key file referenced by the GOOGLE_APPLICATION_CREDENTIALS environment variable.
This seems like a bug to me. Is there a way to workaround the bug by setting the default project explicitly?
Yeah, that doesn't sound right at all. It does sound like a bug. I always just use the export the GOOGLE_APPLICATION_CREDENTIALS environment variable in our applications.
Anyway, you try explicitly setting the project id to see if it works:
BigQuery bigQuery = BigQueryOptions.newBuilder()
.setCredentials(credentials)
.setProjectId("project-id") //<--try setting it here
.build()
.getService();
I don't believe the project is coming from GOOGLE_APPLICATION_CREDENTIALS. I suspect that the project being picked up is the gcloud default project set by gcloud init or gcloud config set project.
From my testing, BigQuery doesn't use a project where the service account is created. I think the key is used only for authorization, and you always have to set a target project. There are a number of ways:
.setProjectId(<target-project>) in the builder
Define GOOGLE_CLOUD_PROJECT
gcloud config set project <target-project>
The query job will then be created in target-project. Of course, your service key should have access to target-project, which may or may not be the same project where your key is created. That is, you can run a query on projects other than the project where your key is created, as long as your key has permission to do so.

Google Apps Script ScriptDb permissions issue

I am having an issue trying to query the ScriptDb of a resource file in Google Apps Script. I create a script file (file1), add it as a resource to another script file (file2). I call file1 from file2 to return a handle to its ScriptDb. This works fine. I then try to query the ScriptDb but have a permissions error returned.
Both files owned by same user and in same google environment
See code below:
file 1:
function getMyDb() {
return ScriptDb.getMyDb;
}
file 2 (references file1):
function getDataFromFile1() {
var db = file1.getMyDb(); // This works
var result = db.query({..............}); // This results in a permissions error!
}
I am at a loss to understand why I can access file1 and get back a handle on the ScriptDb, but then am not able to query it, due to an permissions issue.
I have tried to force file1 to require re-authorization, but have not yet been successful. I tried adding a new function and running it, so any suggestions there would be gratefully received.
Thanks in advance
Chris
There appears to be an error in file1/line2. It says "return ScriptDb.getMyDb;" but it should say "return ScriptDb.getMyDb();"
If you leave out the ()s then when you call file1 as a library, file1.getMyDb() will return a function which you store in var db. Then the line var result = db.query({..............}) results in an error because there is no method "query" in the function.
Is that what's causing your error?
I have figured out what the problem was, a misunderstanding on my part regarding authorisation. I was thinking of it in terms of file permissions, when in fact that problem was that my code was not authorised to run the DbScript service. As my code calls a different file and receives back a pointer to a ScriptDb database it is not using the ScriptDb service, so then when it calls the db.query() it invokes the ScriptDb service, for which it is not authorised.
To resolve this I just had to create a dummy function and make a ScriptDb.getMyDb() call, which triggered authorisation for the service. The code then worked fine.
Thanks for the input though.
Chris

Google Script Spreadsheet - Permission denied to use modification function

I'm new in google script realisation.
I read all tutorials, and all the function that are made to get values from the spreadsheet work, but the one for the modification return errors. Everytime i use a fonction like setvalue, i get the message "permission denied to use setvalue". It's the same for create, etc...
Even when i make a copy-paste from the tutorials.
For example, this part of the runExample function returns me an error of permission.
for (var i = 0; i < departments.length; ++i)
{
var sheet = ss.getSheetByName(departments[i]) || ss.insertSheet(departments[i], ss.getSheets().length);
sheet.clear();
var headersRange = sheet.getRange(1, 1, 1, columnNames.length);
headersRange.setValues([columnNames]);
headersRange.setBackgroundColor(headerBackgroundColor);
setRowsData(sheet, dataByDepartment[departments[i]]);
}
What can i do?
Is there somewhere i can set permission?
Thank you.
Emmanuel
The message is saying your script don't have permission to edit the Spreadsheet. To sort this problem you can either:
Go to Spreadsheet and click on 'Share' button (in the top right corner) and give EDIT PERMISSION to the people running the script.
If you don't want to give permission to other people, you can deploy your script with the following configuration:
Execute App As: me (your_email#domain.com)
Who has access to the App: Anyone
If you not sure how to deploy a Webb App, just follow this tutorial