Azcopy fails while executing thorugh powershell - azure-powershell

Getting the below error while executing azcopy from powershell.
$args = "/Source:\\UNCservcer\env\older /Dest:https://1234env.blob.core.windows.net/folder1/folder2 /DestKey:hsyugf-*********== /S /XO /V:\\uncserver\SHARE\folderlog\log_123.log"
$exepath = "F:\Prgrm flss\azcopy\AzCopy.exe"
Start-Process $exepath $args-Wait
I used the above code and got this error.
Error parsing destination location "https://1234env.blob.core.windows.net/folder1/folder2": The request was aborted: Could not create SSL/TLS secure channel.
I removed the the log(/V) and tried. But no luck.
I could see some solutions like to disable the the firewall and run azcopy as an adminstrator. But I am restricted to do this stuffs.
Thanks.

I would recommend you use the AzCopy v10, it's a more convenient and currently supported version. When you use it, the command is simple and like this:
azcopy copy /path/to/folder "https://mystorage.blob.core.windows.net/data/sas_token" --recursive=true
Update:
Here is the screenshot that how to generate the SAS token:

Related

DBT Docs Throwing Service Unavailable Error

I am not sure why this file cannot be found.
I am using Dagster to run the DBT Docs Generate command, upload those files to S3 so that they can be deployed via CI/CD to an ngnix server.
The documentation will sometimes load after a fresh deploy, but quickly will throw the above error. I can confirm, though, that the debug and docs generate CLI commands produce no error(s), and all the files (including the catalog.json) are present on the ngninx server.
I am not sure how to debug this weird issue. Thanks!
I tried running the docs generate command with the --no-compile flag, but it produces the same result.

Trying to execute script through tclsh + sftp

For context i am trying to run a script that is hosted on a server made with TCL.
To run this script i log in a Cisco router and use the command:
tclsh tftp://[server_ip]/location/script.tcl
and it works over tftp, but when i try with sftp it does not work, says "No such file or directory", even tho i can copy the file and that works.
the command i use to cope the file is
copy sftp: flash:[server_ip]/location/script.tcl
so the router supports sftp.
and to try to run it i do exactly like tftp:
tclsh sftp://[server_ip]/location/script.tcl
to no avail.
So the copy works but executing the script does not work.
Any idea on how to fix this?
EDIT: I also tried SCP to no avail

Running PowerShell with different user

Can anyone help me with run command to open PowerShell as different user?
Currently I am trying to run below command
Runas /noprofile /user:domain\username powershell
It works but I have to provide password once powershell window opens, is there any way where I can directly put password in run command?
Or even if I get to know how can I run any commands from PowerShell using different user without opening new ps window. e.g need to run below command using different user.
Restart-Server -Name testservice
You could try schtasks.exe. You can get the help using schtasks.exe /?
If you are getting any errors after using this command referring the examples, update the post with the error, we are here to help you.
Update:
There is an in-built cmdlet available in PowerShell Register-ScheduledTask, but its depended on OS and is available only from Windows Server 2012 onwards.

The local psql command could not be located

I'm following the instructions found here.
When I try to run $ heroku pg:psql or $ heroku pg:psql HEROKU POSTGRESQL_BROWN I recieve the following error message:
! The local psql command could not be located ! For help
installing psql, see local-postgresql
I can't find anything useful on the link it gives me (it just links to the instructions I was already using, but further down the page) nor can I find this error anywhere else.
If I've missed anything you need to know to answer this, just let me know. I'm rather new to all this and teaching myself as I go.
I had same error even after installing Postgres locally.
But after seeing this
I saw that "pqsl" was not in the PATH so I then did
PATH=%PATH%;C:\Program Files\PostgreSQL\9.2\bin
which worked for me
I have since solved this myself. When I ran heroku pg:info it says the version number is 9.1.8, I was locally running 9.2
installing 9.1.8 and ensuring Path pointed to the appropriate folder solved the problem.
After you change the path, make sure to restart the terminal!
Set the PATH. To find out the PATH of your psql script (on mac) open the sql shell script from your finder in Applications/Postgres installation. This will give you a hint as to where it is installed. That opened a window which told me it is located here: /Library/PostgreSQL/8.4/scripts/runpsql.sh
Then, I set the PATH variable from the terminal window by typing:
$ PATH="/Library/PostgreSQL/8.4/bin:$PATH"
(depends on the location of your PostgreSQL installation, find your bin path first, another exp: /usr/local/Cellar/postgresql#9.6/9.6.8/bin)
OR.....
You can also connect to the shell by opening the shell directly from your postgres installation folder. Then enter the credentials. If you don't know the credentials, here is how to find them out:
$ heroku pg:info
=== HEROKU_POSTGRESQL_RED_URL (DATABASE_URL)
$ heroku pg:credentials HEROKU_POSTGRESQL_RED_URL
Top answer wouldn't work for me oddly, my system would not add the Path via cmd with administrator access (Not sure why).
So check this > Windows key > environment variables > system variables
And add the last line (your version may differ in the path)
Make sure you've installed the toolbelt as psql is installed by default.
However you also need to ensure you've installed a local copy of PostgreSQL; if you don't the toolbelt will be unable to find the native psql client.
Assuming you have installed a local copy of PostgreSQL, make sure you can execute psql from the command line directly (i.e make sure you PATH is set correctly ). If the command does not execute, check your PATH, if it does execute see if you can connect via the PSQL connection string provided in the Heroku control panel. If you can connect reinstall the toolbelt, if you are unable to connect provision another dev database and try again.
If there are still issues, I would suggest contacting Heroku support for assistance after verifying no API issues are listed on the status page located here.
I got rid if this annoying message on Windows by adding a path element without the spaces, i.e.
C:\Progra~1\PostgreSQL\9.4\data
instead of
“C:\Program Files\PostgreSQL\9.4\data”
I followed the instructions here: http://www.computerhope.com/issues/ch000549.htm, which worked for me if you prefer to go the point-and-click configuration of the PATH variable.
This type of error usually appears in the Windows environment, because if you do not update the PATH after installing Postgresql, heroku pg:psql command does not work.
So you need to update your PATH environment variable to add the bin directory of your Postgres installation. The directory will look like this:
C:\Program Files\PostgreSQL\<VERSION>\bin.
For more information, go to the Heroku in Local setup website:
heroku-postgresql: Local setup
I had the same problem and discovered that Heroku doesn't seem to provision the latest version of PostgreSQL by default. Where the Heroku Getting Started instructions said
heroku addons:create heroku-postgresql:hobby-dev
That provisioned a v10 database for some reason (which you can check by clicking on Heroku Postgres in the Add-ons tab of your dashboard). I deleted that database and provisioned a new database using the --version flag:
heroku addons:create heroku-postgresql:hobby-dev --version 11
As of now, at least, you can find the latest version of Postgres supported by Heroku at this link: https://devcenter.heroku.com/articles/heroku-postgresql#version-support-and-legacy-infrastructure
I'm writing this in early 2019, but according to the PostgreSQL website the next version (12) is "tentatively scheduled" for third quarter of 2019 so if you're reading this in late 2019 potentially the same problem will come up for v12 instead
On Mac you can use the following:
export PATH="/Library/PostgreSQL/12/bin/:$PATH"
The only solution that I found on Windows:
go to advanced system settings
go to environment variables
select Path variable and click Edit
add a new line and enter your bin directory path (C:\Program Files\PostgreSQL<version>\bin) and click ok
restart your terminal
enter your psql command (heroku pg:psql)

DB2 generate DLL error

Earlier this morning I trying to create DLL for my DB2 database but it kept giving the following message:
The DB2 Administration Server encountered a script error. Script
error code "1".
Explanation:
A script error was encountered while the DB2 Administration server was
executing the script. The script exited with error code "".
User response:
Verify that the script is correct.
If you continue to receive this error message after attempting the
suggested response, refer to the DB2 Administration Server's First
Failure Data Capture Log for additional information or contact IBM
Support.
can anyone help me on this?
my user is ROOT and schema is SQLJ
command is db2look -d OBDB -z SQLJ -u ROOT -e -l -x -c ;
Error code is SQL22220.
i once too had this problem. may be you are trying to generate dll for more than 30 tables at a time. reduce the no. of tables and see if this works. worked for me though but errors can be due to other reason as well, plz let me know.... :)