Cannot generate new REST datasource with Strongloop - express

I'm new to Loopback, was following this page here: https://docs.strongloop.com/display/public/LB/REST+connector
$ npm install loopback-connector-rest --save
$ slc loopback:datasource
? Enter the data-source name: testrestDS
? Select the connector ...
> REST Services (supported by StrongLoop)
And then I get this error:
events.js:154
throw er; // Unhandled 'error' event
^
TypeError: Cannot set property 'facetName' of undefined
at exports._extend (util.js:770:21)
at module.exports.yeoman.generators.Base.extend.dataSource (/usr/lib/node_modules/strongloop/node_modules/generator-loopback/datasource/index.js:169:18)
at /usr/lib/node_modules/strongloop/node_modules/yeoman-generator/lib/base.js:430:16
at processImmediate [as _immediateCallback] (timers.js:383:17)
I've tried a couple other connector types in the generator and they work (like Mongo even though I don't have that connector installed).
Ubuntu 14.04 64-bit
node v5.7.1
npm v3.6.0
slc v6.0.0
loopback v2.27.0
loopback-connector-rest v1.10.2

I got the same error on my command line, but not in my Docker container based on the strongloop/node image.
In both cases strongloop v6.0.0 but on different versions of node (v0.10.25 versus v0.10.38 in the Docker container) with a different version of generator-loopback (1.16.2 versus 1.20.5 in the Docker container).
I suspect that you need to upgrade to resolve this issue.

Related

Command PhaseScriptExecution failed with a nonzero exit code. Bugsnag source map upload connection timed out

I am trying to white label this github repo.
https://github.com/RocketChat
Here is the white label guide that the RocketChat has provided.
https://developer.rocket.chat/mobile-app/mobile-app-white-labelling/ios-app-white-labelling
This library is for react native. I am facing this issue when I try to run the project.
The project is failing the build process with this error.
> PhaseScriptExecution Upload\ source\ maps\ to\ Bugsnag
> /Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Intermediates.noindex/RocketChatRN.build/Debug-iphoneos/RocketChatRN.build/Script-88055964DAAE45B1A4886C27.sh
> (in target 'RocketChatRN' from project 'RocketChatRN')
> cd /Users/macbook/Rocket.Chat.ReactNative-develop/ios
> /bin/sh -c /Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Intermediates.noindex/RocketChatRN.build/Debug-iphoneos/RocketChatRN.build/Script-88055964DAAE45B1A4886C27.sh
>
> ℹ Preparing upload of React Native source map (dev / ios) › Reading
> source map
> "/var/folders/sz/jj5jd6j54kd505vxsyxvlk1h0000gn/T//bcd7e9d7452d009ff844f5acf22fb2f3-main.jsbundle.map"
> › Reading bundle file
> "/Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Products/Debug-iphoneos/main.jsbundle"
> ℹ Applying transformations to source map › Ensuring sourcesContent
> field is populated › Stripping project root from sources › Initiating
> upload to "https://upload.bugsnag.com/react-native-source-map"
ERROR The request timed out.
Connection timed out
at ClientRequest.<anonymous> (/Users/macbook/Rocket.Chat.ReactNative-develop/node_modules/#bugsnag/source-maps/dist/Request.js:190:21)
at Object.onceWrapper (node:events:641:28)
at ClientRequest.emit (node:events:527:28)
at TLSSocket.emitRequestTimeout (node:_http_client:771:9)
at Object.onceWrapper (node:events:641:28)
at TLSSocket.emit (node:events:539:35)
at TLSSocket.Socket._onTimeout (node:net:516:8)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
I have tried to remove the source map upload. See Screen Shot 1
It keeps on giving the same error still.
It says bugsnag source map failed to upload and is timing out. I have no prior experience with React Native and I am just trying to white label their code. So any help will be appreciated.
Would you be able to check your package.json file for which version of #bugsnag/source-maps you are using? If you are using anything prior to v2.3.0 of #bugsnag/source-maps you could try updating as it has now increased the default timeout and made some other improvements.
Try this, (M1 Mac only I guess)
Go to the target you want to archive
Build settings ---> Architectures ---> Excluded Architectures
Delete arm64
Also another possible reason could be that Xcode is using an outdated version of Node
By default, Xcode will use the Node binary located at /usr/local/bin/node. Check its version by running:
/usr/local/bin/node -v
node -v
If the first command outputs an older version of Node, simply delete it and replace it with a symlink to the newer one:
rm -rf /usr/local/bin/node
ln -s $(which node) /usr/local/bin/node

Hyperledger Fabric error: "TLS: bad certificate server" when installing chaincode

I'm just starting learning HLF, and I have an error while following tutorial from the docs: link
I downloaded fabric-samples using this command (replaced bit.ly link with the destination):
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s -- 2.2.2 1.4.9
I run logspout in one terminal and try to execute peer lifecycle chaincode install basic.tar.gz in another one, and this is the result i get
Error: failed to retrieve endorser client for install: endorser client
failed to connect to localhost:7051: failed to create new connection:
context deadline exceeded
Log presented by Logspout:
peer0.org1.example.com|2022-03-15 13:03:24.452 UTC [core.comm]
ServerHandshake -> ERRO 04a Server TLS handshake failed in 2.650245ms
with error remote error: tls: bad certificate server=PeerServer
remoteaddress=172.22.0.1:61126
I set the envs in terminal as instructed in the docs, and I checked that CORE_PEER_TLS_ROOTCERT_FILE variable points to an existing file. The content of the file is the same as on the container.
What I tried to do:
download fabric-samples again and redo all the setup with copy-pasting the commands directly from docs
Do you have any suggestions where I can look for an issue?
I resolved the problem, I was using peer version 2.2.1 from previous experiments, it probably collided with FABRIC_CFG_PATH

Onlyoffice integrate into nextcloud. Error while downloading the document file to be converted

I had already looked around, but this couldn't solve my problem. I installed onlyoffice documents on another server.now i would like to use the addon in nextcloud. When I enter the serverip in Nextcloud, I get the following error:
Error while downloading the document file to be converted
in the nextcloud config i also have " 'onlyoffice' =>array (
verify_peer_off' => TRUE,
)
" added.
Called up via healthcheck I get a positive result.
here is an excerpt from the log of the converter:
[2019-08-29T16:29:49.962] [WARN] nodeJS - worker 11687 started.
[2019-08-29T16:29:49.963] [WARN] nodeJS - update cluster with 1 workers
[2019-08-29T16:40:12.293] [ERROR] nodeJS - error downloadFile:url=https://next.mydomain.xx/apps/onlyoffice/empty?doc=eyJ0eXAiOiJxyzv4oPYyTYdvdZNgMz$
Error: Parse Error
at TLSSocket.socketOnData (_http_client.js:454:20)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:601:20)
i am very happy to suggest solutions
The reason is that next.mydomain.xx cannot be validated by DocumentServer.
You can disable certificate verification in DS config
/etc/onlyoffice/documentserver/default.json by setting rejectUnauthorized to false. After that, you need to restart DS services: supervisorctl restart all
If that doesn't help, specify the version, OS and installation type of the DocumentServer.

NightWatch Selenium Socket Hangup in Jenkins / Ubuntu16

Issue :
We are running NightWatch tests in Jenkins, and once in a while, we get this error :
[0;31mConnection refused! Is selenium server started?
[0m[0;90m{ Error: socket hang up
at createHangUpError (_http_client.js:253:15)
at Socket.socketCloseListener (_http_client.js:285:23)
at emitOne (events.js:101:20)
at Socket.emit (events.js:188:7)
at TCP._handle.close [as _onclose] (net.js:501:12) code: 'ECONNRESET' }[0m
The fix recommended in other places is already there :
export DBUS_SESSION_BUS_ADDRESS=/dev/null
This is how we run the tests :
sudo npm install selenium-standalone -g
selenium-standalone install --version=3.0.1 --baseURL=https://selenium-release.storage.googleapis.com --drivers.chrome.version=2.28 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com --basePath=bin
sudo npm install nightwatch#0.9.13 -g && nightwatch --tag sanity --retries 1 --suiteRetries 1
Rebuilding the job usually run the tests successfully.
Softwares' version:
Chrome : 57
Chrome driver : 2.28
Selenium: 3.0.1
NightWatch : 0.9.13 (bumped down from 0.9.14 in case the latest release had a bug but no change.)
Jenkins : 1.6x
Ubuntu : 16.04
Using xvfb
Error Scenarios
The tests were running fine until about 2 weeks ago, just when we switched to Ubuntu 16, but that day it started happening on Ubuntu 14 too.
It especially happens when we've just spun a new Jenkins slave (on AWS cloud.) Happens more often at the very start of the test run but sometimes it happens in the middle of the run too.
I'll appreciate any help or pointers!
I have the same problem yesterday.
Maybe you can change the version of Chrome.
such as Chrome:55.
when i changed the version of chrome the selenium
We ran into a similar issue, but our error message was more specific:
Selenium is already running on port ####. Or some other service is.
The solution was to use the Jenkins Port Allocator Plugin to assign an available port number to an environment variable.
From there, we were able to set the port number in our globals.js like this (with a default of 4444 for running locally):
portNumber: process.env.PORT_NUMBER || 4444,
In our nightwatch.conf.js file, we used a lodash template to replace values in our nightwatch.json like this:
fs = require('fs'),
_ = require('lodash'),
template = _.template(fs.readFileSync('./nightwatch.json', 'utf8')),
settingsString,
settings;
settingsString = template({
portNumber: globals.portNumber
});
settings = JSON.parse(settingsString);
module.exports = settings;
Finally, in our nightwatch.conf file, we set the values for all port references to:
"<%= portNumber %>"

cloud VM instance broken packages after updating packages to earlier version

I did a apt-get upgrade because the load times of our production server were about 40 seconds. I don't have a snapshot before nor after the upgrade.(Although there is a snapshot of six months old) Load times improved to 15-ish seconds but our erizo service stopped working. Erizo was also running on that instance. Restarting the services didn't help so I tried upgrading the packages to the previous version (https://askubuntu.com/questions/138284/how-to-downgrade-a-package-via-apt-get), just like it was but on almost every package there was an error: the previous package version did not excist.(which is strange, because I copied the output of dpkg -l)
Only a few of them were successfully downgraded but I got a serious error when upgrading e1fslibs to it's previous version.:The following packages have unmet dependencies:
e2fsprogs: PreDepends: e2fslibs
Somehow that messed up initramfs and/or initramfs-tools and now the instance is running but I can't get into it.
Connecting to the instance in google cloud platform :Connecting...
Could not connect, retrying (1/3).
google cloud shell isn't able to gcloud compute ssh : Permission denied (publickey).
using gcloud locally also says Permission denied (publickey).
I checked the following:
There are project public keys defined; there aren't any instance public keys defined or any other metadata ( Google Cloud SSH Keys )
In google cloud platform >> compute engine >> VM instances >> permissions>> I see 'compute' is disabled
verify that the daemon is running by navigating to the serial console output page and looking for output lines prefixed with the accounts-from-metadata: string. If you are using a standard image but you do not see these output prefixes in the serial console output, the daemon might be stopped--> I don't see this so I expect it's NOT running.
check firewall rules:(gcloud compute firewall-rules list)
default-allow-ssh default 0.0.0.0/0 tcp:22 //rule is present
Following packages were upgraded:
apt
apt-transport-https
apt-utils
binutils
cloud-init
cloud-initramfs-growroot
cloud-initramfs-rescuevol
comerr-dev
dosfstools
e2fslibs
e2fsprogs
gce-cloud-config
gce-daemon
gce-imagebundle
gce-startup-scripts
google-cloud-sdk
landscape-client
landscape-common l
ibapt-inst1.4 libapt-pkg4.12
libcomerr2
libss2
libudev0 mountall
nginx
nginx-common
nginx-full
ntp
ntpdate
procps
python-apt
python-apt-common
python-lazr.restfulclient
udev
unattended-upgrades
update-manager-core
upstart
whoopsie
x11-utils
This is get from the serial output ::
- mountall: Event failed
- landscape-client is not configured, please run landscape-config.
What to do next?
Apply a startup script to running instance (following this https://cloud.google.com/compute/docs/startupscript) and try to perform Apt-get upgrade ?
try to create a new public key (again) in google cloud shell to access the instance?
In google cloud shell the first time this file was generated after typing gcloud compute --project "enduring-palace-762" ssh --zone "europe-west1-c" "tta-media-test-2"
WARNING: The private SSH key file for Google Compute Engine does not exist.WARNING: You do not have an SSH key for Google Compute Engine.WARNING: [/usr/bin/ssh-keygen] will be executed to generate a key. This tool needs to create the directory /home/developer/.ssh
the generated public key was stored in /home/developer/.ssh /google_compute_engine.pub I made a copy of that, prepended the username and added the content of the public key to compute engine >> metadata>>ssh keys. *key is accepted but the username doesn't show like it does with all the other username - key pairs
I get Permission denied (publickey) error though when using gcloud compute ssh tta-media-test-2 --zone europe-west1-c
When I provide the ssh key file like this
gcloud compute ssh tta-media-test-2 --zone europe-west1-c --ssh-key-file=my-ssh-keys_copy.pub (pwd is inside the folder where key file is)
WARNING: The public SSH key file for Google Compute Engine does not exist.
WARNING: You do not have an SSH key for Google Compute Engine.
WARNING: [/usr/bin/ssh-keygen] will be executed to generate a key.
I get same result when i generate a new key with ssh-keygen -t rsa -f my-ssh-keys
Any other possible solution would be much appreciated.
[update] I am able to ssh the 'broken' instance from local using ssh user#externalIpOfInstance My plan is to bring it to a upgraded stable state, create a snapshot and see from there..
sudo apt-get -f install
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.99ubuntu13.5) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.13.0-79-generic
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.13.0-79-generic with 1.
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
google-chrome-stable
The following packages will be upgraded:
comerr-dev libcomerr2 libss2 unattended-upgrades
4 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/188 kB of archives.
After this operation, 4,096 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
(Reading database ... 178509 files and directories currently installed.)
Preparing to replace comerr-dev 2.1-1.42-1ubuntu2.2 (using .../comerr-dev_2.1-1.42-1ubuntu2.3_amd64.deb) ...
Unpacking replacement comerr-dev ...
Preparing to replace libcomerr2 1.42-1ubuntu2.2 (using .../libcomerr2_1.42-1ubuntu2.3_amd64.deb) ...
Unpacking replacement libcomerr2 ...
Preparing to replace libss2 1.42-1ubuntu2.2 (using .../libss2_1.42-1ubuntu2.3_amd64.deb) ...
Unpacking replacement libss2 ...
Preparing to replace unattended-upgrades 0.76ubuntu1.1 (using .../unattended-upgrades_0.76ubuntu1.2_all.deb) ...
Unpacking replacement unattended-upgrades ...
Processing triggers for install-info ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up initramfs-tools (0.99ubuntu13.5) ...
update-initramfs: deferring update (trigger activated)
Setting up libcomerr2 (1.42-1ubuntu2.3) ...
Setting up comerr-dev (2.1-1.42-1ubuntu2.3) ...
Setting up libss2 (1.42-1ubuntu2.3) ...
Setting up unattended-upgrades (0.76ubuntu1.2) ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.13.0-79-generic
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.13.0-79-generic with 1.
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get remove initramfs-tools-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
cron : Depends: adduser but it is not going to be installed
procps : Depends: initscripts
upstart : Depends: initscripts
Depends: mountall
Depends: ifupdown (>= 0.6.10ubuntu5)
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
what to do here?
If you were able to SSH into the instance using a given SSH key before, the most likely reason it would stop working is if you somehow removed that SSH key or if the SSH daemon wasn't running/was otherwise broken. It appears as though in the downgrade you broke this machine.
Why do you need this particular VM instance? Does it have important data? If so, you can shut it off, mount its disk using a fresh VM instance, and copy that data off.
If it runs a service, you should probably cut over to a new machine: even if you're able to get into the instance, there's no telling what still works and what doesn't.
i'm facing issue in bigbluebutton insatllation
Reading state information...
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
bigbluebutton : Depends: bbb-config but it is not going to be installed
gce-compute-image-packages : Depends: google-compute-engine but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).