I am working on the the Smart-car-use-case provided in the mimik website. When i try to follow the steps '[B5-1] ,[B6-1], [B7-1] ', which will deploy the microservices to the mCM container,
I am getting the following error in postman.
[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid number; expected digit after '-'; last read: '--'
Please make sure that the deployment of all microservices are successful. You can verify deployment by running GET http://{{YOUR_IP_ADDRESS}}:{{PORT}}/mcm/v1/images (or [B4-1] in Postman collection) and looking at the response. Your response should contain the names of all the required microservices (miot-v1, msuperdrive-v1 and mbeam-v1). If the microservices are missing; you will need to deploy them again.
NOTE:
edgeengine must be running at all times in order to complete everything correctly
Related
I'm currently developing a stripe checkout for my website, it's working in localhost but gives me this error : JSON.parse: unexpected character at line 1 column 1 of the JSON data. In localhost I get this error if I name in a JSON payment intent field that does not exist, I've already set the live website in HTTPS channel
Stripe has a support article that explains how to debug and fix this error.
I made a simple website that recommends restaurants based on your city using Zomato API. It works perfectly locally, but when I deployed on a GitHub page it gives me the following
POST https://devangmukherjee.github.io/locations/delhincr 405
(anonymous) # index.js:15
index.js:15 - const res = await fetch(${hostname}/locations/${query}, {
and
index.js:24 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
index.js:24 is });
The repo is here - https://github.com/devangmukherjee/random-zomato-restaurant
It is a very small repo only three files.
The website link is here - https://devangmukherjee.github.io/random-zomato-restaurant/
The same code works perfectly locally. What can I do?
When you visit the website locally, you are running your Express backend on localhost too. But, when you visit it on GitHub, your backend isn't executing on GitHub's machines. So, when I write "Mumbai" in the search field, in the line const res = await fetch(`${hostname}/locations/${query}`, { you are actually fetching https://devangmukherjee.github.io/locations/mumbai. Since that GitHub's URL doesn't allow POST HTTP method (because your backend isn't executing there), you are getting a 405 HTTP error. Thus the first error. This response's body is HTML and not JSON. When you do res.json() on line 23 there is a parsing error when it finds the angle bracket of the first HTML tag. And that's the reason for your second error.
To make it work you have to deploy your backend somewhere else, e.g., Vercel or Netlify serverless functions or Heroku (among many other possibilities). And then, update your hostname variable on line 4 accordingly.
So I have been trying to create an embedded Instagram feed in ApostropheCMS. After struggling with an npm module using the Instagram Legacy API (Detailed here), I created an local Widget module based on this idea. It works surprisingly well.
However, when I was struggling I created a couple different "Instagram" pages and deleted them. Now when I use stagecoach to deploy, I recieve the following error:
Unhandled rejection MongoError: E11000 duplicate key error collection: ButchsBBQ.aposDocs index: slug_1 dup key: { : "/trash/instagram" }
Is there a good way for me to resolve this? How can I get rid of things that I've already trashed?
As noted in comments, the answer was provided in the apostrophe discord server. This happened when I migrated the data base improperly. Basically, I trashed the page on my local machine, migrated the database and then restored the database but before before refrashing my page,I believe I trashed the same page on the server. I ended up with two pages in the trash with the same slug key.
To solve this problem, the pages had to be dropped manually via mongo shell on both the local machine and server to proceed with deployment.
this is my first post so please go easy on me!
I am a beginning developer working with javascript and node.js. I am trying to make a basic request from a node js file to facebook's graph API. I have signed up for their developer service using my facebook account, and I have installed the node package for FB found here (https://www.npmjs.com/package/fb). It looks official enough.
Everything seems to be working, except I am getting a response to my GET request with a message saying my appsecret_proof is invalid.
Here is the code I am using (be advised the sensitive info is just keyboard mashing).
let https = require("https");
var FB = require('fb');
FB.options({
version: 'v2.11',
appId: 484592542348233,
appSecret: '389fa3ha3fukzf83a3r8a3f3aa3a3'
});
FB.setAccessToken('f8af89a3f98a3f89a3f87af8afnafmdasfasedfaskjefzev8zv9z390fz39fznabacbkcbalanaa3fla398fa3lfa3flka3flina3fk3anflka3fnalifn3laifnka3fnaelfafi3eifafnaifla3nfia3nfa3ifla');
console.log(FB.options());
FB.api('/me',
'GET',
{
"fields": "id,name"
},
function (res) {
if(!res || res.error) {
console.log(!res ? 'error occurred' : res.error);
return;
}
console.log(res);
console.log(res.id);
console.log(res.name);
}
);
The error I am getting reads:
{ message: 'Invalid appsecret_proof provided in the API argument',
type: 'GraphMethodException',
code: 100,
fbtrace_id: 'H3pDC0OPZdK' }
I have reset my appSecret and accessToken on the developer page and tried them immediately after resetting them. I get the same error, so I don't think that stale credentials are the issue. My
console.log(FB.options())
returns an appropriate looking object that also contains a long hash for appSecretProof as expected. I have also tried this code with a number of version numbers in the options (v2.4, v2.5, v2.11, and without any version key). Facebook's documentation on this strikes me as somewhat unclear. I think I should be using v2.5 of the SDK (which the node package is meant to mimic) and making requests to v2.11 of the graph API, but ??? In any case, that wouldn't seem to explain the issue I'm having. I get a perfectly good response that says my appSecretProof is invalid when I don't specify any version number at all.
The node package for fb should be generating this appSecretProof for me, and it looks like it is doing that. My other info and syntax all seem correct according to the package documentation. What am I missing here? Thank you all so much in advance.
looks like you have required the appsecret_proof for 2 factor authorization in the advance setting in your app.
Access tokens are portable. It's possible to take an access token generated on a client by Facebook's SDK, send it to a server and then make calls from that server on behalf of the client. An access token can also be stolen by malicious software on a person's computer or a man in the middle attack. Then that access token can be used from an entirely different system that's not the client and not your server, generating spam or stealing data.
You can prevent this by adding the appsecret_proof parameter to every API call from a server and enabling the setting to require proof on all calls. This prevents bad guys from making API calls with your access tokens from their servers. If you're using the official PHP SDK, the appsecret_proof parameter is automatically added.
Please refer the below url to generate the valid appsecret_proof,and add it to each api call
https://developers.facebook.com/docs/graph-api/securing-requests
I had to deal with the same issue while working with passport-facebook-token,
I finally released that the problem had nothing to have with the logic of my codebase or the app configuration.
I had this error just because I was adding intentionally an authorization Header to the request. so if you are using postman or some other http client just make sure that the request does not contain any authorization Header.
Every time I try to deploy truffle migrate --reset my Organization.sol contract, I get the following error:
Error encountered, bailing. Network state unknown. Review successful transactions manually.
I Googled the error and apparently this is due to contract size. My Organization.sol is not even that big; I’ve seen bigger contracts before.
Here is my contract: https://github.com/ulixir/eth-task-contracts/blob/master/contracts/Organization.sol
Any clues?
Do you also see an error this error
Error: insufficient funds for gas * price + value
In that case, the ethereum account you are trying to use may not have enough ether to perform the migration.
Ether can be added to an account by calling miner.start() from the geth console or by allocating ether to the account using the genesis.json file. You can read more about it here.
If you decide to use the genesis file, take the following steps after allocating data to your ethereum account:
remove the old geth db using geth --datadir "<your datadir>" removedb.
Reinitialize your geth node using the modified genesis file geth <your other params here> init <yourGenesisFile>
within the geth console of the new node, make sure you start the miner miner.start()
When done, try the migration again, it should work now.
If you decided to mine ether without modifying the genesis file, start the mining and give your ethereum account some time to mine enough ether. How long this takes depends on the difficulty level you set on your genesis file.
When you are using this command truffle migrate --reset it is trying to deploy Migration.sol contract also with your Organization.sol .You can see the migration script in migration folder. The error
Error encountered, bailing. Network state unknown. Review successful transactions manually.
means that it cannot determine which contracts are deployed.And telling you to check manually.To check which contracts are deployed you can use this command truffle network.