How to fix 'HttpRequest' object has no attribute 'endpoint_arguments' in Odoo? - odoo-8

I was given a database backup (with filestore), the filestore folder and another folder with the installed modules on that database.
I am expected to restore that backup in Odoo 8 with no more data. So what I did is create the PostgreSQL role who owns the database tables and give it enough permissions (login, createdb, replication). Then I created an Odoo config file. Inside this, I set this new PostgreSQL role in db_user and its password in db_password. I added the path where I stored the filestore in data_dir, and the path of the folder with all the modules in addons_path.
As I was given no launcher file, I copied the OCB folder of other Odoo instance I have and used its odoo.py file to start Odoo.
The new instance seems to run well, but now I have just restored the database, and I get this error:
QWebException: "'HttpRequest' object has no attribute 'endpoint_arguments'" while evaluating
'website.get_alternate_languages(request.httprequest)'
I was googling a lot but I was not able to find anything about it, except for a non-answered question in other forum.
Does anyone know what is this about?

Changes related to this issue were introduced in Odoo on 29 February, 2016 (I mean the following changes: [FIX] website: alternate languages translated URL and [FIX] website: backport of as you can check for now these changes are available in the official Odoo 8.0 code base as well).
So most probably you have used outdated Odoo 8.0 server that do not contain above mentioned fixes. Please update to the latest official Odoo 8.0 and check if the issue still persists. Normally your issue should disappear after the update.

When you move backup databases and you want to restore them later on, make sure you mark the branch and commit point of the server files that you took the backup from. I have taken a look at my local v8 odoo and I can see that the endpoint_arguments variable is initialised upon the creation of a web request (openerp/http.py class WebRequest around line 192.)
You mention though that you are restoring the database on the v8 OCB Odoo. If you navigate their distribution and on commit:
https://github.com/OCA/OCB/commit/3913667396e17075528108ac1031939e6f479ced#diff-5e2f434047c379642786a87195c806f9
you will see that this variable was missing and they have added it. So make sure that you git pull the server file to get that commit.
The root of the issue is that you took a backup from a server that had different codebase than the one you are trying to restore the database to. (The qweb file was searching for a variable that is not there)

Related

Jelastic: how to contribute to Certified App source code?

while setting up a basic 1 x NGINX load-balancer in front of 2 backends, I ended up in what it is clear to me to be a bug: the cron of this Certified App cannot be edited:
As you can see, in this particular App the cron file is owned by root:root and doesn't have the extended attribute (the plus on the right of permissions) necessary for the file to be edited also by the logged in user (nginx in this case).
All other certified apps allow instead the main login user to have crontabs, even though I found the permissions of each file vary a lot.
I've stumbled on https://github.com/jelastic/jem/blob/master/etc/jelastic/export.conf and it seems the file to go for proposing a bugfix, but it's last update if Aug-2016, so I guess Jelastic had closed much of its source code.
How can we contribute to Certified App source code?
indeed it is a bug as cron file of nginx user isn't editable in a balancer template, by design in has to be.
As for exports.conf - this file left for backwards comparability, but no more used.
The problem will be definitely fixed in latest templates, as for existing containers - we would like to apply a patch to fix them, if you provide us more details about hosting service provider you are using - we will help with that.
As for contribution to certified templates, all the images are publicly available on Docker Hub, you can create your own version of template based on existing one if you build a docker image and in your Dockerfile you specify
"from jelastic/nginxbalancer" as a base, then you can do any modifications to the filesystem. Next step will be just to replace existing balancer with your custom one.
Anyway, let's start with fix of existing containers.
Many thanks for finding out the bug!

Is it possible to specify the location of ".composer"?

Composer version: 0.16.3
It seems composer command by default create/update $HOME/.composer folder. Is it possible to change this folder ? For example, specify some environmental variable, then it create something like $HOME/.composer-stage, $HOME/.composer-production. The purpose is to change the target. E.g. staging environment to production environment for .bna file upgrade.
I remember in 0.12.x, we were able to select connection profiles for target selection.
Thanks !
This is not available at present, but there is an Issue already logged on Github and it is being worked on Hyperledger Composer Issue 3121 - In making the card store more generic it is likely that it will allow you to specify a folder name of your choice.
so the question (and answer here) relates to Hyperledger Composer. The .composer directory represents the wallet or credentials store for business network cards relating to a user connecting to business network(s) whether via CLI, Playground, APIs, REST etc etc. The current answer is no - not presently. See https://github.com/hyperledger/composer/issues/3121 as referred above.

Magento module clean deinstall

i have a problem with installing and deinstalling a module in magento. after resinstalling a module, the previous configuration in the backend is still there.
I deinstalled the module via connect, checked the folders of the server for files that didnt got deleted but i couldnt find anything. No matter how many times i clear cache, delete cache manually from server, after reinstalling the module the configuration i have made in the backend keeps reappearing (the module in question asks for some pathes which i filled in when i first installed it).
So can anyone tell me where these data is stored so i can delete it as well?
The backend database contains some data in a few tables by default.
There are rows in core_config_data for each variable possibly defined for the module, you will have to search it for the keys related to module.
There could be tables created for the module which you will can easily find by the module prefix to tablename.
Also there is a table core_resource, which lists the modules recognized as installed by Magento, which means they are version number controlled.

Showcase website that will reinstall itself every day?

I have built a showcase Magento installation that I am about to deploy public. I'd like to give people backend access but indeed I don't want their changes to stick - not sure how to go about this. What's the best way?
I have seen a Magento showcase somewhere that gave the backend access stating the website will be renewed every 12 hours. So I suppose there is a cron job starting a script that will copy contents of one directory into the other (the public one) every 12 hours?
There are two good solutions:
1. Virtual Machine
Run the entire site in a virtual machine or VPS. Make a snapshot of the machine when it is in the state you want to reset it to. Have a cronjob that triggers the "return to snapshot" routine. The exact details vary between hosts but look for a host with an API.
2. File Copy and DB Reset
Keep a copy of all the files in another folder, together with a dump of the database. You can use mysqldump to create a database dump. You can then go back to that state by having a cronjob that removes the current folder, copies back the old folder and imports the database dump.
There are a few ways to import the database dump file, including the SOURCE command:
SOURCE dumpfile.sql;

Umbraco 7 fields show locally, but not at remote server?

Does anyone know about this problem: Any new fields I add work fine in the local back office, but when I use Webmatrix to publish to the server (discountASP.net) fields don't show up. I did a view source in the browser and they're just not there!
For example, #Umbraco.Field("comments")
Thanks!
Daniel
If you add new field, they are only added in the database. That means you would need to update the database on the production website. Webmatrix doesn't do this for you (by default).
There are a few ways to handle this scenario:
copy your database to the production server (i would advice against this, because you might overwrite content and media changes on the production server)
create the fields manually on the production server (easy solution)
use a commercial package like courrier (personally i believe it's a good solution, only if you have a content staging workflow)
use a free package like usync (http://our.umbraco.org/projects/developer-tools/usync)

Resources