icon-community / drogon

A robust, lightweight application development framework used for developing, testing, and deploying smart contracts on the ICON blockchain
MIT License
6 stars 3 forks source link

Error after executing "drogon init" #26

Closed FidelVe closed 1 year ago

FidelVe commented 1 year ago

Hello team.

Im trying to run drogon but im running into issues.

I first executed the following command npm install -g @icon-community/drogon, then I make sure that docker is running:

● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: >
     Active: active (running) since Fri 2023-02-03 18:54:32 -04; 2 weeks 2 days a>
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 2616 (dockerd)
      Tasks: 12
     Memory: 550.0M
     CGroup: /system.slice/docker.service
             └─2616 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/contai>

then I executed drogon install, the terminal got stuck for a while and after finishing I executed drogon init but the result is the following error:

$ drogon init                                                                                        [7/27]
 _ .-') _  _  .-')                                             .-') _ ,---.      
( (  OO) )( \( -O )                                           ( OO ) )|   |      
 \     .'_ ,------.  .-'),-----.   ,----.     .-'),-----. ,--./ ,--,' |   |      
 ,`'--..._)|   /`. '( OO'  .-.  ' '  .-./-') ( OO'  .-.  '|   \ |  |\ |   |      
 |  |  \  '|  /  | |/   |  | |  | |  |_( O- )/   |  | |  ||    \|  | )|   |      
 |  |   ' ||  |_.' |\_) |  |\|  | |  | .--, \\_) |  |\|  ||  .     |/ |  .'      
 |  |   / :|  .  '.'  \ |  | |  |(|  | '. (_/  \ |  | |  ||  |\    |  `--'       
 |  '--'  /|  |\  \    `'  '-'  ' |  '--'  |    `'  '-'  '|  | \   |  .--.             
 `-------' `--' '--'     `-----'   `------'       `-----' `--'  `--'  '--'       
✔ Name of the project … test-1                                                         
✔ Do you want to initialize your Drogon project with samples? … no / yes               
✔ Do you want to generate a keystore for this project? … no / yes                
? Is this a token / NFT? No                
? What is the contract name? contract01                                          
Traceback (most recent call last):                                               
  File "/usr/local/bin/tackle", line 8, in <module>                                 
    sys.exit(main())                                                             
  File "/usr/local/lib/python3.9/dist-packages/tackle/cli.py", line 130, in main 
    output = tackle(                                                                   
  File "/usr/local/lib/python3.9/dist-packages/tackle/main.py", line 84, in tackle                                                                                       
    output = update_source(context)                                              
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 1587, in update_source
    return run_source(context, args, kwargs, flags)                                    
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 1051, in run_source
    default_hook_output = context.default_hook().exec()                                                                                                                  
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 1235, in function_walk
    walk_sync(context=tmp_context, element=input_element.copy())                    
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 828, in walk_sync
    walk_sync(context, v)                 
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 771, in walk_sync
    run_hook(context)                     
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 747, in run_hook                                                                                  
    parse_hook(hook_dict, Hook, context)                                            
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 525, in parse_hook
    hook_output_value = run_hook_in_dir(hook)                                       
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 329, in run_hook_in_dir
    return hook.exec()
File "/usr/local/lib/python3.9/dist-packages/tackle/providers/logic/hooks/match.py", line 77, in exec
    raise Exception(f"Value `{self.value}` not found in {self.case.keys()}")        
Exception: Value `contract` not found in <ruamel.yaml.comments.CommentedMapKeysView object at 0x7fd99400a760>
coconut-bunch commented 1 year ago

@FidelVe Im suspecting this happened because the dependencies were not installed fully, since it was hanging. Is it possible for you to do the npm install one more time since we released a version which should potentially fix this issue. Thanks!

FidelVe commented 1 year ago

repeated the installation process

npm install -g @icon-community/drogon

added 231 packages, and audited 232 packages in 28s

30 packages are looking for funding
  run `npm fund` for details

6 vulnerabilities (1 moderate, 5 high)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
drogon install
 _ .-') _  _  .-')                                             .-') _ ,---. 
( (  OO) )( \( -O )                                           ( OO ) )|   | 
 \     .'_ ,------.  .-'),-----.   ,----.     .-'),-----. ,--./ ,--,' |   | 
 ,`'--..._)|   /`. '( OO'  .-.  ' '  .-./-') ( OO'  .-.  '|   \ |  |\ |   | 
 |  |  \  '|  /  | |/   |  | |  | |  |_( O- )/   |  | |  ||    \|  | )|   | 
 |  |   ' ||  |_.' |\_) |  |\|  | |  | .--, \\_) |  |\|  ||  .     |/ |  .' 
 |  |   / :|  .  '.'  \ |  | |  |(|  | '. (_/  \ |  | |  ||  |\    |  `--'  
 |  '--'  /|  |\  \    `'  '-'  ' |  '--'  |    `'  '-'  '|  | \   |  .--.  
 `-------' `--' '--'     `-----'   `------'       `-----' `--'  `--'  '--'  
☐  pending   Installing Drogon...Hold tight, it might take a while!
🧑      ⚽️  🧑 Successfully pulled iconcommunity/drogon:latest
🧑     ⚽️   🧑 Successfully pulled iconcommunity/gochain:latest
✨ Drogon ready for use.
✔  success   Drogon ready for use.

The following error occurs when trying to bootstrap a project

drogon init                                                                     
 _ .-') _  _  .-')                                             .-') _ ,---.        
( (  OO) )( \( -O )                                           ( OO ) )|   |        
 \     .'_ ,------.  .-'),-----.   ,----.     .-'),-----. ,--./ ,--,' |   |        
 ,`'--..._)|   /`. '( OO'  .-.  ' '  .-./-') ( OO'  .-.  '|   \ |  |\ |   |        
 |  |  \  '|  /  | |/   |  | |  | |  |_( O- )/   |  | |  ||    \|  | )|   |        
 |  |   ' ||  |_.' |\_) |  |\|  | |  | .--, \\_) |  |\|  ||  .     |/ |  .'        
 |  |   / :|  .  '.'  \ |  | |  |(|  | '. (_/  \ |  | |  ||  |\    |  `--'         
 |  '--'  /|  |\  \    `'  '-'  ' |  '--'  |    `'  '-'  '|  | \   |  .--.         
 `-------' `--' '--'     `-----'   `------'       `-----' `--'  `--'  '--'         
✔ Name of the project … hello-world                                                
✔ Do you want to initialize your Drogon project with samples? … no / yes           
✔ Do you want to generate a keystore for this project? … no / yes                  
? Is this a token / NFT? No                                                        
? What is the contract name? main contract                                         
Traceback (most recent call last):                                                 
  File "/usr/local/bin/tackle", line 8, in <module>
    sys.exit(main()) 
  File "/usr/local/lib/python3.9/dist-packages/tackle/cli.py", line 130, in main
    output = tackle( 
  File "/usr/local/lib/python3.9/dist-packages/tackle/main.py", line 84, in tackle
    output = update_source(context)
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 1587, in upd
ate_source
    return run_source(context, args, kwargs, flags)
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 1051, in run
_source
    default_hook_output = context.default_hook().exec()
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 1235, in fun
ction_walk
    walk_sync(context=tmp_context, element=input_element.copy())
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 828, in walk
_sync
    walk_sync(context, v)
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 771, in walk
_sync

    run_hook(context)
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 747, in run_
hook
    parse_hook(hook_dict, Hook, context)
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 525, in pars
e_hook
    hook_output_value = run_hook_in_dir(hook)
  File "/usr/local/lib/python3.9/dist-packages/tackle/parser.py", line 329, in run_
hook_in_dir
    return hook.exec()
  File "/usr/local/lib/python3.9/dist-packages/tackle/providers/logic/hooks/match.p
y", line 77, in exec 
    raise Exception(f"Value `{self.value}` not found in {self.case.keys()}")
Exception: Value `contract` not found in <ruamel.yaml.comments.CommentedMapKeysView
 object at 0x7f0a08060610>
coconut-bunch commented 1 year ago

@FidelVe The issue is coming from the tackle code generation(which is outside our control unfortunately). However, since this is not a good developer experience while using drogon, we are addressing with a PR soon. We will update this ticket once we have released it. Thank you for trying Drogon.

han-so1omon commented 1 year ago

@coconut-bunch Any updates here?

ant4g0nist commented 1 year ago

this should be fixed now. Thank you so much @robcxyz for the quick fix 🙏