goland: when i execute go mod tidy in goland,why "goproxy.io" is in the package url - goland

go mod tidy in goland
*bitbucket.org/xxxproject/db_proxy_api_model/models/v1 : cannot find module providing package.
reading https://goproxy.io/bitbucket.org/xxxproject/db_proxy_api_model/models/#v/list: 404 Not Found
server response:
not found: module bitbucket.org/xxxproject/db_proxy_api_model/models: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/cf011ef4494e04c40886924c664c719ff30fb53c96bff1250e26ef05478bbd13: exit status 128:
fatal: could not read Username for 'https://bitbucket.org': terminal prompts disabled.
Confirm the import path was entered correctly.If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.*
enter image description here
I set goproxy=https://goproxy.io,but its not the point, the problem is also appear in the case of dont use proxy.
what can i do solving the problem

The project seems to be a private one and you should specify GOPRIVATE variable (https://go.dev/ref/mod#private-module-proxy-direct) via Preferences/Settings | Go | Go Modules | Environment. GoLand will be able to pick up the environment.

Related

Unable to run deno task start with invalid source code error

I have a deno repository of my own. I have recently switched to a new machine, and I have git clone'd that repository to my new machine.
Now when I run deno task start, it fails with this error
❯ deno task start
Task start deno run -A --watch=static/,routes/ dev.ts
Watcher Process started.
The manifest has been generated for 3 routes and 2 islands.
error: The source code is invalid, as it does not match the expected hash in the lock file.
Specifier: https://esm.sh/*preact-render-to-string#5.2.4
Lock file: /Users/john/my-project/deno.lock
I have read this page, but it is not telling me exactly what to do for my error
https://deno.land/manual#v1.29.4/basics/modules/integrity_checking
Based off of what that page says, the contents of one of your dependencies has changed since your original computer downloaded it for the first time, so the hash of the contents are different.
If you just want to ignore this, it says to use the flags
--lock=deno.lock --lock-write
which I assume means to run
deno task start --lock=deno.lock --lock-write
This will overwrite the current lock file with the new version of the code.
While this will work, the better option for the future is to specify the version in your dependency url.
For example, instead of
import { z } from "https://deno.land/x/zod/mod.ts";
you should say
import { z } from "https://deno.land/x/zod#v3.20.2/mod.ts";
(the #v3.20.2 specfies the exact dependency version)

How do I use JARs stored in Artifactory in spark submits?

I am trying to configure the spark-submits to use JARs that are stored in artifactory.
I've tried a few ways to do this
Attempt 1: Changing the --jars parameter to point to the https end point
Result 1: 401 Error. Credentials are being passed like so: https://username:password#jfrog-endpoint. The link was tested using wget and it authenticates and downloads the JAR fine.
Error
Attempt 2: Using a combination of --packages --repositories
Result 2: URL doesn't resolve to the right location of the jar
Attempt 3:Using combination of --packages and modified ivysettings.xml (containing repo and artifact pattern)
ivy settings
Result 3: URL resolves correctly but still results in "Not Found"
After some research it looks like the error might say "Not Found" and the it looks like it has "tried" the repo, it could still very well be a 401 error.
Error
Any ideas would be helpful! Links i've explored:
Can i do spark-submit application jar directly from maven/jfrog artifactory
spark resolve external packages behind corporate artifactory
How to pass jar file (from Artifactory) in dcos spark run?
https://godatadriven.com/blog/spark-packages-from-a-password-protected-repository/
https://spark.apache.org/docs/latest/submitting-applications.html#advanced-dependency-management
You can use https://username:password#jfrog.com/rep, however you need to specify port.
https://username:password#jfrog.com:443/repo
I discovered this using Artifactory's "set me up" tool for package type Ivy. If you look in the resolver url it specifies the port.

Robotframework, AutoIt: Error message "No keyword with name 'Send' found"

I'm trying to get familiar with the robotframework using autoitlibrary to test Windows applications. I found some examples which use the Send command to type text into a notpad window.
That's what I've done so far:
*** Settings ***
Library AutoItLibrary
*** Variables ***
${app} C:/Program Files/Notepad++/notepad++.exe
*** Test Cases ***
Enter text
Run ${app}
Win Wait Active new 1 - Notepad++
Send This is just a test.
So, the Notepad++ window is opened, but then it failed with the No keyword with name 'Send' found. message. I suppose there is no Send command in the AutoItLibrary, but I also cannot find any other command which may do this job.
AutoIt is installed, and so is the wrapper by pip install robotframework-autoitlibrary.
There really exists a Send keyword in AutoIt, but supposedly not in the wrapper for robotframework.
And ideas to fix this?
UPDATE: Windows 10 (64bit in a VirtualBox), Python v3.7.6 (32bit), RF v3.1.2, RF-AutoItLibrary v1.2.4, AutoIt v3.3.14.5
The "Search Keywords" dialog in RIDE provides AutoItLibrary as a Source, but then list only a few commands. So I suppose the library is accessible, but incomplete.
import os, re, subprocess, sys
# Set path to Python directories.
programfiles = os.environ['programfiles']
if not programfiles:
exit('Failed to get programfiles')
python_dirs = [os.path.join(programfiles, 'Python35'),
os.path.join(programfiles, 'Python36'),
os.path.join(programfiles, 'Python37'),
os.path.join(programfiles, 'Python38')]
# Process each python directory.
for python_dir in python_dirs:
print('---')
# Set path to AutoItX3.dll.
autoitx_dll = os.path.join(python_dir, r'Lib\site-packages\AutoItLibrary\lib\AutoItX3.dll')
if not os.path.isfile(autoitx_dll):
print('File not found: "' + autoitx_dll + '"')
continue
# Set path to the makepy module.
makepy = os.path.join(python_dir, r'Lib\site-packages\win32com\client\makepy.py')
if not os.path.isfile(makepy):
print('File not found: "' + makepy + '"')
continue
# Generate cache using make.py.
command = [os.path.join(python_dir, 'python.exe'), makepy, autoitx_dll]
with subprocess.Popen(command, stderr=subprocess.PIPE, cwd=python_dir, universal_newlines=True) as p:
stderr = p.communicate()[1]
print(stderr.rstrip())
parameters = re.findall(r'^Generating to .+\\([A-F0-9\-]+)x(\d+)x(\d+)x(\d+)\.py$', stderr, re.M)
if len(parameters) == 1:
parameters = parameters[0]
print('Insert the next line into AutoItLibrary.__init__.py if not exist.\n'
' win32com.client.gencache.EnsureModule("{{{guid}}}", {major}, {minor}, {lcid})'
.format(guid=parameters[0],
major=parameters[1],
minor=parameters[2],
lcid=parameters[3]))
# Pause so the user can view the subprocess output.
input('Press the return key to continue...')
The generated cache done by win32com\client\makepy.py for AutoItLibrary from the setup.py is saved in the %temp%\gen_py folder. This is done only when setup.py is executed. If the %temp% directory is cleaned later, which removes the cache, then I notice keywords like Send may fail to be recognized by the robotframework.
One solution appears to be regenerating the cache. The code above will generate the cache by use of makepy.py. It may also print a message about inserting win32com.client.gencache.EnsureModule(...) into AutoItLibrary\__init__.py for any of the Python versions as needed. This will ensure the cache is available when AutoItLibrary
is imported.
Change paths in the code to suit your environment.
With further research:
AutoItLibrary currently has AutoItX 3.3.6.1 and latest AutoIt has AutoItX 3.3.14.5. Important to know as one version registered can overwrite the registration of the previous registration.
AutoItLibrary currently registers AutoIt3X.dll without the _x64 suffix on the name on x64 systems. I may reference AutoIt3_x64.dll to define difference between x86 and x64.
Any version of AutoIt3X.dll and AutoIt3_x64.dll uses the same ID codes and the last registered wins (based on bitness as both x86 and x64 registrations can co-exist).
The TypeLib class key registered ID is {F8937E53-D444-4E71-9275-35B64210CC3B} and is where win32com may search.
If AutoIt3X.dll and AutoIt3_x64.dll are registered, unregister any 1 of those 2 will remove the AutoItX3.Control class key. Without this key, AutoIt3X will fail as AutoItLibrary needs this key. To fix, register again e.g. regsvr32.exe AutoIt3X.dll as admin in the working directory of AutoIt3X.dll.
The methods of any same version of AutoItX will match i.e. AutoIt3X.dll and AutoIt3X_x64.dll only changes in bitness, not methods.
Inserting win32com.client.gencache.EnsureModule("{F8937E53-D444-4E71-9275-35B64210CC3B}", 0, 1, 0) into AutoItLibrary\__init__.py should ensure the cache is always available for any AutoItX version. The initial code can be used to generate the cache, though the suggested change in AutoItLibrary\__init__.py makes it obsolete as the cache is generated on import of AutoItLibrary. If the ID was not constant, then the initial code may inform you of the ID to use.
The cache is important as it has generated .py files with methods like e.g.:
def Send(self, strSendText=defaultNamedNotOptArg, nMode=0):
'method Send'
# etc...
which if missing, makes Send and many others, an invalid keyword in AutoItLibrary.
If AutoItX 3.3.14.5 is registered, the - leading methods are removed and the + leading methods are added as compared to AutoItX 3.3.6.1:
-BlockInput
-CDTray
-IniDelete
-IniRead
-IniWrite
-RegDeleteKey
-RegDeleteVal
-RegEnumKey
-RegEnumVal
-RegRead
-RegWrite
-RunAsSet
+RunAs
+RunAsWait
So if any of those methods causes error, then you may want AutoItX 3.3.6.1 registered instead. In the AutoItX history, 3.3.10.0 release is when those method changes happened.
Fix:
Check your python architecture ( is it 32 or 64 bit)
For 32:
Open cmd in "Run as administrator" mode
run the command pip install robotframework-autoitlibrary
Now clone the autoit library source code:
https://github.com/nokia/robotframework-autoitlibrary
in the root directory run the below command: python setup.py install using cmd in admin mode
to navigate to root directory use the command pushd <filepath>' instead ofcd ` if cd doesn't work in cmd opened in admin mode.
For 64:
Open cmd in "Run as administrator" mode
Now clone the autoit library source code:
https://github.com/nokia/robotframework-autoitlibrary
in the root directory run the below command: python setup.py install using cmd in admin mode
to navigate to root directory use the command pushd <filepath>' instead ofcd ` if cd doesn't work in cmd opened in admin mode.

Installing a package from private GitLab server on Windows

I am struggling with installing a package from a GitLab repository on a Windows computer.
I found different hints but still have problems to install my package from GitLab. First of all, I generated a public and private key with puttygen.exe. The files need to be changed afterwards, I had to remove comments and stuff so they look like my the file on my Unix system. So now, both public and private key files have just a single line.
I tried to install my package via devtools::install_git which takes very long and I get the error message
Error: Failed to install 'unknown package' from Git:
Error in 'git2r_remote_ls': Failed to authenticate SSH session: Unable to send userauth-publickey request
And with devtools::install_gitlab I get a different error message and I somehow have the feeling, the link which gets generated doesn't fit to my GitLab server.
Error: Failed to install 'unknown package' from GitLab:
cannot open URL 'https://gitlab.rlp.net/api/v4/projects/madejung%2FMQqueue.git/repository/files/DESCRIPTION/raw?ref=master'
My complete code to test at the moment is
creds <- git2r::cred_ssh_key(publickey="~/.ssh/id_rsa_gitlab.pub",
privatekey="~/.ssh/id_rsa_gitlab")
devtools::install_git(
url='git#gitlab.rlp.net:madejung/MQqueue.git',
quiet=FALSE,
credentials=creds)
devtools::install_gitlab(
repo='madejung/MQqueue.git',
host='gitlab.rlp.net',
quiet=FALSE,
credentials=creds
)
My id_rsa_gitlab.pub file looks like this and is just a single line:
ssh-rsa AAAA....fiwbw== rsa-key-20200121
The id_rsa_gitlab file has just the code:
AAABA.....3WNSIAGE=
Update
On my Mac system it works as expected after installing the libssh2 library via homebrew and and recompiling git2r with install.packages("git2r", type = "source").
So the working code on my machine is:
creds <- git2r::cred_ssh_key(publickey="~/.ssh/id_rsa_gitlab.rlp.net.pub",
privatekey="~/.ssh/id_rsa_gitlab.rlp.net")
devtools::install_git(
url='git#gitlab.rlp.net:madejung/MQqueue.git',
quiet=FALSE,
credentials=creds
)
For some strange reason, the devtools::install_git call needs about a minute to fail in the end. I have no idea where the problem here is.
After struggling for almost a day, I found a solution I can live with...
I first created a PAT (Personal Access Token) in my gitlab account and granted full API access. For some reason the read_only access didn't worked and I am now tired to figure out what the problem is.
After this I had still problems to install my package and for some reason, the wininet setting for downloading doesn't work.
I used the command capabilities("libcurl") to check if libcurl is available on my windows, which was and tried to overwrite wininet to libcurl by using method='libcurl' in the install function. Somehow, this was not enough so I overwrote the options variable download.file.method directly.
options("download.file.method"='libcurl')
devtools::install_gitlab(
repo='madejung/MQqueue',
auth_token='Ho...SOMETHING...xugzb',
host='gitlab.rlp.net',
quiet=FALSE, force=TRUE
)

Installing an MSP using Powershell works on the local machine, fails remotely. Why?

I need some Powershell advice.
I need to install an application's MSP update file on multiple Win08r2 servers. If I run these commands locally, within the target machine's PS window, it does exactly what I want it to:
$command = 'msiexec.exe /p "c:\test\My Application Update 01.msp" REBOOTPROMPT=S /qb!'
invoke-wmimethod -path win32_process -name create -argumentlist $command
The file being executed is located on the target machine
If I remotely connect to the machine, and execute the two commands, it opens two x64 msiexec.exe process, and one msiexec.exe *32 process, and just sits there.
If I restart the server, it doesn't show that the update was installed, so I don't think it's a timing thing.
I've tried creating and remotely executing a PS1 file with the two lines, but that seems to do the same thing.
If anyone has advice on getting my MSP update installed remotely, I'd be all ears.
I think I've included all the information I have, but if something is missing, please ask questions, and I'll fill in any blanks.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
My process for this is:
Read a CSV for server name and Administrator password
Create a credential with the password
Create a new session using the machine name and credential
Create a temporary folder to hold my update MSP file
Call a PS1 file that downloads the update file to the target server
>>> Creates a new System.Net.WebClient object
>>> Uses that web client object to download from the source to the location on the target server
Call another PS1 file that applies the patch that was just downloaded –>> This is where I’m having issues.
>>> Set the variable shown above
>>> Execute the file specified in the variable
Close the session to the target server
Move to the next server in the CSV…
If I open a PS window and manually set the variable, then execute it (as shown above in the two lines of code), it works fine. If I create a PS1 file on the target server, containing the same two lines of code, then right click > ‘Run With PowerShell’ it works as expected / desired. If I remotely execute my code in PowerGUI, it returns a block of text that looks like this, then just sits there. RDP’d into the server, the installer never launches. My understanding of the “Return Value” value is that “0″ means the command was successful.
PSComputerName : xx.xx.xx.xx
RunspaceId : bf6f4a39-2338-4996-b75b-bjf5ef01ecaa
PSShowComputerName : True
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ProcessId : 4808
ReturnValue : 0
I even added a line of code between the variable and the execution that creates a text file on the desktop, just to verify I was getting into my ‘executeFile’ file, and that text file does get created. It seems that it’s just not remotely executing my MSP.
Thank you in advance for your assistance!
Catt11.
Here's the strategy I used to embed an msp into a powershell script. It works perfectly for me.
$file = "z:\software\AcrobatUpdate.msp"
$silentArgs = "/passive"
$additionalInstallArgs = ""
Write-Debug "Running msiexec.exe /update $file $silentArgs"
$msiArgs = "/update `"$file`""
$msiArgs = "$msiArgs $silentArgs $additionalInstallArgs"
Start-Process -FilePath msiexec -ArgumentList $msiArgs -Wait
You probably don't need to use the variables if you don't want to, you could hardcode the values. I have this set up as a function to which I pass those arguments, but if this is more of a one-shot deal, it might be easier to hard-code the values.
Hope that helps!
using Start-Process for MSP package is not a good practice because some update package lockdown powershell libs and so you must use WMI call

Resources