YunoHost / issues

General issue tracker for the YunoHost project
72 stars 8 forks source link

Uncaught exception because of missing lastUpdate field in app info ? #686

Closed yunohost-bot closed 4 years ago

yunohost-bot commented 7 years ago
Original Redmine Issue: 686

Author Name: alexAubin


Trying to install rainloop (which was actually already installed) :

 > yunohost app install rainloop
Traceback (most recent call last):
  File "/usr/bin/yunohost", line 217, in <module>
    timeout=opts.timeout,
  File "/usr/lib/python2.7/dist-packages/moulinette/__init__.py", line 138, in cli
    moulinette.run(args, output_as=output_as, password=password, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/cli.py", line 353, in run
    ret = self.actionsmap.process(args, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 479, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/app.py", line 467, in app_install
    manifest, extracted_app_folder = _fetch_app_from_git(app)
  File "/usr/lib/moulinette/yunohost/app.py", line 1301, in _fetch_app_from_git
    app_info['manifest']['lastUpdate'] = app_info['lastUpdate']
KeyError: 'lastUpdate'

I'm guessing this is because https://raw.githubusercontent.com/polytan02/rainloop_ynh/master/manifest.json doesn't have the "lastUpdate" entry ?

yunohost-bot commented 7 years ago
Properties Change

Author: alexAubin

yunohost-bot commented 7 years ago
Original Redmine Comment

Author: alexAubin


Checking with yunohost app list -r : looks like all apps have a "lastUpdate" property in the json, but not rainloop for some reasons.

yunohost-bot commented 7 years ago
Original Redmine Comment

Author: opi


when you try to install an app by doing yunohost app install fooapp and fooapp already installed before from the Git url, there is no lastUpdate entry anywhere; The lastUpdate key is only set when installing an app from a list (official or community).

yunohost-bot commented 7 years ago
Original Redmine Comment

Author: alexAubin


Hm okay, sooo, shall we check that the app is already installed at the beginning of this command ? (Except for multi-instance app ?)

yunohost-bot commented 7 years ago
Properties Change

Author: alexAubin

yunohost-bot commented 7 years ago
Original Redmine Comment

Author: Gwendal


Hi! Just a quick mention that I encountered the same issue when trying to re-install an app already installed with a git URL.

yunohost-bot commented 7 years ago
Original Redmine Comment

Author: nicofrand


I tried to install redirect (already installed 4 times) and had the same issue. I added "print app_dict[app]" here : https://github.com/YunoHost/yunohost/blob/2de7e3301bd1b1ec5dd4dcf4b25ad371d475314e/src/yunohost/app.py#L1526. Here is the result, if that may help:

{  
    'status':{  
        'installed_at':1486909309,
        'upgraded_at':None,
        'remote':{  
            'url':'https://github.com/YunoHost-Apps/redirect_ynh',
            'type':'git',
            'branch':'master',
            'revision':'baed23e352073a9ef14c534b4fa75c0a9929ee89'
        }
    },
    'installed':True,
    'repository':None,
    'manifest':{  
        'maintainer':{  
            'name':'opi',
            'email':'opi@zeropi.net'
        },
        'description':{  
            'fr':'Cr\xe9er une redirection ou un proxy vers un autre emplacement',
            'en':'Create a redirection or a proxy to another path.'
        },
        'arguments':{  
            'install':[  
                {  
                    'ask':{  
                        'fr':'Choisissez un domaine pour votre redirection',
                        'en':'Choose a domain for your redirect'
                    },
                    'type':'domain',
                    'name':'domain',
                    'example':'domain.org'
                },
                {  
                    'ask':{  
                        'fr':'Choisissez un chemin pour votre redirection',
                        'en':'Choose a path for your redirect'
                    },
                    'default':'/redirect',
                    'type':'path',
                    'name':'path',
                    'example':'/redirect'
                },
                {  
                    'ask':{  
                        'fr':'Emplacement de destination',
                        'en':'Redirect destination path'
                    },
                    'default':'http://127.0.0.1',
                    'name':'redirect_path',
                    'example':'http://127.0.0.1:8080/app/'
                },
                {  
                    'ask':{  
                        'fr':'Est-ce une redirection publique ?',
                        'en':'Is it a public redirect ?'
                    },
                    'default':False,
                    'type':'boolean',
                    'name':'is_public'
                },
                {  
                    'ask':{  
                        'fr':'Type de redirection',
                        'en':'Redirect type'
                    },
                    'default':'visible_302',
                    'name':'redirect_type',
                    'choices':{  
                        'visible_302':'Visible (302 redirect)',
                        'visible_301':'Visible (301 redirect)',
                        'proxy':'Proxy, invisible (Nginx proxy_pass)'
                    }
                }
            ]
        },
        'multi_instance':True,
        'packaging_format':1,
        'services':[  
            'nginx'
        ],
        'requirements':{  
            'yunohost':'>= 2.4'
        },
        'id':'redirect',
        'name':'Redirect'
    }
}
alexAubin commented 4 years ago

Closing because this is probably fixed since then .. app_info etc. got refactored multiple time since 2018