SSL error when creating vue.js app using api platform client generator - homestead

I tried to create client app of my API created using API Platform. I follow this guide https://api-platform.com/docs/client-generator/vuejs/.
I use Laravel Homestead for the VM when developing it.
I've added myapp .crt file to Keychan Access.
Problem was, when I try to execute
generate-api-platform-client --generator vue https://myapp-api.local/api src/
It return error message like this:
{
api: Api { entrypoint: 'https://myapp-api.local/api', resources: [] },
error: FetchError: request to https://myapp-api.local/api failed, reason: unable to verify the first certificate
at ClientRequest.<anonymous> (/Users/permana.jayanta/.config/yarn/global/node_modules/node-fetch/index.js:133:11)
at ClientRequest.emit (events.js:209:13)
at TLSSocket.socketErrorListener (_http_client.js:406:9)
at TLSSocket.emit (events.js:209:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
name: 'FetchError',
message: 'request to https://myapp-api.local/api failed, reason: unable to verify the first certificate',
type: 'system',
errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
},
response: undefined,
status: undefined
}
I'm thinking this is related with SSL certificate. That node doesn't recognise the certificate. How to make node.js recognise the custom SSL certificate generated by Homestead?

it failed to verify https signature.
To disable it, type in shell
export NODE_TLS_REJECT_UNAUTHORIZED=0

Related

Symfony messenger install for mailer: PHP Warning: PHP Startup: Unable to load dynamic library 'amqp.so'

When I run composer require symfony/mailer
I have this screen:
If you want to send emails asynchronously:
1. Install the messenger component by running composer require messenger;
2. Add 'Symfony\Component\Mailer\Messenger\SendEmailMessage': amqp to the
config/packages/messenger.yaml file under framework.messenger.routing
and replace amqp with your transport name of choice.
I run composer require messenger
My config/packages/messenger.yaml:
framework:
messenger:
failure_transport: failed
transports:
# https://symfony.com/doc/current/messenger.html#transport-configuration
async:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
use_notify: true
check_delayed_interval: 60000
retry_strategy:
max_retries: 3
multiplier: 2
failed: 'doctrine://default?queue_name=failed'
# sync: 'sync://'
routing:
#Symfony\Component\Mailer\Messenger\SendEmailMessage: async
Symfony\Component\Mailer\Messenger\SendEmailMessage: amqp
Symfony\Component\Notifier\Message\ChatMessage: async
Symfony\Component\Notifier\Message\SmsMessage: async
# Route your messages to the transports
#'App\Message\YourMessage': async
I have now :
PHP Warning: PHP Startup: Unable to load dynamic library 'amqp.so'
(tried: /usr/lib/php/20200930/amqp.so (/usr/lib/php/20200930/amqp.so:
cannot open shared object file: No such file or directory),
/usr/lib/php/20200930/amqp.so.so (/usr/lib/php/20200930/amqp.so.so:
cannot open shared object file: No such file or directory)) in Unknown on line 0
I tried to install amqp library and I can't use phpize,
I tried to install php-dev and many others, it crashed in all...
I ran sudo apt install php8.1-amqp
and add new error
--show-private options doesn't exist
It be a Bug for VSCode that I 've resolved by change --show-private by --show-hidden in ~/.vscode/extensions/thenouillet.symfony-vscode-1.0.2/out/symfony/provider/ConsoleContainerProvider.js
I don't have error in the VSCode console but I have this one in my deBug Bar of Symfony:
Invalid Messenger routing configuration: the "Symfony\Component\Mailer\Messenger\SendEmailMessage" class is being routed to a sender called "amqp". This is not a valid transport or service id.

I cannot publish a sample app via Ingress.: failed to call webhook

※I am a beginner, so if you have any information you need, please comment.
Based on the yaml file, I am trying to publish a sample app that has already been launched in Pod via Ingress.
$kubectl apply -f ./overlays/stg/bookinfo-ingress.yaml
■Errormessage
Error from server (InternalError): error when creating "./overlays/stg/bookinfo-ingress.yaml": Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": failed to call webhook: Post "https://ingress-nginx-controller-admission.ingress-nginx.svc:443/networking/v1/ingresses?timeout=10s": x509: certificate signed by unknown authority

Send a text message Using FCM and Twilio

I want to send a text message to a particular user's number stored in Firebase Database. For that I have Used FCM and Twilio. My problem is that I got following errors. (Follwed tutorial from https://angularfirebase.com/lessons/sms-texting-with-twilio/)
errrrror { Error: getaddrinfo ENOTFOUND api.twilio.com api.twilio.com:443
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'api.twilio.com',
host: 'api.twilio.com',
port: 443 }
Your country block twilio ,you can use proxy before you send a request to twilio.in english you can deploy your project on a external server in another country

Why does Meteor Up (MUP) fail on authentication?

I am currently trying to deploy a Meteor project to an external server for the first time. The server is hosted by DigitalOcean, running ubuntu 16.04, and has an SSH key set up for password-free access.
The error I am getting from MUP is:
[159.203.165.13] - Setup Docker
events.js:165
throw er; // Unhandled 'error' event
^
Error: All configured authentication methods failed
at tryNextAuth (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/client.js:290:17)
at SSH2Stream.onUSERAUTH_FAILURE (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/client.js:469:5)
at SSH2Stream.emit (events.js:180:13)
at parsePacket (/usr/lib/node_modules/mup/node_modules/ssh2-streams/lib/ssh.js:3647:10)
at SSH2Stream._transform (/usr/lib/node_modules/mup/node_modules/ssh2-streams/lib/ssh.js:551:13)
at SSH2Stream.Transform._read (_stream_transform.js:185:10)
at SSH2Stream._read (/usr/lib/node_modules/mup/node_modules/ssh2-streams/lib/ssh.js:212:15)
at SSH2Stream.Transform._write (_stream_transform.js:173:12)
at doWrite (_stream_writable.js:410:12)
at writeOrBuffer (_stream_writable.js:396:5)
at SSH2Stream.Writable.write (_stream_writable.js:294:11)
at Socket.ondata (_stream_readable.js:651:20)
at Socket.emit (events.js:180:13)
at addChunk (_stream_readable.js:274:12)
at readableAddChunk (_stream_readable.js:261:11)
at Socket.Readable.push (_stream_readable.js:218:10)
Emitted 'error' event at:
at tryNextAuth (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/client.js:292:12)
at SSH2Stream.onUSERAUTH_FAILURE (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/client.js:469:5)
[... lines matching original stack trace ...]
at Socket.Readable.push (_stream_readable.js:218:10)
At this point I have tried several solutions involving the mup file as per other recommendations such as:
1) Adding in a password - Gives the exact same error as though the change didn't occur.
2) Adding in the same SSH key that I use for authentication to the server as per digital ocean - Says 'privateKey value does not contain a (valid) private key'. I have tried both the key that is used for authentication to the server and every other key I could find short of generating a new one just for Meteor's use.
3) Leaving both blank and allowing it to 'try' ssh-agent - pretends it doesn't know what ssh-agent is and throws an error saying the same thing as when I use a password.
I have looked through and followed the same instructions in the following article: http://meteortips.com/deployment-tutorial/digitalocean-part-1/
This article assumes that there are only two possible states. One being that an ssh key has NOT been used or set up so it needs to be generated. The second being that an ssh key exists and is set up exactly where they expect it. Unfortunately I seem to be in a different situation. I generated a key using putty prior to setting up the D.O server and created the droplet using that. After creation, the file did not exist. The only thing in the ~/.ssh/ directory was a single file named "authorized_keys" that held the key I would use to connect to the server. This file cannot be used, nor any file on the server in the other ssh key locations.I also tried copying over the file directly onto the server to no avail as well.
In some vain hope at finding a solution I also tried running these same commands in both the Meteor build bundle an the source code folder. Neither worked. I should mention that although this is the only article I still have open to try for a solution, I have tried every one I could find using MUP.
If anyone can point me in the right direction with this so I can stop flailing wildly in the dark I would be incredibly grateful.
Edit: As requested, below is the current mup.js file with removed credentials
module.exports = {
servers: {
one: {
// TODO: set host address, username, and authentication method
host: '111.111.111.11',
username: 'root',
// ssh-agent: '/home/Meteor/MeteorKey.pem'
pem: '~/.ssh/id_rsa.pub'
// password: 'password1'
// or neither for authenticate from ssh-agent
}
},
app: {
// TODO: change app name and path
name: 'app-name',
path: '../',
servers: {
one: {},
},
buildOptions: {
serverOnly: true,
},
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: 'http://www.app-name.com',
MONGO_URL: 'mongodb://mongodb/meteor',
MONGO_OPLOG_URL: 'mongodb://mongodb/local',
},
docker: {
// change to 'abernix/meteord:base' if your app is using Meteor 1.4 - 1.5
image: 'abernix/meteord:node-8.4.0-base',
},
// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true
},
mongo: {
version: '3.4.1',
servers: {
one: {}
}
},
// (Optional)
// Use the proxy to setup ssl or to route requests to the correct
// app when there are several apps
// proxy: {
// domains: 'mywebsite.com,www.mywebsite.com',
The error message you are receiving:
Error: All configured authentication methods failed
Means that the SSH connection is failing. So the credentials you are using (pity you removed them from the config) are not working. Try using a command line ssh using these same credentials, and then trouble shoot that - once you can ssh into the server, then mup should be able to do it's work.
You can get more information out of ssh by specifying one or more -v parameters, eg:
ssh -v -v my_user#remote.com
and it will give you information about the authentication methods it is trying as it goes through them. This will help you narrow down the problem.

Cloudify blueprint upload import error

we have an openstack deployment. We chose to deploy cloudify manager by image option. Now we are using the paid version of the manager image. When we tried to upload a openstack blueprint from the CLI:
cfy blueprints upload -b vm -p cloudify-nodecellar-example-master/openstack-blueprint.yaml
we have the next output error on the cloudify manager:
20/12/2017 11:45:21 [INFO] [manager_rest.server] InvalidBlueprintError: Invalid blueprint - Failed to resolve the following urls: {u'file:///opt/manager/resources/spec/cloudify/4.3.dev1/types.yaml': "Import failed: Unable to open import url file:///opt/manager/resources/spec/cloudify/4.3.dev1/types.yaml; "}. In addition, failed to resolve the original import url - Import failed: Unable to open import url http://www.getcloudify.org/spec/cloudify/4.3.dev1/types.yaml; HTTPConnectionPool(host='www.getcloudify.org', port=80): Max retries exceeded with url: /spec/cloudify/4.3.dev1/types.yaml (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
in: /opt/manager/resources/openstack-blueprint-b03206ec-1bde-4595-8cc0-93de5510f777/openstack-blueprint.yaml
in line: 7, column: 0
path: imports
value: ['http://www.getcloudify.org/spec/cloudify/4.3.dev1/types.yaml', 'http://www.getcloudify.org/spec/openstack-plugin/2.0.1/plugin.yaml', 'http://www.getcloudify.org/spec/diamond-plugin/1.3.6/plugin.yaml', 'types/nodecellar.yaml', 'types/openstack-types.yaml']
20/12/2017 11:45:23 [INFO] [manager_rest.server] Authenticated user:
It seems like there are a few issues, which I will not go through here. The best way to get started is to follow the step-by-step instructions at this link.
If you have any further questions, please feel free to ask them here or in our user group.

Resources