"The connection string is missing the property: SharedAccessKeyName" - raspberry-pi3

enter image description here
pi#raspberrypi:~ $ iothub-explorer login HostName=roomautomation.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/usr/local/lib/node_modules/iothub-explorer/node_modules/azure-iot-common/lib/connection_string.js:28
throw new errors_1.ArgumentError(err + key);
^
ArgumentError: The connection string is missing the property: SharedAccessKeyName
at /usr/local/lib/node_modules/iothub-explorer/node_modules/azure-iot-common/lib/connection_string.js:28:23
at Array.forEach ()
at Function.ConnectionString.parse (/usr/local/lib/node_modules/iothub-explorer/node_modules/azure-iot-common/lib/connection_string.js:26:24)
at Object.parse (/usr/local/lib/node_modules/iothub-explorer/node_modules/azure-iothub/lib/connection_string.js:17:48)
at Object. (/usr/local/lib/node_modules/iothub-explorer/iothub-explorer-login.js:33:27)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Function.Module.runMain (module.js:690:10)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:666:3

Rita's comment is correct, you need to add quotes around your connection string otherwise bash considers the first ; character as the end of the command.

Related

How to eliminate TypeError: Cannot read property ‘startsWith’ of undefined error during sls deployment

Currently learning serverless and state machines. When I'm trying to do deployment I'm getting error: TypeError: Cannot read property ‘startsWith’ of undefined.
Below you can find serverless.yml definition which I'm trying to deploy. I can't spot the error I did.
State machine I want is really basic and simple. I want to start it with decision, which will direct to correct lambda, depends on input (all of this manual, semi-manual for now). After lambda completion (no matter which one) will be end.
service: state-machine
plugins:
- serverless-python-requirements
- serverless-iam-roles-per-function
- serverless-step-functions
- serverless-pseudo-parameters
custom:
pythonRequirements:
dockerizePip: non-linux
slim: true
zip: true
provider:
name: aws
runtime: python3.8
region: eu-central-1
stage: ${opt:stage, 'testing'}
timeout: 30
iamRoleStatements:
- Effect: Allow
Action:
- lambda:InvokeFunction
- lambda:InvokeAsync
Resource: "*"
package:
individually: true
exclude:
- node_modules/**
- .git/**
- .venv/**
functions:
process-purchase:
module: state-machine
memorySize: 128
stages:
- testing
- dev
handler: ProcessPurchase.process_purchase
process-refund:
module: state-machine
memorySize: 128
stages:
- testing
- dev
handler: ProcessRefund.process_refund
stepFunctions:
validate: true
stateMachines:
TransactionChoiceMachine:
name: ChoiceMachineTest-${self:provider.stage}
dependsOn: CustomIamRole
definition:
Comment: "Purchase refund choice"
StartAt: ProcessTransaction
States:
ProcessTransaction:
Type: Choice
Choices:
- Variable: "$.TransactionType"
StringEquals: "PURCHASE"
Next: PurchaseState
- Variable: "$.TransactionType"
StringEquals: "REFUND"
Next: RefundState
PurchaseState:
Type: Task
Resource:
Fn::GetAtt: [process-purchase, Arn]
End: true
RefundState:
Type: Task
Resourse:
Fn::GetAtt: [process-refund, Arn]
End: true
This is the log I get after SLS_DEBUG=true:
Type Error ---------------------------------------------
TypeError: Cannot read property 'startsWith' of undefined
at /home/maciej/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:374:59
at arrayMap (/home/maciej/node_modules/lodash/lodash.js:639:23)
at map (/home/maciej/node_modules/lodash/lodash.js:9554:14)
at Function.flatMap (/home/maciej/node_modules/lodash/lodash.js:9257:26)
at ServerlessStepFunctions.getIamPermissions (/home/maciej/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:327:12)
at /home/maciej/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:423:56
at Array.forEach (<anonymous>)
at ServerlessStepFunctions.compileIamRole (/home/maciej/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:412:32)
From previous event:
at PluginManager.invoke (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:498:22)
at PluginManager.spawn (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:518:17)
at /usr/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:122:50
From previous event:
at Object.before:deploy:deploy [as hook] (/usr/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:102:22)
at /usr/lib/node_modules/serverless/lib/classes/PluginManager.js:498:55
From previous event:
at PluginManager.invoke (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:498:22)
at /usr/lib/node_modules/serverless/lib/classes/PluginManager.js:533:24
From previous event:
at PluginManager.run (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:533:8)
at /usr/lib/node_modules/serverless/lib/Serverless.js:168:33
From previous event:
at Serverless.run (/usr/lib/node_modules/serverless/lib/Serverless.js:155:74)
at /usr/lib/node_modules/serverless/scripts/serverless.js:50:26
at processImmediate (internal/timers.js:461:21)
From previous event:
at Object.<anonymous> (/usr/lib/node_modules/serverless/scripts/serverless.js:50:4)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/lib/node_modules/serverless/bin/serverless.js:47:1)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
Line 77 in my serverless.yml has typo... should be Resource.

i want to use pillow module but

2020-08-05T11:18:47.632502+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 653, in load_extension
2020-08-05T11:18:47.632862+00:00 app[worker.1]: self._load_from_module_spec(spec, name)
2020-08-05T11:18:47.632903+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 599, in _load_from_module_spec
2020-08-05T11:18:47.633218+00:00 app[worker.1]: raise errors.ExtensionFailed(key, e) from e
2020-08-05T11:18:47.633309+00:00 app[worker.1]: discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.DPB' raised an error: ModuleNotFoundError: No module named 'Pillow'
2020-08-05T11:18:47.713878+00:00 heroku[worker.1]: Process exited with status 1
in pip list it shows
image v1.5.32
Pillow v7.2.0
what is the issue?
code:
from Pillow import Image

Heroku: Problem with deploying cherrypy app

I'm basically trying to deploy the example in the CherryPy tutorial to Heroku (https://docs.cherrypy.org/en/latest/tutorials.html#tutorial-8-make-it-smoother-with-ajax). When I run the code locally, everything works fine. After deployment to Heroku, I get several error messages:
2020-04-16T17:42:19.422074+00:00 app[web.1]: Traceback (most recent call last):
2020-04-16T17:42:19.422076+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 670, in respond
2020-04-16T17:42:19.422076+00:00 app[web.1]: response.body = self.handler()
2020-04-16T17:42:19.422076+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/cherrypy/lib/encoding.py", line 217, in __call__
2020-04-16T17:42:19.422077+00:00 app[web.1]: self.body = self.oldhandler(*args, **kwargs)
2020-04-16T17:42:19.422077+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/cherrypy/_cpdispatch.py", line 61, in __call__
2020-04-16T17:42:19.422078+00:00 app[web.1]: return self.callable(*self.args, **self.kwargs)
2020-04-16T17:42:19.422078+00:00 app[web.1]: File "app.py", line 19, in GET
2020-04-16T17:42:19.422078+00:00 app[web.1]: return cherrypy.session['mystring']
2020-04-16T17:42:19.422079+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/cherrypy/__init__.py", line 246, in __getitem__
2020-04-16T17:42:19.422079+00:00 app[web.1]: return child[key]
2020-04-16T17:42:19.422079+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/cherrypy/lib/sessions.py", line 309, in __getitem__
2020-04-16T17:42:19.422080+00:00 app[web.1]: return self._data[key]
2020-04-16T17:42:19.422080+00:00 app[web.1]: KeyError: 'mystring'
2020-04-17T09:24:31.597650+00:00 app[web.1]: File "app.py", line 45, in <module>
2020-04-17T09:24:31.597765+00:00 app[web.1]: webapp.generator = StringGeneratorWebService()
2020-04-17T09:24:31.597768+00:00 app[web.1]: TypeError: expose_() missing 1 required positional argument: 'func'
2020-04-17T09:24:32.000000+00:00 app[api]: Build succeeded
My Procfile simply contains
web: python app.py
My guess is that the problem has something to do with the little css-trick that avoids refreshing the page in order display the result of a request. But, as you can see, I'm totally new to deployment and this is also my first question on stackoverflow--so my apologies in advance in case I'm missing something obvious here. Any help is much appreciated!

Unknown Provider error while unit testing in jasmine

I have a module as below in a js file
app.js
angular.module( 'app', [ 'ui.bootstrap', 'routes', 'module2', 'ngAnimate', 'ngSanitize' ] );
If i am to write a unit test case then how should i load the modules in my unit test case??
Is it this way
module('app');
Other way
module('ui.bootstrap');
module('routes');
module('module2');
module('ngAnimate');
module('ngSanitize');
Which is right order or the right way to load the module...As am always getting the below error
Error: [$injector:unpr] Unknown provider: deepakProvider <- deepak
http://errors.angularjs.org/1.4.9/$injector/unpr?p0=deepakProvider%20%3C-%20deepak
at C:/jasmine/InformedEnrollment2/src/webapp/informedenrollment2/webclnt/components/angular/angular.js:68:12
at C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4346:19
at Object.getService [as get] (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4494:39)
at C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4351:45
at Object.getService [as get] (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4494:39)
at Object.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:20:47)
at Object.invoke (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4535:17)
at Object.workFn (C:/jasmine/project/node_modules/angular-mocks/angular-mocks.js:3071:20)
Error: Declaration Location
at window.inject.angular.mock.inject (C:/jasmine/project/node_modules/angular-mocks/angular-mocks.js:3033:25)
at Suite.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:19:15)
at C:/jasmine/project/tests/DemoToTheTeam.js:2:1
TypeError: Cannot read property 'multiply' of undefined
at Object.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:26:13)
50.0.2661 (Windows 7 0.0.0): Executed 7 of 7 (1 FAILED) (0.182 secs / 0.064 secs)

running gulp inside a Laravel project fails when mixing styles and/or compiling sass files

Everything was working and i was capable to run gulp and gulp watch normally, after some changes in my phpspec files it dosn't work anymore. See the details below.
This is my gulpfile.js
var elixir = require('laravel-elixir');
elixir(function (mix) {
mix.phpUnit().phpSpec();
// this task should look for files inside the resources/assets/sass
// folder.
mix.sass(
[
'./resources/assets/bower/bootstrap-sass/assets/stylesheets/_bootstrap.scss',
'**',
],
'resources/assets/css/sass.css'
);
// this task should look for files inside the resources/assets/css
// folder.
mix.styles(
[
'**',
],
'public/css/all.css'
);
// this task should look for files inside the resources/assets/js
// folder.
mix.scripts(
[
'./resources/assets/bower/jquery/dist/jquery.js',
'./resources/assets/bower/bootstrap-sass/assets/javascripts/bootstrap.js',
'**',
],
'public/js/app.js'
);
mix.version(
[
"css/all.css",
"js/app.js",
]
);
mix.browserSync(
{
proxy: "localhost:8000",
}
);
});
And this is the output after runing gulp:
[19:00:44] Using gulpfile ~/Public/forsale/gulpfile.js
[19:00:44] Starting 'default'...
[19:00:44] Starting 'PHPUnit'...
Triggering PHPUnit: vendor/bin/phpunit --verbose
[19:00:44] Finished 'default' after 44 ms
PHPUnit 4.8.26 by Sebastian Bergmann and contributors.
Runtime: PHP 7.0.4-7ubuntu2.1
Configuration: /home/rafael/Public/forsale/phpunit.xml
.
Time: 49 ms, Memory: 8.00MB
OK (1 test, 1 assertion)
[19:00:44] gulp-notify: [Green!] Your PHPUnit tests passed!
[19:00:44] Finished 'PHPUnit' after 144 ms
[19:00:44] Starting 'PHPSpec'...
Triggering PHPSpec: vendor/bin/phpspec run
/ skipped: 0% / pending: 0% / passed: 100% / failed: 0% / broken: 0% / 2 examples
1 specs
2 examples (2 passed)
5ms
[19:00:44] gulp-notify: [Green!] Your PHPSpec tests passed!
[19:00:44] Finished 'PHPSpec' after 84 ms
[19:00:44] Starting 'sass'...
Fetching Sass Source Files...
- ./resources/assets/bower/bootstrap-sass/assets/stylesheets/_bootstrap.scss
Saving To...
- resources/assets/css/sass.css
[19:00:44] 'sass' errored after 104 ms
[19:00:44] Error: Cannot find module './flex-Spec'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/rafael/Public/forsale/node_modules/autoprefixer-core/lib/hacks/flex.js:6:14)
at Object.<anonymous> (/home/rafael/Public/forsale/node_modules/autoprefixer-core/lib/hacks/flex.js:58:4)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
[19:00:44] Error in plugin 'run-sequence(sass)'
Message:
sass catch
It seems that run-sequence has a missing module, but i didn't find it.
The problem was solved, i removed my node_modules folder and applied npm install && npm update again. It looks like one of my libraries were damaged and i don't know why.

Resources