What's the cause of "Failed to preload gadget..." for Sharebox gadgets in IBM Connections - opensocial

I've followed the procedure documented at "Adding new ways to share content"
...but keep getting an error:
Failed to preload gadget http://....
Detailed error: 400 Gadget is not trusted to render in this container. cre.iruntime:cre.iwidget.event:cre.wire:cre.iwidget:cre.iwidget.itemset:cre….ibm.connections.ee:ibm.connections.ee:container.nongadget:open-views.js:4
sharebox error http://i7.minus.com/ibiLz4SSWA5EL8.png
This looks like some sort of trust problem with external servers, but my other gadgets (embedded experience & home page gadgets) on the same external host are all working fine.
What have I missed out in the configuration?

OK, shamefully, it looks like I missed out swapping the security attribute whitelistEnabled="true" to whitelistEnabled="false" in:
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/connectionswwCell01/LotusConnections-config/opensocial-config.xml
Here:
<security whitelistEnabled="false" featureAdminEnabled="true">
More details in this slide: How to add your own OpenSocial Gadgets to IBM Connections.
Of course, in a production system, you'll have to checkout the opensocial config using wsadmin.sh, edit, checkin & restart.

Related

MainPageSuffix for static site not working

I have searched for this question, but none of the responses help me.
Following the tutorial, I have created a new bucket (www.stepwiserefinement.co.uk) and it contains a static site, including index.html and error.html.
I have used the Console to set these as defaults for the base url and unknown files.
When I access the http://www.stepwiserefinement.co.uk URL, I get an XML listing of the files; I should be seeing index.html.
gustily correctly reports
{"mainPageSuffix": "/index.html", "notFoundPage": "/error.html"}
but if I access the domain with no path, the response is
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>
Anonymous caller does not have storage.objects.list access to the Google Cloud Storage bucket.
</Details>
</Error>
No https, no load balancer needed.
Missing something.
Suggestions please.
There's multiple issues here.
Your site still loads in HTTPS when you put it in the browser. The connection is somehow upgrading you to SSL. And if you're in SSL, you need the load balancer. As opposed to these instructions without load balancer. Maybe you have SSL turned on with your registrar or somewhere else.
I only get 404 error. Not sure how you got "Access denied". But it could also be a secondary issue because when enabled properly, no access control is present. For example, it says here under step 3 "selected Uniform for Access Control". This removes access control.
Let us know if you followed the last article completely
Edit: Also, out of curiosity, try making the bucket public (without Uniform), if it doesn't work above.

Getting Started With PeerJS

I am trying the simplest example I can, pulled directly from their website. Here is my entire html file, with code taken exactly from https://peerjs.com/index.html:
<script src="https://unpkg.com/peerjs#1.3.1/dist/peerjs.min.js"></script>
<script>
var peer = new Peer();
var conn = peer.connect('another-peers-id');
// on open will be launch when you successfully connect to PeerServer
conn.on('open', function(){
// here you have conn.id
conn.send('hi!');
});
</script>
In Chrome and Edge I get this in the console:
peerjs.min.js:64 GET https://0.peerjs.com/peerjs/id?ts=15956160926060.016464029424720694 net::ERR_CONNECTION_REFUSED
In Firefox I get this:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://0.peerjs.com/peerjs/id?ts=15956162489620.8436734374800061. (Reason: CORS request did not succeed).
What am I doing wrong?
#reyad has requested "a full trace of requests and responses". Here's what I see in my network tab in Firefox:
And here's Chrome:
And a tiny bit more Chrome:
[Note: It would have been better if you could provide a full trace of requests and responses. This problem may occur for several reasons. I'll state two solutions. So, try those. If those doesn't work, provide full trace of requests and responses.]
1. First Solution:
Sometimes, this type of error occurs because of self-signed certificate. To solve this problem, open developer tools/options, then go to network tab. You'll see a list of requests. Select the request which was failed because of CORS(i.e. which gave you this Reason: CORS request did not succeed). Open it(i.e. click it). If your problem is related to cert you'll see the following error message:
AN ERROR OCCURED: SEC_ERROR_INADEQUATE_KEY_USAGE
To solve this problem, go to url that is the reason of this problem and accept the certificate manually.
2. Second solution:
Check the request(which is the reason of CORS) in the network tab of developers tools/options(same as described in 1. First Solution). You'll find a Transferred column. See, what's written in the Transferred column of the failed request. If it is written Blocked By Some Ad-Blocker, then disable the Ad-Blocker. Your request will work fine.
[P.S.]: These solutions are proposed on assumptions. Hope these works. If these two do not work, then please provide more info about requests and responses. And also check this.
3. Third and final solution:
[Note: This solution may not solve your problem directly, but it'll give you alternative solution and also insight about what your problem is and how to work around it]
Before reading the solution below, read this to understand how Access-Control-Allow-Origin works(it is the reason for CORS error).
Let me first explain how peerjs works:
PEERJS works based on PEER ID. So, you've to get some PEER ID either from the PEERJS CLOUD SERVER or you've to provide yourself one in the PEER CONSTRUCTOR i.e. new Peer("some-peer-id"). Peer id has to be unique, cause its necessary to detect all the users uniquely. And, peerjs uses this PEER ID to send and receive data from user to user.
Now, you should know that, you're using PEERJS CLOUD SERVER to get/generate unique peer id which is the default server PEERJS uses unless you specified some other server to use.
Now let me explain why you're facing this problem:
As you already know how CORS works, you may have already guessed, that https://unpkg.com/peerjs#1.3.1/dist/peerjs.min.js(the downloaded js file) is calling https://0.peerjs.com to retrieve/generate new unique PEER ID. But, this request by https://your.website.com does not have Access-Control-Allow-Origin access for some reason, it may also be a middleware problem. So, its difficult to tell where the problem is actually occuring. But one thing for sure, it's not your fault of writing code :D.
I hope all the concepts is clear to you I've stated above.
Now, to solutions:
Alternative-appraoch-1 (Using PEERJS CLOUD SERVER AND Your own provided id):
In this approach you've to generate your own unique PEER ID. So, "https://your.website.com" does not have to call "https://0.peerjs.com" for unique peer id. [Note: make your peer id large enough so that its always unique, at least 64 chars long]
In this way, you can avoid the CORS problem.
Update:
I just saw an new issue in github, which says the public peerjs cloud server is now unstable or does not work properly. It just gives error like: Firefox cannot establish a connection with the server at the address wss://0.peerjs.com/peerjs?key=peerjs&id=123222589562487856955685485555&token=ocyxworx62i and in Chrome: Error in connection establishment: net::ERR_CONNECTION_REFUSED. For details check here. So, its better, you use your own server(see the next approach).
Alternative-appraoch-2 (Using your own peerjs server):
You can host your own peerjs server instead of PEERJS CLOUD SERVER. In this way, you can allow access to anyone/any website you want. If you want know how to host a peerjs server, you may visit here.
[P.S.]: I have studied pearjs issues in github. After reading all those issues, it seems, it is better to use your own server rather than using pearjs cloud. There are a lot of various problems with each new release of peerjs. And mostly related with connection with peerjs cloud and also peerjs cloud is not stable I guess. They were hosting it in 0.peerjs.com:9000 before(not secure). But now in 0.peerjs.com:443.
I haven't use peerjs before nor set up peerjs server. If you want to set up one, I hope the community would be able help you on how to do that properly.
What I understand from your question is that there is an issue of (CORS => Cross-origin resource sharing ), Maybe what I am suggesting is not very intuitive.
First : download the "https://unpkg.com/peerjs#1.3.1/dist/peerjs.min.js" in your local directory . and then incklude the local javascript code to the html.
like: <script src="./peerjs.min.js"></script>
Second :
you are using var peer = new Peer();
but please provide an extra unique id from your side. for example, I just created a random id and provided it.
StackOverflow link: https://stackoverflow.com/questions/21216758/peerjs-set-your-own-peerid#:~:text=1%20Answer&text=Provide%20a%20peer%20id%20when,to%20under%20Create%20a%20peer.
var a_random_id = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
var peer = new Peer(a_random_id, {key: 'myapikey'});
Third : the best option is to run PeerServer: A server for PeerJS of your own.
If you don't want to develop anything, just enter a few commands below.
Install the package globally:
$ npm install peer -g
Run the server:
$ peerjs --port 9000 --key peerjs --path /myapp
Started PeerServer on ::, port: 9000, path: /myapp (v. 0.3.2)
Check it: http://127.0.0.1:9000/myapp It should return JSON with name, description, and website fields.
details:https://github.com/peers/peerjs-server

IBM Watson api.eu-gb.dataplatform.cloud.ibm.com’s server IP address could not be found?

I start learning data science in IBM and I enroll in the course where we had to join in IBM cloud (lite) and then to create Watson studio(lite). I just followed the document and after creating Watson studio (lite) I got this error:
api.eu-gb.dataplatform.cloud.ibm.com’s server IP address could not be found
It prevent me from seing the button "Get start" which I must click on
I tried to see solution but I didn't find anything and also I talked with watson in chatbox you provide support but the solution watson give didn't help me.
Link to course:
https://developer.ibm.com/digitalnation/africa/skills/innovator-predict-employee-turnover-using-ibm-watson-studio/?module=02.03
For more info see my screenshot: "click here" to see the screen shot i take it
Investigation
I am unable to reproduce the issue.
The Watson Studio Instance Dashboard loads successfully for me in the London data center.
I highly suspect that your current web browser settings might be preventing the iframe'd content area from loading.
Suggested Follow-up Actions
(a) Try disabling your Ad blocker and reloading the page (ad blockers are known to block content from loading in iframes).
(b) Try loading the page in a new incognito window (this will disable all browser extensions).
(c) Try loading the page in another web browser (e.g. Firefox, Edge, Safari).
(d) Try clearing your cookies for the cloud.ibm.com domain and reloading the page.
(e) In your web browser, type Control+Shift+J (on Windows) or Command+Option+J (on Mac) to open the Developer Tools and take a screenshot of any errors you see in the Console tab (and post it back here).
Reference: https://developers.google.com/web/tools/chrome-devtools/shortcuts
(f) Try visiting the direct URL below to see if the page loads.
Direct URL
https://api.eu-gb.dataplatform.cloud.ibm.com/dsx-service-broker/ui/console?plan_id=40073cbd-2d60-4a65-a32d-3b1d11794cc6
Work-around
Go directly to the Watson Studio Registration Page (which is the URL for the Get Started button)
https://eu-gb.dataplatform.cloud.ibm.com/registration/steptwo?redirectIfAccountExists=True&apps=watson_studio
Can you run dig api.eu-gb.dataplatform.cloud.ibm.com or nslookup api.eu-gb.dataplatform.cloud.ibm.com? I am guessing its an issue with your DNS provider on your current network. Can you try another network or wifi connection? For reference here is the nslookup I just did with it.
nslookup api.eu-gb.dataplatform.cloud.ibm.com
Server: 10.xxx.xxx.xxx
Address: 10.xxx.xxx.xxx#53
Non-authoritative answer:
api.eu-gb.dataplatform.cloud.ibm.com canonical name = api.watson-data-prod-lon.eu-gb.containers.appdomain.cloud.
api.watson-data-prod-lon.eu-gb.containers.appdomain.cloud canonical name = watson-data-prod-lon.eu-gb.containers.appdomain.cloud.
Name: watson-data-prod-lon.eu-gb.containers.appdomain.cloud
Address: 158.175.100.214
Name: watson-data-prod-lon.eu-gb.containers.appdomain.cloud
Address: 158.176.125.222
Name: watson-data-prod-lon.eu-gb.containers.appdomain.cloud
Address: 141.125.66.126
try using vpn supporting browser like opera it worked with me since I'm from Egypt and had the same error

"no such host" mesage while site is deployed on moovapp.com domain

I have done a sample project based on blog.moovdemos.com to test the moovweb solution.
After testing it on on local system I deployed the project on moovweb cloud. I have learnt that one need to own the domain to be able to access it from internet. However, as per documentation, it is still available within moovapp.com domain.
While I am trying to access my site through moovapp.com domain I get moovweb warning page as below
Warning: the webpage you are attempting to access is a Moovweb
Remixed™ version of mshruthijanardhan14047.blog.moovdemos.com. Should
you choose to continue, Moovweb is not responsible for the contents of
this webpage.
[Agree and continue] [Decline]
However, on chossing [Agree and continue] I get following message instead of site page
Failed to establish a connection with upstream (dial tcp: lookup
[muser1234].blog.moovdemos.com: no such host)
please help me what is wrong here?
It looks like you have a misconfigured config.json file in your project.
On the right-hand side of the first "host_map" value, you will need to put the upstream domain 'blog.moovdemos.com'. You currently have it set to [muser1234].blog.moovdemos.com. This domain does not exist; that is why you are getting the "dial tcp: lookup ... no such host" error.
The correct setting should look like:
"host_map": [
"$.blog.moovdemos.com => blog.moovdemos.com"
]
Hope that helps.

Trouble adding a new service

I have followed the instructions at https://github.com/cloudfoundry/oss-docs/tree/master/vcap/adding_a_system_service and copied the echo service and created my new service. (That document is somewhat out-of-date in that "excluded components" no longer exists.
In any case, my service shows up as running with a gateway and a node when I look at 'vcap status' on the server. However, when I look at 'vmc services' from the client my service is not in the list. Where is this list maintained and why is my service not on the list?
Various services, including blob, filesystem, mongodb, etc, are shown on the 'vcm services' list even though they have never been included in my config. Where is this maintained and why are other services on this list?
The cloud_controller.log file shows a "Create service request:" for echo every minute. This service is not in my config file (it was once but it was removed and I repeated the deployment). What is prompting this request for a service that was not defined in the config?
The _gateway.log for my service shows the following:
INFO -- Sending info to cloud controller: ...api.vcap.me/services/v1/offerings
INFO -- Fetching handles from cloud controller .../offerings/.../handles
ERROR -- Failed registering with cloud controller, status=400
DEBUG -- [GaaS-Provisioner] Connected to node mbus..
ERROR -- Failed fetching handles, status=404
Why does my gateway fail to register with the cloud controller? I have found some reports that suggest that the problem is with domain name mapping. I have verified that the server can find itself:
$curl api.vcap.me
Welcome to VMware's Cloud Application Platform
What can I do to register my service?
You can also try asking your question on the vcap_dev google group.
https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups#!forum/vcap-dev
They are focused in answering and discussing OSS subjects for Cloud Foundry!
If you follow the document correctly things should work just fine. I understand that the mechanism for maintaining the excluded list of components has changed and can be a point of confusion when following the steps mentioned in the article (just ignore that step totally).
ERROR -- Failed registering with cloud controller, status=400
Well this is a point of worry. I recently followed the article step by step and was able to add a new service.
Is the echo service showing up in vmc services?
Have you copied the the yml files for node and gateway at ./cloudfoundry/.deployments/devbox/config?
Are the tokens for your gateway unique? and matching in the two files? ./cloudfoundry/.deployments/devbox/config/cloud_controller.yml and ./cloudfoundry/.deployments/devbox/config/**_gateway.yml**
I would recommend that you first concentrate on getting the echo service to be listed in the vmc services output. Once done with this you should replicate the steps (with absolute care to modify things like the token) to get your custom service working.
Cheers,
Ankit
You should follow this guide
It work to me.
regards.