When I try to create campaigns, I get this error:

addCampaign: 801: Unknown advertiserId Error
user warning: Duplicate entry '0' for key 2 query: INSERT INTO openx_manager_campaign (nid, ocid, inventory_impressions, inventory_clicks, inventory_conversions, contract_activation, contract_expiration, contract_revenue, contract_revenue_unit, priority_level_level, priority_distribution_level, priority_misc_hide, priority_misc_positioning, delivery_limit_total, delivery_limit_session, delivery_reset_view) VALUES (50, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1)

Can anyone help me out why or how to fix this problem?

One thing I did to is change the OCID in the openx_manager_user to auto_increment because I thought it would fix the problem.

Comments

westbywest’s picture

The error is your OpenX server (not the openx_manager module) complaining that no advertiser object exists for the campaign you want to create.

Try checking whether the uid of the drupal account you used in attempting to create the campaign exists in the duid column of the openx_manager_advertiser table (and likewise for tables openx_manager_manager and openx_manager_publisher). If the uid doesn't exist, create another admin user and try with that account.

These tables are meant to bind your drupal uid to corresponding objects (advertiser, manager, publisher) on the OpenX server.

The openx_manager module adds entries to these 3 tables upon new user creation when you have user integration turned on in admin/settings/openx-manager/settings. However, it does not populate these tables for user accounts that existed before installing the module, in particular for uid=1.

BlackMage989’s picture

I created a new account and when I did so, received these errors:

* addAdvertiser: 801: Data 'advertiserName' in structure is empty
* addAgency: 801: Data 'agencyName' in structure is empty
* addPublisher: 801: Data 'publisherName' in structure is empty

BlackMage989’s picture

When creating a new campaign, I know get this error:
addCampaign: 801: Unknown advertiserId Error

Also, for the admin user, the duid and the uids match up.

As of right now, the campaigns are being created within the database in drupal but are not being shown in the OpenX server.

BlackMage989’s picture

Ok, here is what I have so far.

When I took out the auto_increment property from openx_manager_user.ouid, the user registered with the OpenX server in the advertisers section but when I went to create a campaign, I got this error again:

# addCampaign: 801: Unknown advertiserId Error
# user warning: Duplicate entry '0' for key 2 query: INSERT INTO openx_manager_campaign (nid, ocid, inventory_impressions, inventory_clicks, inventory_conversions, contract_activation, contract_expiration, contract_revenue, contract_revenue_unit, priority_level_level, delivery_limit_total, delivery_limit_session, delivery_reset_view) VALUES (71, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 1)

But I add the auto-increment, it seems to create the campaign but it does not sync with the OpenX server. The DUIDs are in there also and match in each field.

westbywest’s picture

openx_manager is trying to insert invalid records into the table openx_manager_campaign, i.e. where ocid=0;

How are you creating campaigns? Are you trying to do it via /node/add/campaign? Please note that doesn't work in the current version of openx_manager module, since it doesn't know the appropriate advertiser nid for the current user when you try to use the generic node add form.

When I create a campaign, I have to log in as a user with appropriate openx nodes advertiser, manager, and publisher associated. Then I browse to /user, click on the "Advertiser" tab, and then on the "Create a New Campaign" link.

There is a similar requirement for adding banners, i.e. trying to submit via /node/add/banner will fail. Rather you must browse to the campaign node, and click on the "Create a New Banner" link at the bottom of the page.

Likewise for creating Zones, you must click on the Publisher tab of your user account page and then on "Create a New Zone."

A feature request would be to add relevant drop-down boxes (or some other appropriate form element) to the node creation forms for campaigns, banners, and zones to make this process a bit less unwieldy.

BlackMage989’s picture

That is what I did. I did a reinstall of everything to put everything back in the default settings and I will walk you though step by step of what I get.

1. Install the Modules, everything workout out fine.
2. Configured the module with the OpenX server, everything was fine.
3. Created a New User. These errors came up.
* addAdvertiser: 801: Data 'advertiserName' in structure is empty
* addAgency: 801: Data 'agencyName' in structure is empty
* addPublisher: 801: Data 'publisherName' in structure is empty

4. Clicked on my account, when to the advertister tab. Clicked on Create New Campaign. Everything went fine except for this error:
addCampaign: 801: Unknown advertiserId Error

It appears the campaign did add itself in the table openx_manager_campaign table, despite the error being thrown.

5. Repeat of step 4 of created a new campaign and now I'm back to this error:
# addCampaign: 801: Unknown advertiserId Error
# user warning: Duplicate entry '0' for key 2 query: INSERT INTO openx_manager_campaign (nid, ocid, inventory_impressions, inventory_clicks, inventory_conversions, contract_activation, contract_expiration, contract_revenue, contract_revenue_unit, priority_level_level, delivery_limit_total, delivery_limit_session, delivery_reset_view) VALUES (92, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0,

So it appears I am not able to create two campaigns because it is trying to enter 0 each time in the OCID which is set as a UNIQUE value. I could add auto-increment for the column to possibly fix the error but I do not know if it should be fixed elsewhere. Also th new user and the campaign did not sync with the OpenX server but the old admin account(uid=1) did.

In the database, all the duid do match up correctly. Also for the users, all the opid, omid, oaid are set to 0.

UPDATE

In addition, when I create an additional user, I get this error:

* addAdvertiser: 801: Data 'advertiserName' in structure is empty
* user warning: Duplicate entry '0' for key 2 query: INSERT INTO openx_manager_advertiser (nid, oaid, info_email, duid) VALUES (97, 0, 'bob@gmail.com', 16) in /includes/common.inc on line 3468.
* addAgency: 801: Data 'agencyName' in structure is empty
* user warning: Duplicate entry '0' for key 2 query: INSERT INTO openx_manager_manager (nid, omid, email, duid) VALUES (98, 0, 'bob@gmail.com', 16) in includes/common.inc on line 3468.
* addPublisher: 801: Data 'publisherName' in structure is empty
* user warning: Duplicate entry '0' for key 2 query: INSERT INTO openx_manager_publisher (nid, opid, email, duid) VALUES (99, 0, 'bob@gmail.com', 16) in /includes/common.inc on line 3468.

Which is very similiar to the error here: http://drupal.org/node/446072

westbywest’s picture

From what I understand of openx_manager module (I'm not its developer), the errors you are seeing are being issued from the OpenX server itself, and openx_manager is just repeating them.

Has your module been to able to create *any* object on the Openx server itself, i.e. advertiser, publisher, manager, and not just in the bridge tables maintained by open_manager? Besides username/password issues for connecting to your OpenX server, I see this module has outstanding issues with its implementation of the OpenX api, e.g. http://drupal.org/node/662326

I've been using openx_manager successfully with my own instance of the OpenX Ad Server, v. 2.8.1.

Also, have you tried the reverse path, i.e. create objects first in the OpenX server and then do /admin/settings/openx-manager/import?

BlackMage989’s picture

It has been able to create the advertiser, and that is it. I am using version OpenX Ad Server v.2.8.3 and I am considering giving v.2.8.1 a try.

BlackMage989’s picture

So Im using v2.8.1. Everything seems the same. I tried to do an import of an advertiser and got this: getAdvertiserListByAgencyId: 801: Unknown agencyId Error

westbywest’s picture

I'm sorry to read this is still not working for you. Short of simply trying with a completely fresh Drupal install and performing an import, I'm out of suggestions. My only guess is that something is irrecoverably out of sync between openx_manager's tables under Drupal and the OpenX server itself, in particular with user sync.

I am including all the (anonymized) values from my variable table relevant to my openx_manager v6.x-1.02 module, in case that illuminates any problems.

REPLACE `variable` (`name`, `value`) VALUES
('openx_manager_server', 's:23:"http://blahblahblah.com";'),
('openx_manager_username', 's:8:"blahblah";'),
('openx_manager_password', 's:8:"blahblah";'),
('openx_manager_user_integration', 'i:1;'),
('openx_manager_campaign_inventory', 'a:3:{s:11:"impressions";s:11:"impressions";s:6:"clicks";s:6:"clicks";s:11:"conversions";s:11:"conversions";}'),
('openx_manager_banner_types', 'a:6:{s:3:"sql";s:3:"sql";s:3:"web";s:3:"web";s:4:"url2";s:4:"url2";s:3:"url";s:3:"url";s:4:"html";s:4:"html";s:3:"txt";s:3:"txt";}'),
('openx_manager_banner_target', 's:0:"";'),
('content_extra_weights_openx_banner', 'a:2:{s:5:"title";s:2:"-5";s:4:"menu";s:2:"-2";}'),
('node_options_openx_banner', 'a:2:{i:0;s:6:"status";i:1;s:7:"promote";}'),
('upload_openx_banner', 's:1:"0";'),
('form_build_id_openx_banner', 's:37:"form-27de033e7271cc7a8a2a9d4538a43587";'),
('node_options_openx_campaign', 'a:2:{i:0;s:6:"status";i:1;s:7:"promote";}'),
('upload_openx_campaign', 's:1:"1";'),
('form_build_id_openx_campaign', 's:37:"form-9279184d03f2370c8a89fa0eb70f2f7b";'),
('teaser_include_openx_banner', 'b:1;');

Besides that, have you verified that the Openx server itself is working properly, delivering banner ads to the appropriate zones? For example, it requires a cronjob to run maintenance.php hourly, which was buried a bit in the docs.

http://www.openx.org/en/docs/2.8/adminguide/Running+maintenance