error when using exp build : [exp] API Response Error: Cannot convert `undefined` with r.expr() - exponentjs

This error appeared while using exponent CLI to build an standalone (shell) app:
[exp] API Response Error: Cannot convert `undefined` with r.expr() in:
r.db("prod").table("credentials").getAll(undefined, {
^^^^^^^^^ ^
index: "username"
^^^^^^^^^^^^^^^^^
})

Check whether you are logged in through exponent CLI via
exp login
note that being logged in exponent XDE does not neccessarily mean you are logged in exponent CLI

Related

"invalid peer certificate contents..." while running `slack run` using slack-cli running on deno

I am on MacOS (M1) trying to run slack run. When I call the Workflow and submit very simple form, I get error:
🚫 Error: exit status 1
error: Uncaught (in promise) TypeError: error sending request for url (https://slack.com/api/functions.completeSuccess): error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer
const resp = await fetch(url, {
^
at async mainFetch (deno:ext/fetch/26_fetch.js:247:14)
at async fetch (deno:ext/fetch/26_fetch.js:464:9)
at async BaseSlackAPIClient.apiCall (https://deno.land/x/deno_slack_api#0.0.2/base-client.ts:20:18)
at async RunFunction (https://deno.land/x/deno_slack_runtime#0.5.0/run-function.ts:57:5)
at async DispatchPayload (https://deno.land/x/deno_slack_runtime#0.5.0/dispatch-payload.ts:64:16)
at async runLocally (https://deno.land/x/deno_slack_runtime#0.5.0/local-run-function.ts:29:16)
at async https://deno.land/x/deno_slack_runtime#0.5.0/local-run-function.ts:50:3
Slack version:
Using slack v1.16.4
Deno version:
deno 1.28.3 (release, aarch64-apple-darwin)
v8 10.9.194.5
typescript 4.8.3
Can anyone help on this please?
I tried to submit workflow form that is supposed to input a message and enrich it and send it back to channel.
If you are behind a proxy you can set the HTTP_PROXY and the HTTPS_PROXY environment variables.
Or if you need to load a CA from a local pem file you can set the DENO_CERT variable
see Deno Environment Documentation

createMinToInstruction authorized by PDA, works fine in LocalNet, but gives "Account not associated with this Mint" when run on DevNet

I create an automate deployment script that will mint 2million SPL tokens to an address, the mint is owned by the program PDA as shown in Solana explorer:
Bellow is the last step in the deployment script:
export async function mint2e6Tokens(provider: anchor.AnchorProvider, tokenAccount: PublicKey, mint: PublicKey): Promise<void> {
// get the token account could be PDA
const programKeypair = await createKeypairFromFile(PROGRAM_KEYPAIR_PATH);
/** Load from PDA */
let mint_tokens_tx = new Transaction().add(
createMintToInstruction(
mint,
tokenAccount,
programKeypair.publicKey, // -> I DOUBLE CHECKED, THIS IS 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
2e6,
[],
TOKEN_PROGRAM_ID
)
);
// We sign with our programId instead of the wallet because this is a PDA
// Program Derived Adress
await provider.sendAndConfirm(mint_tokens_tx, [programKeypair]);
}
When I run in LocalNet, it works:
Migrating to LocalNet...
RUNNING CUSTOM SCRIPT ====>>>
Payper: EsgJ9ihTEZskWyWpMMPuGVisy5ay76YWgetgTLb3jRmj
Using program 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
Program: 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
Mint: AVPgrT1y6ZfjGWPyLCWEPZdogRgmEMbrdRbcHNSfAPzF
Campaign: FcAmyEgZsXUKLB6hKufDmLuSBzMzVtPmRPm7vZLStK4U
31999500
However when I switch to DevNet, it always give me error
Migrating to DevNet...
RUNNING CUSTOM SCRIPT ====>>>
Payper: EsgJ9ihTEZskWyWpMMPuGVisy5ay76YWgetgTLb3jRmj
Using program 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
Program: 6Z24B3qCrWfWvDo1f2HgxmnBSGhqQes1sHobqMtMxfbP
Mint: AVPgrT1y6ZfjGWPyLCWEPZdogRgmEMbrdRbcHNSfAPzF
Campaign: FcAmyEgZsXUKLB6hKufDmLuSBzMzVtPmRPm7vZLStK4U
SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x3
at Connection.sendEncodedTransaction (/code/beens/node_modules/#solana/web3.js/src/connection.ts:4248:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Connection.sendRawTransaction (/code/beens/node_modules/#solana/web3.js/src/connection.ts:4210:20)
at async sendAndConfirmRawTransaction (/code/beens/node_modules/#project-serum/anchor/src/provider.ts:288:21)
at async AnchorProvider.sendAndConfirm (/code/beens/node_modules/#project-serum/anchor/src/provider.ts:148:14) {
logs: [
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]',
'Program log: Instruction: MintTo',
'Program log: Error: Account not associated with this Mint',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2809 of 200000 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x3'
]
}
Why the authority is right, but Solana complain that Error: Account not associated with this Mint?
It turns out that my versions for Solana, Anchor and Rust are not compatible with DevNet and / or testnet.
I upgrade solana to main net recommended version and it works. One more things to mention that don't forget to run "solana program close --buffers" before trying. My current settings are:
root#d4c64206ce03:/code# solana --version
solana-cli 1.10.31 (src:77a40cd8; feat:4192065167)
root#d4c64206ce03:/code# rustc --version
rustc 1.63.0 (4b91a6ea7 2022-08-08)
root#d4c64206ce03:/code# anchor --version
anchor-cli 0.25.0

New Rails GraphQL installation can't load /graphiql; crashes with "Invalid or incomplete introspection result. Ensure that you are passing..."

steps to reproduce:
rails new HelloGraphQLWorld
install Gems
gem 'graphiql-rails', group: :development
gem 'graphql'
run bundle install
then run graphql installer: rails generate graphql:install
• notice several files are generated here for you by the installer
• Start rails server rails s
• Open /graphiql in browser window
It crashes (cannot open correctly) with:
{
"message": "Invalid or incomplete introspection result. Ensure that you are passing \"data\" property of introspection response and no \"errors\" was returned alongside: {}.",
"stack": "Error: Invalid or incomplete introspection result. Ensure that you are passing \"data\" property of introspection response and no \"errors\" was returned alongside: {}.\n at devAssert (webpack-internal:///../../../node_modules/graphql/jsutils/devAssert.mjs:7:11)\n at buildClientSchema (webpack-internal:///../../../node_modules/graphql/utilities/buildClientSchema.mjs:41:266)\n at eval (webpack-internal:///./components/GraphiQL.tsx:1133:57)"
}
This happens if your APP NAME is not correctly TitleCase..
ironically, the "QL" in the App name is the problem, because the generator genreates code with HelloGraphQLWorldSchema but the Zietwork framework (part of Rails) is expecting this to be correctly title cased as HelloGraphQlWorldSchema
both the file definition app/graphql/hello_graph_ql_world_schema.rb and in the graphQL controller too
// graphql_controller.rb
result = HelloGraphQLWorldSchema.execute(query, variables: variables, context: context, operation_name: operation_name)
should be
result = HelloGraphQlWorldSchema.execute(query, variables: variables, context: context, operation_name: operation_name)
{
"errors": [
{
"message": "uninitialized constant GraphqlController::HelloGraphQLWorldSchema\nDid you mean? HelloGraphQlWorldSchema",
"backtrace": [
"/Users/jason/Work/_LEARNING/GraphQL/HelloGraphQLWorld/app/controllers/graphql_controller.rb:15:in `execute'",
"/Users/jason/.rvm/gems/ruby-2.7.5/gems/actionpack-7.0.0/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'",
"/Users/jason/.rvm/gems/ruby-2.7.5/gems/actionpack-7.0.0/lib/abstract_controller/base.rb:214:in `process_action'",
"/Users/jason/.rvm/gems/ruby-2.7.5/gems/actionpack-7.0.0/lib/action_controller/metal/rendering.rb:53:in `process_action'",
"/Users/jason/.rvm/gems/ruby-2.7.5/gems/actionpack-7.0.0/lib/abstract_controller/callbacks.rb:234:in `block in process_action'",
"/Users/jason/.rvm/gems/ruby-2.7.5/gems/activesupport-
Alternatively, if your app has correct titlecasing this should not apply to you.

Non-ASCII in URL in CMake ExternalProject_Add

I've had this ExternalProject_Add call in my CMake:
set(SIM_URL https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip)
set(SIM_FILENAME vhnHilsimPlantModel-{build.number}.zip)
# Download and install
include(ExternalProject)
ExternalProject_Add(get_sim
DOWNLOAD_NAME ${SIM_FILENAME}
URL ${SIM_URL}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/sim_lib.a
STEP_TARGETS update)
It worked fine with the 2017 version of TeamCity. However, after our DevOps upgraded TeamCity to the 2019 version, this code started failing:
file='/home/user/sim/sim-prefix/src/vhnHilsimPlantModel-{build.number}.zip'
Old file will be removed and new file downloaded from URL.
-- Downloading...
dst='/home/user/build/apps/sim/sim-prefix/src/vhnHilsimPlantModel-{build.number}.zip'
timeout='none'
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retrying...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retry after 5 seconds (attempt #2) ...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retry after 5 seconds (attempt #3) ...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retry after 15 seconds (attempt #4) ...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retry after 60 seconds (attempt #5) ...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
CMake Error at vahana_sim-stamp/download-vahana_sim.cmake:157 (message):
Each download failed!
error: downloading 'https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip' failed
status_code: 22
status_string: "HTTP response code said error"
log:
--- LOG BEGIN ---
Trying 172.31.21.90...
The only way to fix it is to change { and } to %7B and %7D, respectively. This, technically should have been done in the first place, but it was working. Does anyone know why this change has to be done and/or why the non-ASCII characters have to be encoded when specifying the URL?
I am using CMake 3.10.2.
The TeamCity 9.X documentation for Obtaining Artifacts confirms that curly braces {build.number} could be used in the URL:
ARTIFACT_PATH is a path to the artifact on the TeamCity server. This path can contain a {build.number} pattern which will be replaced with the build number of the build whose artifact is retrieved.
However, this caused a few issues (one example here), as there are several reserved characters in the RFC's pertaining to URI/URL standards (in this case RFC 1738). The RFC 1738 standard deems a group of characters "unsafe" (including curly braces), in addition to the reserved characters for URIs:
Other characters are unsafe because
gateways and other transport agents are known to sometimes modify
such characters. These characters are "{", "}", "|", "", "^", "~",
"[", "]", and "`". [...] All unsafe characters must always be encoded within a URL.
Thus, the TeamCity software was updated thereafter to support the curly brace encodings as well. The TeamCity 10.X documentation for Obtaining Artifacts was updated to align with the standards for URL encoding:
ARTIFACT_PATH is a path to the artifact on the TeamCity server. This path can contain a {build.number} pattern (%7Bbuild.number%7D) which will be replaced by TeamCity with the build number of the build whose artifact is retrieved.
It seems that by the TeamCity 2019 versions, the support for using raw curly braces in the URL has been dropped altogether in alignment with the standard, and only the encoded version is allowed. So you can update your CMake code to something like this:
set(SIM_FILENAME vhnHilsimPlantModel-%7Bbuild.number%7D.zip)
set(SIM_URL https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/${SIM_FILENAME})

error docker jhipster version 4.0.2

I've pulled jhipster docker version 4.0.2 and when I try to create a new proyect I get a error :
yo jhipster
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/yeoman/insight & http://yeoman.io
========================================================================== (Y/n)
/usr/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:75
throw e;
^
SyntaxError: Invalid regular expression: /.{1,0}/: numbers out of order in {} quantifier
at RegExp (native)
at breakLines (/usr/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/utils/screen-manager.js:108:15)
at ScreenManager.render (/usr/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/utils/screen-manager.js:55:22)
at Prompt.render (/usr/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/prompts/confirm.js:85:15)
at Prompt._run (/usr/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/prompts/confirm.js:65:8)
at Prompt.run (/usr/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/prompts/base.js:57:8)
at Object. (/usr/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/ui/prompt.js:84:12)
at module.exports (/usr/lib/node_modules/yo/node_modules/run-async/index.js:15:21)
at AnonymousObservable.__subscribe (/usr/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/utils/utils.js:16:7)
at AnonymousObservable.tryCatcher (/usr/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:63:31)
Any idea?

Resources