I am building a hybrid mobile app (Cordova) and I am trying to run my build on iOS.
I have followed the steps in this documentation to setup my connected Mac and I can see that the Mac terminal responding when I try to build my code in visual studio.
My issue is that when ever I enable the remote build server using remotebuild --secure false I get the following error in visual studio output(notice that the terminal is responding to the build request from visual studio but then fails with errors):
Non-secure connection to http://192.168.1.10:3000/cordova could not be established. Verify that the build server is not running in secure mode.
And here is the Mac terminal activity with and output:
Last login: Tue Aug 18 19:31:21 on ttys001
IBRAHIM-ALHUSSAINs-Mac-mini:~ IBRAHIMALHUSSAIN$ remotebuild --secure false
remotebuild
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
1.0.1
Warning: No server modules selected. Defaulting to configuration "modules": {"taco-remote": { "mountPath": "cordova"} }
Build Retention initialized with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds, maxBuildsToKeep 20
Initialized BuildManager with baseBuildDir /Users/IBRAHIMALHUSSAIN/.taco_home/remote-builds/taco-remote/builds; maxBuildsInQueue 10; deleteBuildsOnShutdown true; allowsEmulate true; nextBuildNumber 423
Remote build server listening on [http] port 3000
express deprecated req.host: Use req.hostname instead ../../usr/local/lib/node_modules/remotebuild/lib/server.js:257:81
GET /modules/taco-remote 200 14.494 ms - 7
New build request submitted:
/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn
{ 'accept-language': 'en-US',
host: '192.168.1.10:3000',
connection: 'close',
'transfer-encoding': 'chunked' }
POST /cordova/build/tasks?command=build&vcordova=4.3.0&cfg=debug&loglevel=warn - - ms - -
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "taco-remote-multiplexer"
npm ERR! node v0.12.4
npm ERR! npm v2.13.4
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /Users/IBRAHIMALHUSSAIN/.taco_home/node_modules/taco-remote-multiplexer/latest/npm-debug.log
I remember reading somewhere that I should enable secure build once then disable it in order to initialize the remote server security configuration. Whenever I try to run in secure build mode remotebuild I would get this error:
Secure connection to https://192.168.1.10:3000/cordova could not be established. Verify that the build server is running in secure mode.
I have also attempted to resolve this issue by recreating PIN, generating and resetting the certificate.
How can I resolve this issue?
From the console output that you've included there, it looks like your mac can't access the npm repository:
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
The line stating
New build request submitted
indicates that visual studio has successfully connected to the remotebuild server and has sent over a project to be built. As part of building a project, remotebuild dynamically acquires some npm packages to make sure that it is future proof and can work with multiple different versions of Cordova.
If you are unable or unwilling to let your mac see the npm repository, then it is possible to provide your own substitute function that determines what package to load to actually build the project.
I strongly recommend against doing this, but here is the simplest way to remove the functionality:
On a machine with access to npm, "npm install taco-remote-lib" to download the default package that performs cordova builds for remotebuild, then within that "npm install cordova#<version>" for the single version you intend to use. Open up taco-remote-lib/ios/iosBuild.js and replace
TacoPackageLoader.lazyRequire("cordova", "cordova#" + cordovaVersion, buildInfo.logLevle).done(function pkg) {
cordova = pkg;
with
cordova = require("cordova");
and remove the "}, function (err) { [...] })" at the end of the function you removed.
Copy the whole taco-remote-lib folder onto the mac, as it is now a self-contained instance which is specialised to a particular cordova version
Create a new js file somewhere "myRedirector.js", and give it contents similar to the following:
.
module.exports.getPackageToServeRequest = function (request) {
return require("/path/to/copied/taco-remote-lib");
}
Create a configuration file that looks something like the following:
.
{
"modules": {
"taco-remote": {
"requirePath": "taco-remote",
"mountPath": "cordova",
"redirector": "/path/to/myRedirector.js",
}
}
}
Start remotebuild by running "remotebuild --config path/to/the/config.json"
This should start remotebuild with a custom request redirector that uses your custom modified taco-remote-lib package to build all requests.
This will not respect the version of cordova that VS specifies for builds, since that requires the ability to download those versions from NPM on demand.
perhaps because of OS have Sandbox system
In my case I had "'" in my mac's name. It did connect by host name once I removed "'".
Related
I have a Ubuntu server running Apache Tomcat with SSL for a domain (e.g abc.xyz). In that server, I also set up Docker for deploying Next.js. However, when I build a container for a demo application, it shows error:
npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! request to https://registry.npmjs.org/#types%2fnode failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.npmjs.org. is not in the cert's altnames: DNS:*.abc.xyz, DNS:abc.xyz
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-11-06T15_27_49_018Z-debug.log
I tried many solutions like setting strict-ssl=false, setting registry (you can see it in my repository), changing DNS nameserver to OpenDNS but they don't work.
I also tried to run command npm install outside Docker and it still works.
Repository URL here.
Updated: This error doesn't occur not only in Nodejs but also in Java. I built a Dockerfile that contains RUN mvn package and it shows the same error
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6:
Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom:
Certificate for <repo.maven.apache.org> doesn't match any of the subject alternative names: [*.abc.xyz, abc.xyz] -> [Help 1]
When I create a brand new create-react-app and run the command yarn add electron --dev I get the following error.
RequestError: unable to get local issuer certificate
at ClientRequest.<anonymous> (C:\my-stuff\create-react-test\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:520:26)
at ClientRequest.emit (events.js:412:35)
at ClientRequest.origin.emit (C:\my-stuff\create-react-test\node_modules\#szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:475:9)
at TLSSocket.emit (events.js:400:28)
The same thing happens with npm and chocolatey and only with electron. This doesn't happen on other computers. I've completely uninstalled node and reinstalled it.
This happens after it finished downloading the module. It is making a ClientRequest to a location on my computer. I don't understand why.
I've searched the internet for days for a solution. I've found the cnpm solution and it does work, but I want my project to be restorable from the git repository using npm install or yarn. Right now it is not. I'd have to remove electron from my package.json, restore, add it back and call the cnpm command.
npm config set strict-ssl false <- This command does not help.
I've tried separately installing got and #szmarczak\http-timer. This did not help.
I know it's old question but if anyone is facing this issue try running yarn config set enableStrictSsl false
This question already has answers here:
Network calls fail during image build on corporate network
(9 answers)
Closed 3 years ago.
I am trying to run fabcar sample using javascript chaincode,it fails with the following error while instantiating the chaincode
error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/fabric-shim failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
please help me regarding this...
It is happenning for all fabric samples whenever i try to run in javascript/typescript
thanks in advance
When you instantiate a Javascript Smart Contract the Fabric creates a chaincode container and installs your Javascript contract (or sample) AND all the npm dependencies. This means that an npm registry with those modules must be accessible.
I suspect that you are behind a corporate proxy/firewall, or working in a region where there is no direct access to npm. On your host machine you probably have a .npmrc file which helps with the proxy, and you need to replicate that for the chaincode.
I think you need to place the .npmrc file in the root folder of your Smart Contract project - i.e. in the same folder as the package.json file.
I have developed a small "proof of concept" ApostropheCMS application. The application runs fine with node app.js. I'm trying to build and deploy with Docker for Windows on Windows 7 with Oracle VM VirtualBox following this tutorial.
I am able to deploy the mongo image. I am able to build my application image using the default Dockerfile. When I attempt to run my application, docker image linked with the mongo image I receive the following error:
$ docker run --link=ato-home-db:mongodb -p 3000:3000 ato-home-webapp
ato-home-webapp#2.0.0 start /app node app.js fs.js:1014 return
binding.symlink(preprocessSymlinkDestination(target, type, path),
^ Error: EEXIST: file already exists, symlink '/app/node_modules/apostrophe/lib/modules/apostrophe-assets/public' ->
'/app/public/modules/apostrophe-assets'
at Object.fs.symlinkSync (fs.js:1014:18)
at Object.self.linkAssetFolderOnUnix (/app/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:646:10)
at Object.self.linkAssetFolder (/app/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:612:14)
at /app/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:578:14
at /app/node_modules/#sailshq/lodash/lib/index.js:3253:15
at baseForOwn (/app/node_modules/#sailshq/lodash/lib/index.js:2223:14)
at /app/node_modules/#sailshq/lodash/lib/index.js:3223:18
at Function. (/app/node_modules/#sailshq/lodash/lib/index.js:3526:13)
at self.symlinkModules (/app/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:574:9)
at /app/node_modules/async/lib/async.js:718:13
at iterate (/app/node_modules/async/lib/async.js:262:13)
at async.forEachOfSeries.async.eachOfSeries (/app/node_modules/async/lib/async.js:281:9)
at _parallel (/app/node_modules/async/lib/async.js:717:9)
at Object.async.series (/app/node_modules/async/lib/async.js:739:9)
at Object.self.afterInit (/app/node_modules/apostrophe/lib/modules/apostrophe-assets/index.js:521:20)
at invoke (/app/node_modules/apostrophe/index.js:423:23) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ato-home-webapp#2.0.0 start:
node app.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
ato-home-webapp#2.0.0 start script. npm ERR! This is probably not a
problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR!
/root/.npm/_logs/2018-08-07T00_15_24_396Z-debug.log
I'm hoping for a possible solution or suggestions for ApostropheCMS tutorials or "How Tos" to get past this roadblock.
I am new to ApostropheCMS and Docker. Any input would be greatly appreciated. I can supply additional information if helpful.
I'm going to assume that you're building your image on Windows (to a Linux container). Please try rebuilding your image in a Unix environment.
I have installed all required software by following this document http://go.microsoft.com/fwlink/?LinkID=397716
And successfully installed the vs-mda-remote on my Mac.
When trying to run this command: vs-mda-remote --buildDir .
The system prompts: -bash: vs-mda-remote : command not found
I tried to close the Terminal, and even rebooted the Mac, the problem persists.
Update
cd into the vs-mda-remote and run: bin/vs-mda-remote --buildDir xxx works for me.
However, when I was trying to verify the Agent, using vs-mda-remote test, I got an error
BP13s-MacBook-Pro-3:vs-mda-remote mbp13$ bin/vs-mda-remote test Server: http://localhost:3000 buildUrl: http://localhost:3000/build/tasks?vcordova=3.4.1-0.1.0&cfg=release&command=build&options=--emulator
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (/usr/local/share/npm/lib/node_modules/vs-mda-remote/test/selftest.js:64:56)
at self.callback (/usr/local/share/npm/lib/node_modules/vs-mda-remote/node_modules/request/request.js:121:22)
at Request.EventEmitter.emit (events.js:117:20)
at ClientRequest.self.clientErrorHandler (/usr/local/share/npm/lib/node_modules/vs-mda-remote/node_modules/request/request.js:230:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:419:13)
I've seen this error:
TypeError: Cannot read property 'statusCode' of undefined
Make sure you are running the build agent in another Terminal window.
I had the same problem, not sure if it's related to me updating to cordova 4.0.0, using CTP3 of apache cordova tools?
What I had to do to make the vs-mda-remote -test work, was to start with secure set to false:
vs-mda-remote --secure false
and then I had to modify the selftest.js file since this by default tries to access via https. To do this go to:
/usr/local/share/npm/lib/node_modules/vs-mda-remote/test/selftest.js then at line 27 change it so it says:
default('server', 'http://' + os.hostname() + ':3000').
And then re-run:
vs-mda-remote -test
in a separate terminal window and it should work.