I have deployed my play 2.4 API based project to heroku. On production the api is seen on /swagger but it also shows some error. On navigating through the error it shows the json.
{
schemaValidationMessages: [{
level: "error",
domain: "validation",
keyword: "pattern",
message: "ECMA 262 regex "^/" does not match input string "https://domain.herokuapp.com "",
schema: {
loadingURI: "#",
pointer: "/properties/basePath"
},
instance: {
pointer: "/basePath"
}
}]
}
The dependency I have added is
"io.swagger" %% "swagger-play2" % "1.5.2"
From play prod configuration, I have overrided swagger basepath in my procfile.
-Dswagger.api.basepath=https://domain.herokuapp.com
What could be the reason for the error and how can I remove it?
Thanks
I think that this is the host, the basePath is supposed to be "/". At least this solved it for me
"host" : "https://domain.herokuapp.com",
"basePath" : "/",
Related
I am trying to call the mintNft function on the front end but it throws an error and I can't fix it
the error is:
"Program log: AnchorError occurred. Error Code: InstructionFallbackNotFound. Error Number: 101. Error Message: Fallback functions are not supported."
see http response:
rpc response
lib.rs
web.ts:
const tx = await program.rpc.mintNft(
mintKey.publicKey,
"https://arweave.net/y5e5DJsiwH0s_ayfMwYk-SnrZtVZzHLQDSTZ5dNRUHA",
"NFT Title",
{
accounts: {
mintAuthority: program.provider.wallet.publicKey,
mint: mintKey.publicKey,
tokenAccount: NftTokenAccount,
tokenProgram: TOKEN_PROGRAM_ID,
metadata: metadataAddress,
tokenMetadataProgram: TOKEN_METADATA_PROGRAM_ID,
payer: program.provider.wallet.publicKey,
systemProgram: SystemProgram.programId,
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
masterEdition: masterEdition,
},
}
);
console.log(tx);
// console.log("Your transaction signature", tx);
its because the instruction that you want to call is not available!
could be because a couple of things, such as:
check if IDL is the latest one, try erasing the target dir and run anchor build (dont forget to replace the program ID in the lib file of your programs)
check if anchor.toml program id equal the deployed program public key in /target/deploy directory
update your code to match anchor 0.24.2, It should look like this in Cargo.toml
[dependencies]
anchor-lang = "0.24.2"
mpl-token-metadata = { version="1.2.5", features = [ "no-entrypoint" ] }
anchor-spl = "0.24.2"
update package.json
{
"dependencies": {
"#project-serum/anchor": "^0.24.2",
"#solana/spl-token": "^0.2.0"
},
"devDependencies": {
"#types/chai": "^4.3.1",
"#types/mocha": "^9.1.1",
"chai": "^4.3.6",
"mocha": "^10.0.0",
"ts-mocha": "^10.0.0",
"typescript": "^4.6.4"
}
}
migrate the code to match anchor 0.24.2 for example (too long to post here) https://github.com/katopz/metaplex-anchor-nft/commit/f54ffaf087858f3997e797133ccc6d7748309c0a
and also rpc here https://github.com/katopz/metaplex-anchor-nft/commit/a72929548c8041ac422708c04078b8543e0f8a67
If nothing work, try run anchor test my forked here (tested today) https://github.com/katopz/metaplex-anchor-nft
For frontend, I think you will need to pass wallet provider to make it work. Should be something like this.
anchor.setProvider(new Client(programId, wallet).provider)
The error is thrown because of capital N in your function-name mintNft.
Capital letters are not supported for function name in solana program.
I also found out that underscore + number is also not supported, e.g. exchange1 is valid function name, but exchange_1 is invalid function name.
I'm facing this issue, while running fastlane pilot command in terminal. How should i use this " beta_app_review_info" as a parameter? what value need's to be added?
Here's the command i've tried to run but getting failed with "beta_app_review_info' value must be a Hash! Found String instead."
fastlane pilot upload --username="XXX#gmail.com" --verbose --changelog "$(cat changelog1.txt)" --distribute_external true --groups="Users" --ipa="build/Release-iphoneos/some.ipa" --beta_app_review_info “contact_email: "XXXXX#gmail.com",contact_first_name: "test",contact_last_name: "user",contact_phone: "XXXXXX",demo_account_name: "testuser#gmail.com",demo_account_password: "XXXX"
looks like beta_app_review_info is not included as parameter in Fastlane pilot. Can someone help me to sort out this issue?
Had the same issue. Probably, AppStore start to require extra meta data. Adding beta_app_review_info did fix the problem.
Sample:
upload_to_testflight(
beta_app_review_info: {
contact_email: "email#email.com",
contact_first_name: "Connect",
contact_last_name: "API",
contact_phone: "5558675309",
demo_account_name: "demo#email.com",
demo_account_password: "connectapi",
notes: "this is review note for the reviewer <3 thank you for reviewing"
},
localized_app_info: {
"default": {
feedback_email: "default#email.com",
marketing_url: "https://example.com/marketing-defafult",
privacy_policy_url: "https://example.com/privacy-defafult",
description: "Default description",
},
"en-GB": {
feedback_email: "en-gb#email.com",
marketing_url: "https://example.com/marketing-en-gb",
privacy_policy_url: "https://example.com/privacy-en-gb",
description: "en-gb description",
}
},
localized_build_info: {
"default": {
whats_new: "Default changelog",
},
"en-GB": {
whats_new: "en-gb changelog",
}
}
)
Reference: https://docs.fastlane.tools/actions/upload_to_testflight/
I wanted to fetch properties from two git repos. one is https://username#bitbucket.my.domain.com/share.git - which will have a property file contains some common key value pair and the other one is https://username#bitbucket.my.domain.com/service.git - it will have property files of all the micro services.
While I am deploying the service only one yml file (which is in https://username#bitbucket.my.domain.com/share.git repo) is read by the config server. What I am missing? How to read the property file from another repo i.e. https://username#bitbucket.my.domain.com/service.git too?
I wanted to deploy the service in PCF. So I configured the config-server in PCF with the following json.
{
"count": 1,
"git": {
"label": "feature",
"uri": "https://username#bitbucket.my.domain.com/share.git",
"username": "username",
"password": "password",
"repos": {
"configserver": {
"password": "password",
"label": "feature",
"uri": "https://username#bitbucket.my.domain.com/service.git"
"username": "username"
}
}
}
}
Name of my service is LogDemo and spring profile is active. I have created two yml files and placed in the corresponding repo. (I have given same name two both the files like LogDemo-active.yml). While I am deploying the service only one yml file (which is in https://username#bitbucket.my.domain.com/share.git repo) is read by the config server. /env is giving me the following:
{
"profiles": [
"active",
"cloud"
],
"server.ports": {
"local.server.port": 8080
},
"configService:configClient": {
"config.client.version": "234e59d4a9f80f035f00fdf07e6f9f16e5560a55"
},
"configService:https://username#bitbucket.my.domain.com/share.git/LogDemo-active.yml": {
"key1": "value1",
"key2": "value2"
},
...................
...................
What I am missing? How to read the property file from other repo i.e. https://username#bitbucket.my.domain.com/service.git too?
Below is my bootstrap.yml
spring:
application:
name: LogDemo
mvc:
view:
prefix: /
suffix: .jsp
Here is my manifest file
---
inherit: baseManifest.yml
applications:
- name: LogDemo
host: LogDemo
env:
LOG_LEVEL: INFO
spring.profiles.active: active
TZ: America/New_York
memory: 1024M
domain: my.domain.com
services:
- config-server-comp
When using multiple repos, the repos that will be applied depend on the pattern's defined for those repos. The default pattern is <repo-name>/*. Thus changing the repo name to LogDemo will activate the repo for your app, because the app name, spring.application.name, is LogDemo.
If one or more patterns match, then the repo for the matched patterns will be used. If no pattern matches then the default is used.
Full details are described in the docs here.
https://cloud.spring.io/spring-cloud-config/single/spring-cloud-config.html#_pattern_matching_and_multiple_repositories
If you don't need or want the pattern matching feature, you can use the [composite backend](
https://docs.pivotal.io/spring-cloud-services/2-0/common/config-server/composite-backends.html). The composite backend allows you to define multiple Git repositories. See the first config example here.
https://docs.pivotal.io/spring-cloud-services/2-0/common/config-server/composite-backends.html#general-configuration
trying to install the approuter currently, following this tutorial:
https://blogs.sap.com/2017/07/18/step-7-with-sap-s4hana-cloud-sdk-secure-your-application-on-sap-cloud-platform-cloudfoundry/
When pushing the approuter to CF, I get an destination error:
xs-app.json/routes/0: Format validation failed (Route references unknown destination "service-destination")
This is my manifest.yml:
---
applications:
- name: xyz
command: 'node approuter/approuter.js'
host: xyz-93deb1cd-7b72-4060-94e7-21342342
path: approuter
memory: 128M
buildpack: https://github.com/cloudfoundry/nodejs-buildpack
env:
TENANT_HOST_PATTERN: 'xyz(.*).cfapps.eu10.hana.ondemand.com'
destinations: "[{"name":"service-destination", "url": "https://gfuowbasdatq19agtuthorizations-srv.cfapps.eu10.hana.ondemand.com", "forwardAuthToken": true}]"
SAP_JWT_TRUST_ACL: '[{"clientid" : "*", "identityzone" : "*"}]'
services:
- my-xsuaa
- service-destination
This is my xs-app.json:
{
"routes": [{
"source": "/",
"target": "/",
"destination": "service-destination"
}]
}
Where is the application actually searching for this destination? I created it in my CF-account as well, pointing to my service-url.
In YAML (as well as many other markup languages, e.g. JSON) double quotes inside double quotes need to be escaped. (Cf. the YAML spec section 7.3.1 and this blog post)
So for you there are two options for your destinations variable:
1. Replacing all " inside with \" (relatively cumbersome, especially if you want to change the destinations in the future)
2. Use single quotes as boundaries. So the value of your destinations variable would look like this:
'[{"name":"service-destination", "url": "https://gfuowbasdatq19agtuthorizations-srv.cfapps.eu10.hana.ondemand.com", "forwardAuthToken": true}]'
so far I've managed to create two webhooks by using their official gem (https://github.com/bigcommerce/bigcommerce-api-ruby) with the following events:
store/order/statusUpdated
store/app/uninstalled
The destination URL is a localhost tunnel managed by ngrok (the https) version.
status_update_hook = Bigcommerce::Webhook.create(connection: connection, headers: { is_active: true }, scope: 'store/order/statusUpdated', destination: 'https://myapp.ngrok.io/bigcommerce/notifications')
uninstall_hook = Bigcommerce::Webhook.create(connection: connection, headers: { is_active: true }, scope: 'store/app/uninstalled', destination: 'https://myapp.ngrok.io/bigcommerce/notifications')
The webhooks seems to be active and correctly created as I can retrieve and list them.
Bigcommerce::Webhook.all(connection:connection)
I manually created an order in my store dashboard but no matter to which state or how many states I change it, no notification is fired. Am I missing something?
The exception that I'm seeing in the logs is:
ExceptionMessage: true is not a valid header value
The "is-active" flag should be sent as part of the request body--your headers, if you choose to include them, would be an arbitrary key value pair that you can check at runtime to verify the hook's origin.
Here's an example request body:
{
"scope": "store/order/*",
"headers": {
"X-Custom-Auth-Header": "{secret_auth_password}"
},
"destination": "https://app.example.com/orders",
"is_active": true
}
Hope this helps!