not able to download files from azure blob - azure-virtual-machine

Hi using fileUris in Azure extension of template, not able to download file in VM while launching VM from template.
It throws following error:
VM has reported a failure when processing extension 'customScript'. Error message: "Enable failed: processing file downloads failed: failed to download file[1]: failed to download file: unexpected status code: got=404 expected=200".

To get more insight about the issue, you check the following log files on your VM:
- /var/log/azure/custom-script/handler.log
- /var/log/waagent.log
enter code here
Your files are downloaded to a path like: /var/lib/waagent/custom-script/download/0/ and the command output is saved to stdout and stderr files in this directory. Please read these files to find out output from your script.
You can find the logs for the extension at /var/log/azure/custom-script/handler.log.
Please open an issue on this GitHub repository if you encounter problems that you could not debug with these log files.
Source: https://github.com/Azure/custom-script-extension-linux

Plese check weather your repository is private or public in github or any reposi.
Once you chenge it to public it let you download the repository

For storage private networking I needed to add the subnet of the VM to the firewall and enable the "Microsoft.Storage" services endpoint.

The message means that the waagent service was not able to download a file using the URL provided in the config file. There could be many reasons for that. I suggest that you need to test that URL manually from the VM to see if the URL can be downloaded at all.

Related

wso2 Enabling Notifications for User Operations-template path error

i'm trying to enable notifactions for user operations on wso2-is 5.11 started via docker desktop on a windows11 machine.
somone can explain me what is wrong in that?
P.S. sorry for my english
The problem is in runtime'cause the logs of docker displays the following error:
ERROR {org.wso2.carbon.identity.notification.mgt.NotificationMgtConfigBuilder} - Error while reading email template from location C:\Users\rocco\Documents\WSO2\docker-wso2\conf\is-as-km\repository\template.xml java.io.FileNotFoundException: C:\Users\rocco\Documents\WSO2\docker-wso2\conf\is-as-km\repository\template.xml (No such file or directory)
msg-mgt.properties file:
module.name.1=email
email.subscription.1=userOperation
email.subscription.userOperation.template=
C:\Users\rocco\Documents\WSO2\docker-wso2\conf\is-as-
km\repository\template.xml
#email.subscription.userOperation.salutation=Admin
email.subscription.userOperation.subject=User operation
change information
email.subscription.userOperation.endpoint.1=wso2iamtest
email.subscription.userOperation.endpoint.privateMail.address
=wso2iamtest#outlook.it
#email.subscription.userOperation.endpoint.privateMail
.salutation=Admin private mail
#email.subscription.userOperation.endpoint.privateMail
.subject=
User operation change information to private mail
#
As per the error log, you have configured the wrong path for the email template location.
Even though you use a Windows machine, wso2is is running as a docker instance.
WSO2 IS docker images are based on ubutu/ alpine/ centos OS base images (see the available variants here https://hub.docker.com/r/wso2/wso2is).
So, you also should have used one of them.
When configuring the path for email.subscription.userOperation.template=, we have to give the absolute path inside the WSO2 IS server where the particular template file is located.
In order to find the exact path correctly,
Log in to the docker container giving docker exec -it <container id> bash command
Once you logged in, you can see wso2is-5.11.0 folder natigate to the correct location where your template is placed, and give pwd command. You can get the path to the file. Then append the file name and put the value for email.subscription.userOperation.template= property.
As per the example, I created a file named template.txt.
Added the following content to it.
Hi {username}
This is a test mail to your private mail. The operation occurred was: {operation}.
Moved the created template into the docker container.
Here you can see the path I have added the template file.
According to my case, the msg-mgt.properties file should have the config as follows.
email.subscription.userOperation.template=/home/wso2carbon/wso2is-5.11.0/repository/template.txt

GCP copy files in from VM to local

I'm trying to copy files from my VM to my local computer.
I can do this with the standard command
sudo gcloud compute scp --recurse orca-1:/opt/test.txt .
However in downloading the log files they transfer but they're empty? (empty files are created with the same name)
I'm also unable to use the Cloud Shell 'Download' UI button because it gives No such file despite the absolute file path being correct (cat /path returns the data).
I understand it's a permissions thing somehow with log files?
Thanks for the replies to my thread above I figured out it was a permissions issue on my files.
Interestingly the first time I ran the commands it did not throw any errors or permission errors -- it downloaded all the expected files however they were empty. In testing again, now it threw permission errors. I then modified the files in question to have public read permissions, and it downloaded successfully.

Google Cloud Storage - Failed to upload a file using Chrome

I'm getting an error message "Failed to upload a file" when uploading from Chrome (same error whether i'm using drag and drop or the file selector). There is no detail in the error message so I have not idea how to fix this.
I was able upload the same file from gcloud shell using this command:
gsutil cp <file> gs://<bucket>
I also checked the followings:
Permissions - should not be an issue because I was able to upload from the shell. Also i'm the storage admin
Checked the Google Cloud Log Viewer - I don't see any entry for the failed attempts, only the successful one that I initiated from the shell
I tried to upload from Chrome on Mac and different one from Linux machine and getting the same error
This is an old bucket and I used to upload from the browser many times in the past
Any idea what can be causing this issue?

AWSDeploy to re-deploy ASP.NET WebAPI ELB application isn't working

I am using the Visual Studio AWS add-on/plugin to deploy my application, but want to move to a CI/CD server and scripted deployment.
I've installed the AWS SDK for Windows and thus want to use the awsdeploy.exe command line to accomplish this.
I've used msbuild and a publish profile to create the .zip deployable of my application (ASP.NET WebApi project)
I've put together the following command line command:
awsdeploy.exe -r -w -v -l "C:\<path_to>\deploylog.txt" "-DDeploymentPackage=C:\<path_to>\my_app.zip" "-DAWSAccessKey=<my_access_key>" "-DAWSSecretKey=<my_secret_key>" "C:\<path_do>\AWSDeployConfiguration.txt"
The "AWSDeployConfiguration.txt" file is what was generated by VisualStudio when I did the first deployment.
RESULT:
The console output and the text written to the log is:
INFO - Scanning configuration.
INFO - ...inspecting application '<my_app_name>' for environment '<my_environment_name>' and version 'v20180918223701'
Nothing happens with the ELB application.
What am I missing and/or how do I get more information to figure this out?
I posted this question on the AWS forums and got the following answer that also worked for me.
Hi! I have this same what You when I trying run this from cmd. But it You will try check what application is returning You will see that value is 3. Generally everything !=0 is error.
What I did?
1. I checked with Process Monitor if application is doing any network request to AWS - no it even not trying. https://learn.microsoft.com/en-us/sysinternals/downloads/procmon
I decided to recompile awasdeploy.exe and I found out that in the main procedure is a try... catch.. without any logs and just return(3). I added some logs and get a detailed error - look at attached image.
After few attempts I get a list of missing dll files:
AWSSDK.MobileAnalytics.dll
AWSSDK.CognitoIdentity.dll
All these files I found in: C:\Program Files (x86)\AWS SDK for .NET\bin and just simply copied to: C:\Program Files (x86)\AWS Tools\Deployment Tool (next to awsdeploy.exe)
Now deploy is working again.

WSO2 Identity Server SAML Error encrypting XMLObject at Example Travelocity

When setting in the sample app: Travelocity.properties
#Specify if SAM LAssertion element is encrypted
SAML.EnableAssertionEncryption=true
And also tick the Identity server configuration option:
Enable Assertion Encryption [ticked]
Certificate Alias: wso2carbon
I receive the following error at the server log:
Error at Log: 2015-05-05 15:56:10,282 Error encrypting XMLObject
Without the encryption feature enabled, the SAML authentication flow with the Travelocity sample code starts working.
Hints are welcome how to fix this issue.
Regards,
Claude
It seems like you are working on the installed java runtime for the first time. I am using ubuntu 14. The same problem came to me. For me it worked in the following way.
1. Download the respective files according to your runtime from here.
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
2. Extract the folder you downloaded. There will be two .jar files.
3. For ubuntu you can run echo $JAVA_HOME to find the java home. Copy above jar files into {JAVA_HOME}/jre/lib/security. You may need sudo access depending on you JAVA_HOME location. If so run the following from the location you extracted the zip file.
cp local_policy.jar /{JAVA_HOME}/jre/lib/security
cp US_export_policy.jar /{JAVA_HOME}/jre/lib/security
There should be only one slash (/) at /{JAVA_HOME}.
4. Restart wso2 identity server again and retry the procedure to login to travelocity.com
Hope this will fix your issue.