Remote options fail - rundeck

I'm trying to setup an option value, using cascading remote option strategy.
Parent option name: --serv
Parent option value: Administración de sistemas (note the ó)
*Child option
To get child option values, I use cascading options based on parent option value (--serv)
Remote URL value is: file:/scripts/XXXXXXXX/conf/list_${option.--serv.value}-componentes.json
When I choose "Administración de sistemas" value on --serv option, I got the following error:
Exception: java.net.URISyntaxException: Illegal character in path at index 49: file:/scripts/path/conf/list_Administraci%F3n de Sistemas-componentes.json URL: file:/scripts/path/conf/list_Administraci%F3n de Sistemas-componentes.json
I tried to "manually" encode ó character with, substituying ó with %f3, without any success. Indeed the blank space in filename represent the same problem
--- UPDATE ---
For better explanation, Here, I post options code
- description: Indicar el servicio
enforced: true
label: Servicio
name: --serv
required: true
value: Administración de Sistemas
valuesUrl: file:/scripts/XXXXXXXX/conf/list_Servicio.json
- description: Indica la operacion
enforced: true
label: Operacion
name: --oper
required: true
value: Realizar petición
valuesUrl: file:/scripts/XXXXXXXX/conf/list_Operacion.json
- description: Componente
enforced: true
label: Componente de infraestructura
name: --comp
required: true
value: ESPECIFICAR
valuesUrl: file:/scripts/XXXXXXXX/conf/list_${option.--serv.value}-componentes.json
Note the Componente option and option value valuesUrl: file:/scripts/XXXXXXXX/conf/list_${option.--serv.value}-componentes.json
Now, /scripts/XXXXXXXX/conf/list_Servicio.json have the following content inside it
# cat list_Servicio.json
["Administración de Sistemas"
]
When I try to run the job, I got the following message on --comp dropdown
Exception: java.net.URISyntaxException: Illegal character in path at index 47: file:/scripts/XXXXXXXX/conf/list_Administración de Sistemas-componentes.json
URL: file:/scripts/XXXXXXXX/conf/list_Administración de Sistemas-componentes.json
Screenshot with option error
I'm using directly ó, without any success.
On bash, it works ok (look at cat above)
Rundeck running with proper encoding
Screenshot with echo $LANG output
PD: linux environment
Any advice?
Thanks in advance :-)

Related

AWS HTTP API Integration with AWS Step Functions -> Sending Multiple Values in the Input

I have a Type: AWS::Serverless::HttpApi which I am trying to connect to a Type: AWS::Serverless::StateMachine as a trigger. Meaning the HTTP API would trigger the Step Function state machine.
I can get it working, by only specifying a single input. For example, the DefinitionBody when it works, looks like this:
DefinitionBody:
info:
version: '1.0'
title:
Ref: AWS::StackName
paths:
"/github/secret":
post:
responses:
default:
description: "Default response for POST /"
x-amazon-apigateway-integration:
integrationSubtype: "StepFunctions-StartExecution"
credentials:
Fn::GetAtt: [StepFunctionsApiRole, Arn]
requestParameters:
Input: $request.body
StateMachineArn: !Ref SecretScannerStateMachine
payloadFormatVersion: "1.0"
type: "aws_proxy"
connectionType: "INTERNET"
timeoutInMillis: 30000
openapi: 3.0.1
x-amazon-apigateway-importexport-version: "1.0"
Take note of the following line: Input: $request.body. I am only specifying the $request.body.
However, I need to be able to send the $request.body and $request.header.X-Hub-Signature-256. I need to send BOTH these values to my state machine as an input.
I have tried so many different ways. For example:
Input: " { body: $request.body, header: $request.header.X-Hub-Signature-256 }"
and
$request.body
$request.header.X-Hub-Signature-256
and
Input: $request
I get different errors each time, but this is the main one:
Warnings found during import: Unable to create integration for resource at path 'POST /github/secret': Invalid selection expression specified: Validation Result: warnings : [], errors : [Invalid source: $request specified for destination: Input].
Any help on how to pass multiple values would so be appreciated.

Use variants in TYPO3 v9 to translate validationErrorMessages in a form

I want to translate the validationErrorMessage of an finisher with the new variant. Below is a piece of my code showing properties of the field labeled with Vorname.
renderables:
- defaultValue: ''
type: Text
identifier: text-1
label: Vorname
properties:
fluidAdditionalAttributes:
required: required
minlength: '5'
maxlength: '100'
validationErrorMessages:
- code: '1238110957'
message: 'Die maximale....'
- code: '1221551320'
message: 'Es sind nur alphanumerische Zeichen erlaubt'
- code: '1221560910'
message: 'Bitte geben Sie Ihren Vornamen an'
elementDescription: 'Ihr Vorname'
To translate this, I use the following code. While the translation for label and elementDescription works fine, the one for the validationErrorMessage don't.
variants:
- identifier: language-variant-en
condition: 'siteLanguage("locale") == "en_US.UTF-8"'
label: Firstname
properties:
validationErrorMessages:
message: 'Englisch Die maximale...'
elementDescription: Your first name
I think, the problem is to adress each of the message properties the right way but I havn't found a solution, yet.
Thanks
As suspected, the solution in itself is quite simple. Simply take over the passage to be translated (validationErrorMessages) completely as you can see.
Pay attention to the hyphen and the indent:
variants:
- identifier: language-variant-en
condition: 'siteLanguage("locale") == "en_US.UTF-8"'
label: Firstname
properties:
validationErrorMessages:
- code: '1238110957'
message: 'The maximum length is 100 characters, the minimum length 5 characters'
- code: '1221551320'
message: 'Only alphanumeric characters are allowed'
- code: '1221560910'
message: 'Please enter your first name'
elementDescription: Your first name

REST API - Swagger - Don't understand why "Not a valid parameter definition"

I face issue with my swagger file :
swagger: '2.0'
paths:
/currencies:
get:
responses:
'200':
description: ''
summary: 'list currencies summary'
x-auth-type: None
x-throttling-tier: Unlimited
produces:
- application/json
description: 'list currencies description'
'/currencies/{currencieId}':
get:
responses:
'200':
description: ''
description: 'Single currency description'
parameters:
- name: currencieId
in: path
allowMultiple: false
required: true
type: string
description: 'paramter description'
summary: 'Single currency'
x-auth-type: None
x-throttling-tier: Unlimited
produces:
- application/json
info:
title: MDM
version: v1
Here is my issue :
✖ Swagger Error
Not a valid parameter definition
Jump to line 20
Details
Object
code: "ONE_OF_MISSING"
params: Array [0]
message: "Not a valid parameter definition"
path: Array [5]
0: "paths"
1: "/currencies/{currencieId}"
2: "get"
3: "parameters"
4: "0"
schemaId: "http://swagger.io/v2/schema.json#"
inner: Array [2]
level: 900
type: "Swagger Error"
description: "Not a valid parameter definition"
lineNumber: 20
Issue in swagger editor
I am a bit lost with that ....
Thanks for your help.
Julien
Remove allowMultiple: false from the definition of the currencieId parameter. That eliminates the error.
The allowMultiple keyword does not exist in the OpenAPI (fka Swagger) Specification 2.0. It was used in v1.2, but in 2.0 it was replaced with type: array and collectionFormat.
allowMultiple: false is not correct

symfony2.3 spool monolog error email in command

I know that this question was already made in this post: Send email when error occurs in console command of Symfony2 app, but answers do not provide a complete solution to the problem at hand and I can't comment on original post.
I need to send a monolog error email in command. E-mail is correctly enqueued in a file spooler; unfortunately I'm forced to use a memory spool.
Strangely enough the code snipper provided to manually flush the spool does work for emails generated in my code, not for monolog.
Does anybody know why this is happening and wether it would be possible to use a memory spool?
config.yml:
# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
spool: { type: memory }
# Monolog Configuration
monolog:
channels: ["account.create"]
handlers:
account.create.group:
type: group
members: [account.create.streamed, account.create.buffered]
channels: [account.create]
account.create.streamed:
type: stream
path: %kernel.logs_dir%/accounts_creation.log
level: info
account.create.buffered:
type: buffer
handler: account.create.swift
account.create.swift:
type: swift_mailer
from_email: xxx#yyy.com
to_email: aaa#gmail.com
subject: 'An Error Occurred while managing zzz!'
level: critical
config_prod.yml:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
channels: [!account.create]
usage example:
try
{
//code that could block
}
catch(ManageUserBlockingExceptionInterface $e)
{
$exitCode = self::EXIT_CODE_ERROR_BLOCKING;
//le eccezioni bloccanti vengono loggate e non si conferma che
//il messaggio è stato utilizzato ma si termina la coda
if(!\is_null($this->logger))
{
$this->logger->crit($e->getMessage());
}
}
the logger is injected in service by dependency injection as a service:
...
<argument type="service" id="monolog.logger.account.create" on-invalid="null" />
...
and it works because critical errors are streamed in file log; but also email is created if swiftmailer is configured with a file spool.
Finally, the code to manually flush memory spool is as folllow:
protected function flushMailSpool()
{
$mailer = $this->container->get('mailer');
$spool = $mailer->getTransport()->getSpool();
$transport = $this->container->get('swiftmailer.transport.real');
$spool->flushQueue($transport);
}
it is called immediately after a service purposedly sends an email; I noticed that the same code, put in command and adapted to command environment i.e. $this->container becomes $this->getContainer() does not work, maybe due to a scope change?

Neos: Routings for Inspector Editors

I try to create an own inspector editor which should be able to load data via a controller. For this I render an LINK-tag – like Neos does – in the header:
<link rel="vendor-package-backend-content" href="http://typo3-neos-1.1.x.dev/vendor.package/backend/content/load />
A controller Packages/Application/Vendor.Package/Classes/Vendor/Package/Controller/Backend/ContentController.php is created.
This is the file Configuration/Routes.yaml:
-
name: 'TYPO3 Neos'
uriPattern: '<TYPO3NeosSubroutes>'
subRoutes:
'TYPO3NeosSubroutes':
package: 'TYPO3.Neos'
variables:
'defaultUriSuffix': '.html'
-
name: 'Vendor Package
uriPattern: '<VendorPackageSubroutes>'
subRoutes:
'VendorPackageSubroutes':
package: 'Vendor.Package'
variables:
'defaultUriSuffix': '.html'
Here the file Packages/Application/Vendor.Package/Configuration/Routes.yaml
-
name: 'Backend'
uriPattern: 'vendor.package/<BackendSubRoutes>'
defaults:
'#package': 'Vendor.Package'
'#action': 'index'
'#format': 'html'
subRoutes:
'BackendSubRoutes':
package: 'Vendor.Package'
suffix: 'Backend'
And finaly the file Packages/Application/Vendor.Package/Configuration/Routes.Backend.yaml
-
name: 'Backend Content Controller'
uriPattern: 'backend/content(/{#action})'
defaults:
'#package': 'Vendor.Package'
'#controller': 'Backend\Content'
appendExceedingArguments: TRUE
If the URL is now called: http://domain.com/vendor.package/backend/content/index an "Page not found" error is thrown. I have to deactivate the TYPO3.Flow.error.exceptionHandler.renderingGroups.notFoundExceptions to see more details:
Sorry, the page you requested was not found. Technical details:
Could not find a preset for content dimension "language" through the
given URI segment "vendor.package". (reference code:
2014121115590523bc78)
But I don't find out how the path segment for /neos is defined for dimensions, there it works…
How I must configure this?
Try putting your vendor routes definition above neos in main Routs.yaml.
Check your Data/Logs/System_Development.log if it matches what it should.
Hm, and remove this part for your Vendor.Package:
variables:
'defaultUriSuffix': '.html'
Thanks tarkin. The Development-Log was a good hint :) I think I've got it and I will share this. There are several configurations to set:
1) The LINK-tag rendered through the TS2 page – like Neos does – in the header with login required.
<f:security.ifAccess resource="Vendor_Package_BackendAccess">
<link rel="vendor-package-backend-content" href="http://typo3-neos-1.1.x.dev/vendor.package/backend/content/load />
</f:security.ifAccess>
2) A controller Packages/Application/Vendor.Package/Classes/Vendor/Package/Controller/Backend/ContentController.php.
3) Settings in the file Configuration/Routes.yaml:
-
name: 'Vendor Package
uriPattern: '<VendorPackageSubroutes>'
subRoutes:
'VendorPackageSubroutes':
package: 'Vendor.Package'
variables:
'defaultUriSuffix': '.html'
4) The file Packages/Application/Vendor.Package/Configuration/Routes.yaml
-
name: 'Backend'
uriPattern: 'vendor.package/<BackendSubRoutes>'
defaults:
'#package': 'Vendor.Package'
'#action': 'index'
'#format': 'html'
subRoutes:
'BackendSubRoutes':
package: 'Vendor.Package'
suffix: 'Backend'
5) The file Packages/Application/Vendor.Package/Configuration/Routes.Backend.yaml
-
name: 'Backend Content Controller'
uriPattern: 'backend/content(/{#action})'
defaults:
'#package': 'Vendor.Package'
'#controller': 'Backend\Content'
appendExceedingArguments: TRUE
6) The file Packages/Application/Vendor.Package/Configuration/Policy.yaml.
resources:
methods:
Vendor_Package_BackendAccess: 'method(Vendor\Package\Controller\Backend\ContentController->.*Action())'
acls:
'TYPO3.Neos:Editor':
methods:
Vendor_Package_BackendAccess: GRANT
7) And at least Packages/Application/Vendor.Package/Configuration/Settings.yaml
Flow:
security:
authentication:
providers:
Typo3BackendProvider:
requestPatterns:
controllerObjectName: 'TYPO3\Neos\Controller\.*|TYPO3\Neos\Service\.*|TYPO3\Media\Controller\.*|Vendor\Package\Controller\Backend\.*'
8) There is one more thing for Packages/Application/Vendor.Package/Configuration/Settings.yaml, else you get an error cause of missing dimension mapping.
TYPO3CR:
contentDimensions:
'language':
presets:
'vendor.packages':
label: ''
values: ['mul_ZZ']
uriSegment: 'vendor.packages'
This will be the first part of the answer :)
But there are some questions left:
1) This will be at least a package. So I wounder why I have to set stuff in Configuration/Routes.yaml, which will not be part of the installation process (?).
2) In this example it's required to override the path Flow.security.authentication.providers.Typo3BackendProvider.requestPatterns.controllerObjectName. I don't think, that this is usefull and that there must be another way.