Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not run cloudlets commands after upgrading to v1.5.1 #159

Closed
dwishnek opened this issue Jun 16, 2022 · 34 comments
Closed

can not run cloudlets commands after upgrading to v1.5.1 #159

dwishnek opened this issue Jun 16, 2022 · 34 comments
Labels

Comments

@dwishnek
Copy link

Was told told to leave message here as opposed to cloudlets area. as the issue may be cli related...

After I upgrade cli from 1.2.1 to 1.5.1, The cloudlets module no longer is recognized. However, when i try to install cloudlets, I get this...

C:\Users\wishnekd\Documents\Git\aws-akamai>akamai install cloudlets
Attempting to fetch command from https://github.com/akamai/cli-cloudlets.git... ... [WARN]
←[33mPackage directory already exists (C:\Users\wishnekd.akamai-cli\src\cli-cloudlets). To reinstall this package, first run 'akamai uninstall' command.←[0m

And when I try to uninstall it, I get this...

C:\Users\wishnekd\Documents\Git\aws-akamai>akamai uninstall cloudlets
ERROR[0000] command "cloudlets" not found. Try "akamai.exe help" command=uninstall
ERROR[0000] UNINSTALL ERROR: command "cloudlets" not found. Try "akamai.exe help" command=uninstall
←[31mcommand "cloudlets" not found. Try "akamai.exe help"←[0m

Any help would be appreciated.

Cloudlets runs perfectly with version 1.2.1

@kaush-
Copy link
Contributor

kaush- commented Jun 17, 2022

Hi @dwishnek,

Thank you for sharing the details. We will get back to you soon while recreating this issue locally. In the meantime can you please confirm that you get the same error when you try akamai install cloudlets after deleting the said directory (C:\Users\wishnekd.akamai-cli\src\cli-cloudlets) manually?

Regards,
Piyush

@kaush- kaush- added the bug label Jun 17, 2022
@robertolopezlopez
Copy link
Contributor

the mentioned directory C:\Users\wishnekd.akamai-cli\src\cli-cloudlets is very strange, there should be a \ between wishnekd and .akamai-cli. We will verify.

@dwishnek
Copy link
Author

I think that was a copy and paste error as I see the "/" on my console...

C:\Users\wishnekd\Documents\Git\aws-akamai>akamai install cloudlets
Attempting to fetch command from https://github.com/akamai/cli-cloudlets.git... ... [FAIL]
ERROR[0000] Package directory already exists (C:\Users\wishnekd.akamai-cli\src\cli-cloudlets) command=install
ERROR[0000] INSTALL ERROR: Package directory already exists (C:\Users\wishnekd.akamai-cli\src\cli-cloudlets) command=install
←[31mPackage directory already exists (C:\Users\wishnekd.akamai-cli\src\cli-cloudlets)←[0m

but here are the results if I delete the cli-cloudlet folder...

C:\Users\wishnekd\Documents\Git\aws-akamai>akamai install cloudlets
Attempting to fetch command from https://github.com/akamai/cli-cloudlets.git... ... [OK]
ERROR[0000] Python >= 3.0.0 not found in the system. Please verify your setup command=install
ERROR[0000] unable to locate runtime: python 3. Please verify if the executable is included in your PATH command=install
Installing... ... [FAIL]
unable to locate runtime: python 3. Please verify if the executable is included in your PATH
ERROR[0000] unable to locate runtime: python 3. Please verify if the executable is included in your PATH command=install
ERROR[0000] INSTALL ERROR: Unable to install selected package command=install
Unable to install selected package

I do have python installed...

C:\Users\wishnekd\Documents\Git\aws-akamai>python --version
Python 3.9.7

And when I copy the old akamai.exe 1.21 back...

The install works...

C:\Users\wishnekd\Documents\Git\aws-akamai>akamai install cloudlets
Attempting to fetch command from https://github.com/akamai/cli-cloudlets.git... [= ] Total 20 (delta 6), reused Attempting to fetch command from https://github.com/akamai/cli-cloudlets.git... ... [OK]
Installing... ... [OK]

Installed Commands:

cloudlets (alias: cloudlets)
Manage Akamai Cloudlets
config
Manage configuration
cps (alias: certs)
Access Certificate Provisioning System (CPS) Information
help
Displays help information
install (alias: get)
Fetch and install packages from a Git repository.
list
Displays available commands
pipeline (aliases: pl, pd, proddeploy)
Akamai Pipeline for DevOps
property
Manage configurations for Akamai properties
property-manager (aliases: pm, snippets)
Property Manager CLI for DevOps
purge
Purge content from the Edge
search
Search for packages in the official Akamai CLI package repository
uninstall
Uninstall package containing
update
Update one or more commands. If no command is specified, all commands are updated
upgrade
Upgrade Akamai CLI to the latest version

See "akamai.exe help [command]" for details.

@dwishnek
Copy link
Author

I noticed again that "/" is not copying over...

image

@dwishnek
Copy link
Author

Worked with Akamai Support. Noticed that the issue started with version 1.4.0. Version Version 1.3.1 works. In the readme docs, we noticed something changed with Python in version 1.4.0.. (Refactor Python support, making use of virtual environments to isolate dependencies for each Python package. ) Not sure if this is whatr is causing the issue.... Need some help

@robertolopezlopez
Copy link
Contributor

OK, I will have a close look to this issue tomorrow afternoon 👍

@robertolopezlopez
Copy link
Contributor

robertolopezlopez commented Jun 23, 2022

I noticed again that "/" is not copying over...

image

stupid question: which version of python do you have installed in your system? Because after reading your error, it says that it cannot find any suitable python.

Yes, from version 1.4.0 the python dependencies management has changed. But the new requirements are clearly shown in the readme file https://github.com/akamai/cli#system-dependencies-for-python-based-packages

@dwishnek
Copy link
Author

dwishnek commented Jun 23, 2022 via email

@robertolopezlopez
Copy link
Contributor

Do you also have pip and venv? Please show me the output of the following:

image

On which OS are you executing CLI?

@dwishnek
Copy link
Author

dwishnek commented Jun 24, 2022 via email

@robertolopezlopez
Copy link
Contributor

Thank you. And what about the output of the other two mentioned commands?

@dwishnek
Copy link
Author

Oh the paste in the email did not translate..

Here..

image

@robertolopezlopez
Copy link
Contributor

robertolopezlopez commented Jun 24, 2022

OK, it must be some windows specific bug. I will start working on a fix as soon as possible and we will release it as soon as we can.

In the meanwhile, you will need to stick to v1.3.x unfortunately :-(

Just another question: have you tried this binary on powershell?

@dwishnek
Copy link
Author

dwishnek commented Jun 24, 2022 via email

@dwishnek
Copy link
Author

I just tried with powershell and received the same error...

image

@robertolopezlopez
Copy link
Contributor

OK, no worries, I will put this task on top of my priorities from Monday.

Another idea popping up to my head which might help you. A possible solution could be:

  1. Delete the directory c:/Users/wishnekd/.akamai-cli/src/cli-cloudlets
  2. ./akamai install cloudlets

@dwishnek
Copy link
Author

yea - see same issue. tried in powershell and just on standard cmd line

@robertolopezlopez
Copy link
Contributor

Hi @dwishnek ,

I have been trying to reproduce your problem inside of a Virtualbox VM (Windows 10 Home 64 bit) with Go 1.18.3 + Python 3.10.5.

Installing cli-cloudlets with CLI 1.3.1:
image

All OK so far:
image

I will now make use of CLI 1.5.1. This first execution of cloudlets with v1.5.1 will take quite long time -at least for me, under virtualbox- because under the hood is creating the cloudlets virtual environment. It is very important not to interrupt the virtual environment creation.
image

Uninstall:
image

Install again:
image

Seems to execute correctly:
image

So far, I cannot find any problem. I have a couple of questions:

  • Do you have the environment variable AKAMAI_CLI_HOME defined? If so, which is its content?
  • What do you have under $AKAMAI_CLI_HOME/venv and $AKAMAI_CLI_HOME/src?

Kind regards,

Roberto

@dwishnek
Copy link
Author

Hi Roberto,

I do not have AKAMAI_CLI_HOME defined.. I have no /venv folder.. See below

Here are the results..

image

@robertolopezlopez
Copy link
Contributor

Could you please set in such case the environment variable AKAMAI_CLI_HOME (SET AKAMAI_CLI_HOME=C:\your\desired\path) and then install cloudlets one more time, to see if that helps?

I am struggling to understand why the virtual environment is not being created automatically in your system, the first time you execute cloudlets with the new binary.

@dwishnek
Copy link
Author

Unfortunately that didn't help either...

Not sure what else to try...

image

@robertolopezlopez
Copy link
Contributor

Hi,

Let's not give up yet :-) Where do you have your python.exe installed? And which is the content of your PATH environment variable?

Regards,

Roberto

@dwishnek
Copy link
Author

dwishnek commented Jul 1, 2022

python is installed here... C:\Users\wishnekd\AppData\Local\Programs\Python\Python39>

But I also see python.exe installed here... C:\Users\wishnekd\AppData\Local\Programs\Python\Python39\Lib\venv\scripts\nt>

but it is definitely a different file..

Here is my path...

PATH=C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Webex\Webex\Applications;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Amazon\AWSCLIV2;C:\Go\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\ISC BIND 9\bin;C:\Program Files\PuTTY;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\ProgramData\chocolatey\bin;C:\Users\wishnekd\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\wishnekd\AppData\Local\Programs\Python\Python39;C:\Program Files\nodejs;C:\Users\wishnekd\Documents\terraform;C:\Program Files\Git\cmd;C:\Users\wishnekd\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\wishnekd\AppData\Local\Programs\Python\Python39;C:\Users\wishnekd\AppData\Local\atom\bin;C:\Users\wishnekd\AppData\Local\GitHubDesktop\bin;C:\Users\wishnekd\go\bin;C:\Users\wishnekd\AppData\Roaming\npm;

@robertolopezlopez
Copy link
Contributor

robertolopezlopez commented Jul 4, 2022

Hi @dwishnek ,

Could you please show the files inside of your directory C:\Users\wishnekd\AppData\Local\Programs\Python\Python39?

This may help me debug the problem.

Regards,

Roberto

@dwishnek
Copy link
Author

dwishnek commented Jul 5, 2022

Here is the listing...

C:\Users\wishnekd\AppData\Local\Programs\Python\Python39>dir
Volume in drive C is Windows
Volume Serial Number is EEEC-904D

Directory of C:\Users\wishnekd\AppData\Local\Programs\Python\Python39

10/12/2021 01:43 PM

.
10/12/2021 01:43 PM ..
10/12/2021 01:42 PM DLLs
10/12/2021 01:42 PM Doc
10/12/2021 01:42 PM include
10/12/2021 01:42 PM Lib
10/12/2021 01:42 PM libs
08/30/2021 08:37 PM 32,628 LICENSE.txt
08/30/2021 08:37 PM 1,085,460 NEWS.txt
08/30/2021 08:36 PM 101,608 python.exe
08/30/2021 08:36 PM 59,624 python3.dll
08/30/2021 08:36 PM 4,488,424 python39.dll
08/30/2021 08:36 PM 100,072 pythonw.exe
06/23/2022 03:41 PM Scripts
10/12/2021 01:42 PM tcl
10/12/2021 01:42 PM Tools
08/30/2021 08:37 PM 97,160 vcruntime140.dll
08/30/2021 08:37 PM 37,256 vcruntime140_1.dll
8 File(s) 6,002,232 bytes
10 Dir(s) 808,872,321,024 bytes free

@robertolopezlopez
Copy link
Contributor

robertolopezlopez commented Jul 5, 2022

Thank you @dwishnek ,

OK, let's try one small "hack" from your side, and you will tell me if it works. In case it does, I will issue a patch from our side.

Could you please copy python.exe to the same directory, with the name python3.exe? :-)

So the new content of your directory will be:

C:\Users\wishnekd\AppData\Local\Programs\Python\Python39>dir
Volume in drive C is Windows
Volume Serial Number is EEEC-904D

Directory of C:\Users\wishnekd\AppData\Local\Programs\Python\Python39

10/12/2021 01:43 PM
.
10/12/2021 01:43 PM ..
10/12/2021 01:42 PM DLLs
10/12/2021 01:42 PM Doc
10/12/2021 01:42 PM include
10/12/2021 01:42 PM Lib
10/12/2021 01:42 PM libs
08/30/2021 08:37 PM 32,628 LICENSE.txt
08/30/2021 08:37 PM 1,085,460 NEWS.txt
08/30/2021 08:36 PM 101,608 python.exe
08/30/2021 08:36 PM 101,608 python3.exe
08/30/2021 08:36 PM 59,624 python3.dll
08/30/2021 08:36 PM 4,488,424 python39.dll
08/30/2021 08:36 PM 100,072 pythonw.exe
06/23/2022 03:41 PM Scripts
10/12/2021 01:42 PM tcl
10/12/2021 01:42 PM Tools
08/30/2021 08:37 PM 97,160 vcruntime140.dll
08/30/2021 08:37 PM 37,256 vcruntime140_1.dll
...

And then, try once again if cloudlets is working.

@dwishnek
Copy link
Author

dwishnek commented Jul 5, 2022

got a different error this time...

So first to install cloudlets, I got this error..

image

Then, If I get cloudlets installed with 1.3.1 and then copy over the new version, and try the following..

C:\Users\wishnekd\Documents\Git\aws-akamai>akamai cloudlets status --policy PROD_Speedpay_Access_Control

I get the following...

image

@robertolopezlopez
Copy link
Contributor

OK, I will try to figure out from this point. Seems that my intuition was correct: not enough windows testing :-)

Still, if I need some more information I will ask you.

Thanks!

@dwishnek
Copy link
Author

dwishnek commented Jul 5, 2022 via email

@robertolopezlopez
Copy link
Contributor

hi @dwishnek ,

Unfortunately, I do not get such errors on my W10 VM. I suspect that the os.Stat() function may be returning a different kind of error in your system than in my VM. Do you mind to save the following snippet as a go file in your filesystem, execute it and share the output? https://go.dev/play/p/kLHY9NikdaG (for example, if you save it as main.go, just execute: go run main.go)

Regards,

Roberto

@dwishnek
Copy link
Author

dwishnek commented Jul 6, 2022

Here you go...

C:\Users\wishnekd\Documents\Git\aws-akamai>go run main.go
%!b(bool=true)

C:\Users\wishnekd\Documents\Git\aws-akamai>

@robertolopezlopez
Copy link
Contributor

robertolopezlopez commented Jul 8, 2022

Hi,

Thank you for your feedback. I have modified a little bit my python VM setup, win10 seems to be adding some extra python.exe which may be interfering with my tests. These is what I have now:
image
Please, verify that in your case you have something similar to this. You can disable them in settings, under "Apps and Features".

Installing cloudlets with akamai 1.3.1 (as you did):
image
...
image

I will try now to make use of akamai 1.5.1 (our develop branch, so it is not 100% the same as our latest release). Once again, first time I invoke cloudlets with this binary the virtual environment gets generated. This takes some time (please do not interrupt).
image

I will now remove my .akamai-cli directory and reinstall cloudlets from scratch.
image
...
image

I cannot really reproduce your problem. If you do not mind, I will try to reach you through customer support and set a call, OK? Thanks.

@robertolopezlopez
Copy link
Contributor

@dwishnek : if you agree, could you please close this ticket?

Apparently, as we were talking on webex, this problem was due to user permissions

@dwishnek
Copy link
Author

Yes issue seems to be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants