You must provide a user name/id (via --os-username, --os-user-id, env[OS_USERNAME] or env[OS_USER_ID]) or an auth token (via --os-token) - openstack

While trying to run nova command in openstack server, I get this error:
You must provide a user name/id (via --os-username, --os-user-id,
env[OS_USERNAME] or env[OS_USER_ID]) or an auth token (via --os-token).
How could I fix it?

you have to apply openrc file.
this file contains some env vars for user,pass,auth_url and ...
this file looks like this
export OS_USERNAME=username
export OS_PASSWORD=password
export OS_TENANT_NAME=projectName
export OS_AUTH_URL=https://identityHost:portNumber/v2.0
export OS_TENANT_ID=tenantIDString
export OS_REGION_NAME=regionName
export OS_CACERT=/path/to/cacertFile
or you can export one be one in bash. or permanently add to /etc/environment file.

Related

How can I resolve the exception reported by rocksdb when using NebulaGraph Exchange?

I want to export data from NebulaGraph and used the configuration file provided by the official documentation.
The core content of the configuration file used in this example is as follows:
# Processing tags
# There are tag config examples for different dataSources.
tags: [
# export NebulaGraph tag data to csv, only support export to CSV for now.
{
name: player
type: {
source: Nebula
sink: CSV
}
# the path to save the NebulaGrpah data, make sure the path doesn't exist.
path:"hdfs://192.168.12.177:9000/vertex/player"
# if no need to export any properties when export NebulaGraph tag data
# if noField is configured true, just export vertexId
noField:false
# define properties to export from NebulaGraph tag data
# if return.fields is configured as empty list, then export all properties
return.fields:[]
# nebula space partition number
partition:10
}
Then I executed the spark task as follows:
./spark-submit --master "local" --class com.vesoft.nebula.exchange.Exchange ~/exchange-ent/nebula-exchange-ent-3.3.0.jar -c ~/exchange-ent/export_application.conf
However, the task fails to be executed, and the following error message is displayed:
org.rocksdb.RocksDBException: While open a file for appending: /path/sst/1-102.sst: No such file or directory
I checked the path and /path/sst/ exists, and I have checked that the permission of this folder also belongs to NebulaGraph.
Could anyone help hint at where I could be wrong?

Next.js doesn't pick up variables from the .env file

I want to use a variable from the .env file, but I'm getting the following error:
Uncaught (in promise) IntegrationError: Please call Stripe() with your publishable key. You used an empty string.
code
import Stripe from "stripe";
const stripe = new Stripe(process.env.NEXT_PUBLIC_STRIPE_SECRET_KEY);
.env
NEXT_PUBLIC_STRIPE_SECRET_KEY=***
In Next.js you should declare your environment variables in a .env.localĀ file.
For more informations check the official docs.
However, as suggested by #juliomalves, you can declare your environment variables in a .env.* file, making sure that you respect the environment variables load order.

ERROR when trying to Create projects in openstack (Missing value auth-url required for auth plugin password )

Openstack | Keystone
I follow above official Openstack documentation to Create projects, users, and roles, I met this error message:
strong textMissing value auth-url required for auth plugin password
I already tried these commands:
$ export | grep OS_
$ declare -x OS_AUTH_URL="http://controller:35357/v3"
And it still did not work, I think it's related to the OS_auth_url
you have to define other OS variable like:
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=iQds9Glj6QH4
export OS_AUTH_URL=http://openstack.local:35357/v3
export OS_INTERFACE=internal
export OS_IDENTITY_API_VERSION=3
export OS_REGION_NAME=RegionOne
export OS_AUTH_PLUGIN=password123

how can I logout from a openstack user

how can I logout from a openstack user to which I have switched using the RC file with out closing the terminal. I hav tried the "exit" command but it closes the terminal.
The RC script exports environment variables related to authentication.
If you wish to not be authenticated anymore you could unset these variables, or source a different RC file in order to switch users.
Essentially the minimal contents of an RC file are the following:
export OS_PROJECT_DOMAIN_NAME=...
export OS_USER_DOMAIN_NAME=...
export OS_PROJECT_NAME=...
export OS_USERNAME=...
export OS_PASSWORD=...
export OS_AUTH_URL=...
You could create and source a script with the following content to in order to logout:
unset OS_PROJECT_DOMAIN_NAME
unset OS_USER_DOMAIN_NAME
unset OS_PROJECT_NAME
unset OS_USERNAME
unset OS_PASSWORD
unset OS_AUTH_URL
If there are more environment variables in your RC file, related to authentication you can add them too.

openstack newbie: why give me this error, even if password is correct?

I have installed openstack following this guide.
Now I want to try a simple cli command
openstack catalog list
I have export all this variables
export HOSTNAME="openstack1"
export OS_AUTH_PLUGIN="token"
export OS_AUTH_URL="http://openstack1:5000/v3/"
export OS_IDENTITY_API_VERSION="3"
export OS_PASSWORD="correctadminpass"
export OS_PROJECT_DOMAIN_ID="default"
export OS_PROJECT_DOMAIN_NAME="mydomain.fqdn"
export OS_SERVICE_ENDPOINT="http://openstack1:5000/v3/"
export OS_SERVICE_TOKEN="1234tokencorrecttakefromkeystone.conf"
export OS_USERNAME="admin"
But the command return this error
openstack catalog list
The request you have made requires authentication. (HTTP 401) (Request-ID: req-3346b80c-0b57-4a7e-a8c9-cf07acb83976)
Is not sufficient to export the OS variables?
It gave you the error because the project was not specified. Openstack authentication requires a username or id, and a project name or id.
Note that:
export OS_PROJECT_NAME="admin"
export OS_TENANT_NAME="admin"
are effectively saying the same thing. "Tenant" is the old terminology for "project".
Please refer to the Openstack command Manual Entry for more details on the environment variables that it recognizes.
Normally, the only URL you need is the URL for Keystone (OS_AUTH_URL). The openstack command can work out how to contact other services from the Keystone catalog.
Solution found, the command
openstack catalog list
return correct output after exporting those variables
export OS_AUTH_URL="http://openstack1.mydomain.priv:5000/v3"
export OS_BOOTSTRAP_PASSWORD="mypass"
export OS_IDENTITY_API_VERSION="3"
export OS_PASSWORD="mypass"
export OS_PROJECT_DOMAIN_ID="default"
export OS_PROJECT_NAME="admin"
export OS_TENANT_NAME="admin"
export OS_USERNAME="admin"
export OS_USER_DOMAIN_ID="default"

Resources